cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CREATE_DEEP_ENTITY issue using $batch

Former Member
0 Likes
6,031

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

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor

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

Former Member
0 Likes

Thanks Ashwin.

The Problem which we see here is Operation_Type is coming as CE which is Create Entity and not CD which is create deep entity.

I am not able to hit the correct method in Changeset process.

Any idea what would be the cause.

Thanks.

Madhur

AshwinDutt
Active Contributor
0 Likes

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.

Former Member
0 Likes

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

AshwinDutt
Active Contributor
0 Likes

ls_operation is of type what ?

It will be something like this.

Just for example ->

data : ls_operation type  zcl_XXX_mpc=>ts_XXX.


Please check yours and define accordingly.


Are you able to see data inside entry_provider at the first place ?

Former Member
0 Likes

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

AshwinDutt
Active Contributor
0 Likes

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.

Former Member
0 Likes

Thanks alot Ashwin.

Issue Resolved

AshwinDutt
Active Contributor
0 Likes

Where you able to get content_id and content_id_ref from it_changeset_request ?

I kindly request to share here what you implemented to accomplish you scenario in brief would help others to get idea how to implement when they have the same kind of scenario

Answers (1)

Answers (1)

Former Member
0 Likes

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