on 03-03-2016 6:00 AM
Hello Experts,
While invoking CREATE_DEEP_ENTITY using $batch, we are facing one issue that breakpoint is not getting stopped at Redefine method.
We have redefine below method. The idea is to do CREATE_DEEP_ENTITY using $batch sending work order header and its Operations.
Request Body which we are sending is as below:
--batch_709b8b9352ac4342a0efb1e012d_1
content-type: multipart/mixed; boundary=changeset_709b8b9352ac4342a0efb1e012d_2
--changeset_709b8b9352ac4342a0efb1e012d_2
content-type: application/http
content-transfer-encoding: binary
content-id: 1
POST WoHeaderSet HTTP/1.1
Content-Type: application/json
Accept: application/json;q=1, application/atom+xml;q=0.5
{"Aufnr":"123","Auart":"PM01","Autyp":"30","Ktext":"New WO frm Device"}
--changeset_709b8b9352ac4342a0efb1e012d_2
content-type: application/http
content-transfer-encoding: binary
POST $1/NavOpera HTTP/1.1
Content-Type: application/json
Accept: application/json;q=1, application/atom+xml;q=0.5
{"Aufnr":"123","Aufpl":"1000000092","Aplzl":"00000001","Vornr":"0010","Werks":"OD99","Ltxa1":"New opr"}
--changeset_709b8b9352ac4342a0efb1e012d_2--
--batch_709b8b9352ac4342a0efb1e012d_1--
But the problem is code is going into Standard Changset method and throwing us exception :"Default changeset implementation allows only one operation”.
--489CBE8C201BBF799E2DF4B92A3548D80
Content-Type: application/http
Content-Length: 1174
content-transfer-encoding: binary
HTTP/1.1 500 Internal Server Error
Content-Type: application/json;charset=utf-8
Content-Length: 945
location: http://XXXXXXXXXXXXXXXXXXXXXXXXXXXXX/WoHeaderSet('')
dataserviceversion: 1.0
{"error":{"code":"/IWBEP/CM_MGW_RT/053","message":{"lang":"en","value":"Default changeset implementation allows only one operation."},"innererror":{"application":{"component_id":"","service_namespace":"/SAP/","service_id":"ZODS_WORKMANAGER_TEST_SRV_01","service_version":"0001"},"transactionid":"56D57FE0FB5128D0E1000000AC1F152C","timestamp":"20160303053242.2035240","Error_Resolution":{"SAP_Transaction":"Run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details","SAP_Note":"See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)","Batch_SAP_Note":"See SAP Note 1869434 for details about working with $batch (https://service.sap.com/sap/support/notes/1869434)"},"errordetails":[{"code":"/IWBEP/CX_MGW_TECH_EXCEPTION","message":"Default changeset implementation allows only one operation","propertyref":"","severity":"error","target":""}]}}}
--489CBE8C201BBF799E2DF4B92A3548D80--
Request you to kindly guide us why its not going into CREATE_DEEP_ENTITY Method.
Thanks,
Madhur Kanungo
Hello Madhur,
As far as i know this will not trigger Create Deep Entity Method when Content ID referencing is used.
You need to call DPC in defer mode for required Entities and collect all the operations inside ChangeSet in ChangeSetProcess.
Please try as below and check.
1. In ChangeSetBegin Method set CV_DEFER_MODE 'True'.
2. In ChangeSetProcess Method collect all the ChangeSet operations from IT_CHANGESET_REQUEST to get Content ID details and perform your operation.
3. In ChangeSetEnd Method after successful creation perform Commit Work.
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
CD will be populated when we actually send a Deep Entity Payload i.e., when we have a payload with both Header and Item details as part of a single POST method. But here your case is not so.
If you look at your Payload you have 2 Entities with POST HTTP Method and are linked through reference ID and Navigation Property. So CE is picked as each Operation inside a single ChangeSet is treated as 2 different POST Operations. We need to collect these 2 operations inside ChangeSetProcess only and perform create.
Hello Ashwin,
Thanks for the response and i am able to see the data flowing properly.
However , while reading the operation details from Request body. Example as below:
POST $1/NavOpera HTTP/1.1
Content-Type: application/json
Accept: application/json;q=1, application/atom+xml;q=0.5
{"Aufnr":"123","Aufpl":"1000000092","Aplzl":"00000001","Vornr":"0010","Werks":"OD99","Ltxa1":"New opr"}
--changeset_709b8b9352ac4342a0efb1e012d_2--
--batch_709b8b9352ac4342a0efb1e012d_1--
SAP ABAP Code:
when 'WOOperation'.
" Operation Number in current changeset
ls_changeset_response-operation_no = ls_changeset_request-operation_no.
" Get create data
ls_changeset_request-entry_provider->read_entry_data( IMPORTING es_data = ls_operation ).
My code is not able to fill the Ls_operation structure.
Kindly let me know if i am doing anything wrong.
Thanks,
Madhur
Thank You Ashwin.
I have done some Modifications and I am able to create data using Deep insert.
My Data is creating in backend and i get status code as 202 but when i see the response i get this error.
--9723FF78A6BFF38B74E46224874946420
Content-Type: application/http
Content-Length: 1388
content-transfer-encoding: binary
HTTP/1.1 500 Internal Server Error
Content-Type: application/json;charset=utf-8
Content-Length: 1140
location: http:/XXXXXXXXXXXXXXXXXXX/ZODS_WORKMANAGER_SERVICE_SRV/WOOperationSet(Aufpl='',Aplzl='')
dataserviceversion: 1.0
{"error":{"code":"/IWBEP/CM_MGW_RT/058","message":{"lang":"en","value":"Missing response data in changeset deferred processing mode. Diagnosis Missing response data for some operation in a changeset running in defer mode System Response Procedure Fix the programming error in data provider Procedure for System Administration"},"innererror":{"application":{"component_id":"","service_namespace":"/SAP/","service_id":"ZODS_WORKMANAGER_SERVICE_SRV","service_version":"0001"},"transactionid":"56D585FDFB5128D0E1000000AC1F152C","timestamp":"20160303105624.4298220","Error_Resolution":{"SAP_Transaction":"Run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details","SAP_Note":"See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)","Batch_SAP_Note":"See SAP Note 1869434 for details about working with $batch (https://service.sap.com/sap/support/notes/1869434)"},"errordetails":[{"code":"/IWBEP/CX_MGW_TECH_EXCEPTION","message":"Missing response data in changeset deferred processing mode","propertyref":"","severity":"error","target":""}]}}}
--9723FF78A6BFF38B74E46224874946420--
Any Idea about this error ?
Thanks,
Madhur
That is because response is not mapped back to GW.
After you read each payload as below -> ( i assume its already being done )
" Read the Payload
ls_changeset_request-entry_provider->read_entry_data( IMPORTING es_data = <Your_Structure> ).
Every single time you need call the below code -
" Set response data
copy_data_to_ref(
EXPORTING
is_data = <Your_Structure>
CHANGING
cr_data = ls_changeset_response-entity_data ).
" Set response entry without response data at this time
INSERT ls_changeset_response INTO TABLE ct_changeset_response.
Hello Expert,
I have figured out the problem and my breakpoint is changeset begin method is triggering properly.
But its not still reaching to CREATE DEEP Entity method.
I am getting below error.
--04896B02DD9BA0C4B60184CFE3E18B980
Content-Type: application/http
Content-Length: 1172
content-transfer-encoding: binary
HTTP/1.1 500 Internal Server Error
Content-Type: application/json;charset=utf-8
Content-Length: 943
location: http://XXXXXXXXXXXXXXXX/ZODS_WORKMANAGER_SERVICE_SRV/WoHeaderSet('')
dataserviceversion: 1.0
{"error":{"code":"/IWBEP/CM_MGW_RT/187","message":{"lang":"en","value":"Content referencing is only allowed for changeset at once."},"innererror":{"application":{"component_id":"","service_namespace":"/SAP/","service_id":"ZODS_WORKMANAGER_SERVICE_SRV","service_version":"0001"},"transactionid":"56D5E387FB4B28CFE1000000AC1F152C","timestamp":"20160303064031.8581340","Error_Resolution":{"SAP_Transaction":"Run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details","SAP_Note":"See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)","Batch_SAP_Note":"See SAP Note 1869434 for details about working with $batch (https://service.sap.com/sap/support/notes/1869434)"},"errordetails":[{"code":"/IWBEP/CX_MGW_TECH_EXCEPTION","message":"Content referencing is only allowed for changeset at once","propertyref":"","severity":"error","target":""}]}}}
--04896B02DD9BA0C4B60184CFE3E18B980--
Thanks,
Madhur
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
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.