cancel
Showing results for 
Search instead for 
Did you mean: 

OData SADL Batchrequest with multiple changesets doesn't work

Former Member
0 Kudos


Hello,
I’m currently developing a UI5 Application.
My oData service is based on SADL, so the implementation to retrieve the data is the generated SADL-standard implementation.
My problem is this: When I try to execute a batch request with multiple changesets, I get a short dump with the error MESSAGE_TYPE_X.
The error occurs in the program  /IWBEP/SAPLFGR_MGW_CLIENT_IF in the commit_check which is executed when commit work is called in /BOBF/IF_TRA_TRANSACTION_MGR~SAVE, because in my case mv_changeset_optotal is > 1.
When I just skip over the commit_check in the debugger, the batch finishes without problem.
Is there any possibility to avoid this check?
What's the sense of a batchrequest, if I can't hand over more than one request? My intention is to make more request by once, for better performance.

Kind regards, Stefan Frank


FORM commit_check .

* Commit Work is allowed for anyone of the following cases:
*   - no ChangeSet
*   - only one operation in Changeset
*   - during CHANGESET_END
  IF  mv_changeset_optotal = 1             OR
     mv_changeset_processing <> abap_true OR
     mv_changeset_end_processing = abap_true.
    EXIT.
  ENDIF.

  MESSAGE x051(/iwbep/cm_mgw_rt).

ENDFORM.

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Stefan,

Your Batch consists of only GET Requests ? or GET along with POST/DELETE/UPDATE ?

If at all you are performing only GET operations inside BATCH, then no need of specifying ChangeSet inside the payload.

Change_Set is to group all the operations and treat it as a single Logical Unit of Work. Commit is issued only once at the end after successful execution of all those operations.We specify Change_Set for modifying requests or for Change_Set&Retrieval Cases.

So could you please elaborate what all operations are being done inside a batch request ?

Regarding issuing Commit or Roll back please have a look at the below under ChangeSet_Begin/End->

/IWBEP/IF_MGW_APPL_SRV_RUNTIME - SAP NetWeaver Gateway - SAP Library

Regards,

Ashwin

Former Member
0 Kudos

Hello Ashwin,
I’m using multiple UPDATE, DELETE and POST requests for different entities, that’s why I needed multiple changesets.
From what I understand, it seems, that it is not allowed to call COMMIT WORK while the changesets are being processed. But COMMIT WORK is called in /BOBF/IF_TRA_TRANSACTION_MGR~SAVE, which seems to be executed every time after one entity is updated/deleted/created. Since the implementation is the generated SADL-standard implementation, I can’t change that directly.
When I just skip the commit in the debugger, my update/delete/create requests work without problem.
Kind regards,
Stefan Frank

AshwinDutt
Active Contributor
0 Kudos

Hello Stefan,

Try below once and check.

Put each operations associated with each entity within in a separate Change_Set and batch ( Highlighted ones ).

Sample Payload ->

--batch

Content-Type: multipart/mixed; boundary=changeset

--changeset

Content-Type: application/http

Content-Transfer-Encoding: binary

POST Create_dataSet HTTP/1.1

Content-Type: application/json

Accept: application/json

Content-Length: 975

{

"ID":"1023",

"Name":"John"

}

--changeset--

--batch

Content-Type: multipart/mixed; boundary=changeset

--changeset

Content-Type: application/http

Content-Transfer-Encoding: binary

PUT Update_dataSet(ID='1023') HTTP/1.1

Content-Type: application/json

Accept: application/json

Content-Length: 975

{

"ID":"1023",

"Name":"Nick"

}

--changeset--

--batch

Content-Type: multipart/mixed; boundary=changeset

--changeset

Content-Type: application/http

Content-Transfer-Encoding: binary

DELETE Delete_dataSet(ID='1023') HTTP/1.1

--changeset--

--batch--

Create your payload as above and check value of mv_changeset_optotal .

Regards,

Ashwin

Former Member
0 Kudos

Hello Ashwin,
Thank you very much for your help, putting the operations into separate changesets solved my problem.
Before I just inserted all my operations into a single changeset, by calling addBatchChangeOperations just once. I had to call it separately for each operation, and now the batch request works just fine.
Kind regards, Stefan Frank !

mayankmrai
Explorer
0 Kudos

can you please share the syntax how have you added different changeset in the batch call

Answers (0)