on 09-22-2015 11:19 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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 !
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
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.