cancel
Showing results for 
Search instead for 
Did you mean: 

How to send a multiple post request in a single batch?

marco_paroti
Explorer
0 Kudos
1,442

I am trying to send multiple POST requests in a single batch.

With these 3 requests we are setting the status on the Notification and Order --> Work Is Done, Complete and Close Report. Like FIORI.

But in the SAP Gateway Client, only the request 1 and 3 are ok. The status for the Order is still the same.

Maybe one request is blocking the other? Do I have to create different changesets? And how do I do that?

Thank you.

Best regards, Marco

Request-URI: 
/sap/opu/odata/sap/EAM_MALFUNCTION_MANAGE/$batch


--batch
Content-Type: multipart/mixed; boundary=changeset


--changeset
Content-Type: application/http
Content-Transfer-Encoding: binary


POST C_MaintNotificationTPPerform_user_action?sap-client=320&MaintenanceNotification='100000001882'&DraftUUID=guid'00000000-0000-0000-0000-000000000000'&IsActiveEntity=true&Statusobject='OV100000675500000001'&Targetstatus='O030'&Eventconfiguration='1'ℜasoncodegroup=''ℜasoncode=''&Isadditionalreason=false HTTP/1.1
Content-Type: application/json
sap-contextid-accept: header
Accept: application/json
Accept-Language: en
DataServiceVersion: 2.0
MaxDataServiceVersion: 2.0
Content-Length: 626


--changeset
Content-Type: application/http
Content-Transfer-Encoding: binary


POST C_MaintNotificationTPPerform_user_action?sap-client=320&MaintenanceNotification='100000001882'&DraftUUID=guid'00000000-0000-0000-0000-000000000000'&IsActiveEntity=true&Statusobject='OR000004001747'&Targetstatus='0050'&Eventconfiguration='1'ℜasoncodegroup=''ℜasoncode=''&Isadditionalreason=false HTTP/1.1
Content-Type: application/json
sap-contextid-accept: header
Accept: application/json
Accept-Language: en
DataServiceVersion: 2.0
MaxDataServiceVersion: 2.0
Content-Length: 800


--changeset
Content-Type: application/http
Content-Transfer-Encoding: binary


POST C_MaintNotificationTPPerform_user_action?sap-client=320&MaintenanceNotification='100000001882'&DraftUUID=guid'00000000-0000-0000-0000-000000000000'&IsActiveEntity=true&Statusobject='QM100000001882'&Targetstatus='0051'&Eventconfiguration='1'ℜasoncodegroup=''ℜasoncode=''&Isadditionalreason=false HTTP/1.1
Content-Type: application/json
sap-contextid-accept: header
Accept: application/json
Accept-Language: en
DataServiceVersion: 2.0
MaxDataServiceVersion: 2.0
Content-Length: 755


--changeset--


--batch--
View Entire Topic
peter_atkin
Active Contributor
0 Kudos

I don't really have very much experience in this area..

But could it be a timing issue in that you aren't giving enough time between request1 and request2 ??

Are there any return messages to say why its failing?

PeteA

marco_paroti
Explorer
0 Kudos

I think there is no commit here.

See also Response (sap-message):

--8E544D77B3BCA0736CB792EC1938B2570

Content-Type: multipart/mixed; boundary=8E544D77B3BCA0736CB792EC1938B2571

Content-Length:     27914



--8E544D77B3BCA0736CB792EC1938B2571

Content-Type: application/http

Content-Length: 9981

content-transfer-encoding: binary



HTTP/1.1 200 OK

Content-Type: application/json

Content-Length: 8433

dataserviceversion: 2.0

sap-message: {"code":"IW/085","message":"Auftrag 4001737 mit Meldung 100000001870 gesichert","severity":"success","target":"/#TRANSIENT#","details":[{"code":"IWO_BAPI2/128","message":"Nach SAVE-Methode muss COMMIT WORK oder ROLLBACK WORK ausgef\u00FChrt werden","longtext_url":"/sap/opu/odata/iwbep/message_text;o=S4HANA/T100_longtexts(MSGID='IWO_BAPI2',MSGNO='128',MESSAGE_V1='',MESSAGE_V2='',MESSAGE_V3='',MESSAGE_V4='')/$value","target":"/#TRANSIENT#","severity":"error"},{"code":"IWO_BAPI2/128","message":"Nach SAVE-Methode muss COMMIT WORK oder ROLLBACK WORK ausgef\u00FChrt werden","longtext_url":"/sap/opu/odata/iwbep/message_text;o=S4HANA/T100_longtexts(MSGID='IWO_BAPI2',MSGNO='128',MESSAGE_V1='',MESSAGE_V2='',MESSAGE_V3='',MESSAGE_V4='')/$value","target":"/#TRANSIENT#","severity":"error"},{"code":"IM/268","message":"Meldung 100000001870 kann nicht abgeschlossen werden","longtext_url":"/sap/opu/odata/iwbep/message_text;o=S4HANA/T100_longtexts(MSGID='IM',MSGNO='268',MESSAGE_V1='100000001870',MESSAGE_V2='',MESSAGE_V3='',MESSAGE_V4='')/$value","target":"/#TRANSIENT#","severity":"error"},{"code":"EAMS_BO/121","message":"Meldung 100000001870 wurde nicht abgeschlossen","target":"/#TRANSIENT#","severity":"error"}]}

location: http://migzmjif.dc.migros.ch:8000/sap/opu/odata/sap/EAM_MALFUNCTION_MANAGE/C_MaintNotificationTP(MaintenanceNotification='100000001870',DraftUUID=guid'00000000-0000-0000-0000-000000000000',IsActiveEntity=true)



--8E544D77B3BCA0736CB792EC1938B2571

Content-Type: application/http

Content-Length: 8752

content-transfer-encoding: binary



HTTP/1.1 200 OK

Content-Type: application/json

Content-Length: 8433

dataserviceversion: 2.0

location: http://migzmjif.dc.migros.ch:8000/sap/opu/odata/sap/EAM_MALFUNCTION_MANAGE/C_MaintNotificationTP(MaintenanceNotification='100000001870',DraftUUID=guid'00000000-0000-0000-0000-000000000000',IsActiveEntity=true)



--8E544D77B3BCA0736CB792EC1938B2571

Content-Type: application/http

Content-Length: 8752

content-transfer-encoding: binary



HTTP/1.1 200 OK

Content-Type: application/json

Content-Length: 8433

dataserviceversion: 2.0

location: http://migzmjif.dc.migros.ch:8000/sap/opu/odata/sap/EAM_MALFUNCTION_MANAGE/C_MaintNotificationTP(MaintenanceNotification='100000001870',DraftUUID=guid'00000000-0000-0000-0000-000000000000',IsActiveEntity=true)



--8E544D77B3BCA0736CB792EC1938B2571--



--8E544D77B3BCA0736CB792EC1938B2570--

Can this not be solved with different changesets? Unfortunately, I have no experience with this.