Hi, I want to get the results of MMS080MI's transaction LstMtPlByItmWhs but it return an empty array. It's the only one that does that, I use several APIs in my odin application and it works fine, but when trying to call this transaction, I can't get the data.
Here's my code :
My component :
async populateData () { console.log(this.vInt_ITNO, this.vStr_WHLO); if (!this.vInt_ITNO) return; try { const response = await firstValueFrom(this.planningService.getPlanningArticle<any>(this.vInt_ITNO, this.vStr_WHLO, '')); if (!response || response.length === 0) { this.vBoo_Visible = false; this.updateGridData(this.dataGridPlanningArticles, []); return; } const enriched = await Promise.all( response.map(async (item) => { if (item['ORCA'] === '311') { try { const custOrder = await firstValueFrom( this.planningService.getCustomerOrderNumber<any>(item['RIDN']) ); item['CUOR'] = custOrder?.[0]?.['CUOR'] ?? ''; } catch { item['CUOR'] = ''; } } return item; }) ); this.vBoo_Visible = enriched.length > 0; this.updateGridData(this.dataGridPlanningArticles, enriched); } catch (err) { console.error('Erreur dans populateData (planning ORCA 311)', err); this.vBoo_Visible = false; this.updateGridData(this.dataGridPlanningArticles, []); } }
and the related service that call 'getData' wich is a generic api call (that works for other api calls) :
import { Injectable } from "@angular /core";import { CoreBase } from "@infor -up/m3-odin";import { Observable, of } from "rxjs";import { ApiGenericService } from "./api.service";@Injectable ()export class PlanningService extends CoreBase { inputFields: any = {}; constructor(private apiService: ApiGenericService) { super('PlanningService'); } getPlanningArticle<T> (itno: string, typeOrdre: string = '', whlo: string = 'SE'): Observable<T[]> { return this.apiService.getData<T>('MMS080MI', 'LstMtPlByItmWhs', { WHLO: whlo, ITNO: itno, ORCA: typeOrdre, }); } getCustomerOrderNumber<T> (ridn: string): Observable<T[]> { return this.apiService.getData<T>('OIS100MI', 'GetOrderHead', { ORNO: ridn, }, ['CUOR'], 1); }}
Thank you for the help