on 10-12-2016 9:49 AM
Hello people
I have a scenario where I have one primary entity say SalesOrder and 2 secondary entities(Items and Products). I want to expand from SalesOrder to Items and also from SalesOrder to Products. How do I implement multiple expand in the GET_EXPANDED_ENTITY AND GET_EXPANDED_ENTITYSET
Thank you
Hello Timothy,
Please have a look at the below : This will give you idea on how to model the serivce as per your requireents.
https://blogs.sap.com/2014/07/18/implementing-expand-entityentity-set/
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
Though late but I implemented something similar here - https://blogs.sap.com/2017/09/18/generic-expanded-entity-implementation/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Timothy,
When you have your entity in the method, you can add the expanded other entities to it. Just declare your entityset with the "child" entities and return this.
In my example below i have done it for purchase order, which is used to recieve GR items and also purchase order items.
DATA: BEGIN OF ls_expanded_order.
INCLUDE TYPE ZCL_ZGW_PO_GR_MPC=>TS_ET_PURCHASEORDERHEADER.
DATA: ET_GRITEM TYPE ZCL_ZGW_PO_GR_MPC=>TT_ET_PURCHASEORDERITEM,
ET_PurchaseOrderItemSet TYPE ZCL_ZGW_PO_GR_MPC=>TT_ET_PURCHASEORDERITEM,
END OF ls_expanded_order.
...
copy_data_to_ref(
EXPORTING
is_data = lt_order_item
CHANGING
cr_data = er_entityset ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.