on 10-22-2015 8:26 AM
I have some strange behaviour with the deep insert. I have implemented it 2 times.
- a parent with one child (e.g. SalesOrderHeader with SalesOrderItems).
- a parent with two children (e.g. SalesOrderHeader with SalesOrderItems and Partners)
The used user defined entities, but the above examples are just to make it clear.
When I POST the first one, I get both the SalesOrderHeader with the SalesOrderItems returned.
When I POST the second one, I get only the SalesOrderHeader returned. I am sure that I pass the data to the output parameter "ER_DEEP_ENTITY"
If I pass for the second one only the SalesOrderItems, I get all data returned.
I need the output, because it contains the keyfields of the data created.
Am I doing something wrong? Is this a problem of SAP?
Regards, Paul Lauwers.
Application Engineer at IFF.
I now tested with another deep insert ('FmCase'). This has up to 6 Navigation Properties as a child. Most of the time only one is filled. For instance when I pass 'OtherLocations' in the payload only, I see the 'OtherLocations' also in the results. When I pass 'WorkListItems' only, I see the 'WorkListItems' in the results. When I pass both 'OtherLocations' and 'WorkListItems', I only get the header part 'FmCase'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Paul,
Most probably the problem is with the type declaration of source structure of ER_DEEP_ENTITY. It has to be with navigation property names.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Paul,
Firstly its not the problem with SAP Gateway. We should get all the details as output as part of Create Deep Entity response..
Can you share the GW Model of your service ? Associations and Navigation ?
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you, please, post the structure, that you has defined for passing to ER_DEEP_ENTITY.
I suppose that cardinality from SalesOrderHeader to both, SalesOrderItems and Partners, is set to something like 1:M or 1: N.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The structure of the Parent with one child:
BEGIN OF TS_case_DEEP,
CASE_GUID type scmg_CASE_GUID,
CASE_TYPE TYPE SCMGCASE_TYPE,
EXT_KEY type scmg_ext_key,
worklistitem_ind type wdy_boolean,
WorkListItems TYPE STANDARD TABLE OF TS_worklistitem with default key,
end OF TS_case_DEEP .
The structure of the Parent with Multiple children:
BEGIN OF TS_SIMULATESO,
* These are all the Properties of Entity Type Simulate.
VBELN type C length 10,
AUART type C length 4,
VKORG type C length 4,
VTWEG type C length 2,
SPART type C length 2,
atp_ok type c LENGTH 1,
conf_date type c LENGTH 8,
gi_date type c LENGTH 8,
* Tables below should have the same name as the Navigational Properties of Entity Type Simulate
items TYPE STANDARD TABLE OF ts_item WITH DEFAULT KEY,
partners TYPE STANDARD TABLE OF ts_partner WITH DEFAULT KEY,
stock TYPE STANDARD TABLE OF ts_stock WITH DEFAULT KEY,
messages TYPE STANDARD TABLE OF ts_message WITH DEFAULT KEY,
END OF TS_SIMULATESO.
Cardinality is 1:M. I validated the Navigation Properties of Simulate and they match the definitions above.
1. I'd suggest you to put a breakpoint at the beginning of /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_DEEP_ENTITY and check if ls_simulateso (or your structure of type TS_SIMULATESO) contains a proper result after calling of
io_data_provider->read_entry_data( IMPORTING es_data = ls_simulateso ).
for both cases: when you send POST request with SalesOrderItems only and with SalesOrderItems and Parthers.
If it doesn't for the second case - the problem is with your POST request data.
2. When you send back Response at the end of CREATE_DEEP_ENTITY method by something like
copy_data_to_ref( EXPORTING is_data = ls_simulateso CHANGING cr_data = er_deep_entity ).
does it contain a proper result?
If it doesn't - the problem is in the code, which fills up the output of your request.
Excuse me, Paul, but "Both the request and the response contain the proper data" and "When I add the partners they are gone again" somehow do not correspond one to another. With such a little amount of details it is not so easy to help you.
If you add Partners into the POST and do not see them in the request within CREATE_DEEP_ENTITY method, something could be wrong with the POST. Please, share both POST request examples.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.