on 02-17-2015 4:13 AM
Hi
I want to do the POST for Gateway Service URL. ( but it with $Expand addition)
The URL works correctly for GET method.
URL looks like this
http://XXX.XX:500/sap/opu/odata/sap/ZTEST_ORDER_SRV/ORDDetail(Userid='xyz',WorkType='36') ?$expand =ORDPerset,ORDHistorySet.
This works fine for GET method which gives multiple records for in Parts entity set (ORDPartset ), History Entity set (ORDHistoryset).
Work type is the key field for Parts entity set (ORDPartset ), History Entity set (ORDHistoryset) .
Requirement: If I use POST method and Pass worktype as '37', then it should be updated in these Parts entity set (ORDPartset ), History Entity set (ORDHistoryset) .
(Parts entity set (ORDPartset ), History Entity set (ORDHistoryset) is related to separate custom tables.
So finally entityset will update these custom tables)
So please let me know how to use the POST method in this case.
Thanks,
Shreedhar Gangadhar
Hello Shree,
Through $expand you cannot perform POST operation having Deep Structure ( Header & Item Relation ).
You need to implement appropriate logic Create_Deep_entity Method in DPC_EXT class and then send your Header and Child Items as part of PAYLOAD in POST operation.
For this you need to Model your GW Service by creating Association and Navigation between the Header and Item Entities with correct cardinality.
Refer this and you should be able to POST both Header and Items in one go ->
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 Shreedhar,
you have to use deep insert.
For this you have to implement the method /iwbep/if_mgw_appl_srv_runtime~create_deep_entity.
Using the SAP Gateway client you can first retrieve a result via expand as you have shown and use the payload using the "use as request" option to perform a POST that will trigger the deep insert method.
Regards,
Andre
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
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.