on 10-14-2020 11:10 AM
Hi,
Can anyone provide a suggestion for how to fetch an entityset with tables/collections in it?
I'm fetching material masterdata from backend (S/4 1909) to an offline odata store.
{ material
material_group
units [
{ unit_iso
ean }
]
As you can see, I need a table below each entity with additional EAN numbers and their unit. Is the only way to do this to use $expand? The problem, the way I see it, is that I want to fetch all data in one call (one DB call) instead of a lot of expands, as the EAN's should be available for barcode scanning.
Hi Pete, in SAP gateway you can redefine the method GET_EXPANDED_ENTITYSET and select all your data at once (articles & upcs).
Then you can do a loop inside another loop and prepare the exporting parameter for your entityset
call your URL with a regular expand
https://........../ArticleSet?$expand=UPCs
also use the referential constraints in SAP Gateway when linking your 2 entities
alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi alexandre.giguere3 !
Regarding referential constraints - is this always recommended? Since my main entity has id(matnr) as key, and list of ean11 and meins are part of each entity, I don’t see the need to add matnr to the units entity and to create constraints. Do you agree or do you see some pros that I don’t?
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.