cancel
Showing results for 
Search instead for 
Did you mean: 

Data modelling best practices

Former Member
0 Kudos

Are there any data modelling best practices?

Let's say I am creating a master detail SAPUI5 app to display purchase orders and their items.

So I have got two entities PurchaseOrder (header) and PurchaseOrderItem and an association + navigation between them and that concept is clear.

But also for my PurchaseOrder entity I would like to show the vendor name. As we know table EKKO has only LIFNR (vendor number). Should I model my PurchaseOrder entity that it has VendorName in its properties and in the GET_ENTITY and GET_ENTITYSET join EKKO with LFA1 table to get the vendor name. Or should I create another Vendor entity, create a navigation between PurchaserOrder and Vendor entity and in my SAPUI5 app use the 'expand' parameter to fetch the vendor name? Which is the correct approach and why? When should I create a new entity with navigation and when should I fetch the additional data in the existing entity?


Thanks,


Radek



Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Radek,

Using of Data Provider Expand or Frame Work Expand depends on your scenario. It depends on case to case.

However If you look at your current GW model ( if i understood correctly .. ), you are already fetching PO and its Items details in one go using Data Provider Expand i.e., $expand.

So you can add another property in the existing PO entity which holds the Vendor Name and send back this along with PO and Its Items details.

Regards,

Ashwin

Answers (0)