on 09-15-2016 11:23 PM
Hi Experts,
I have done some posts for understood the functionality batch. But I can't understand how can I insert many records from sapui5 for sap gateway netweaver
I have the following scenario:
The users create items and this items need to be sent for sap gateway netweaver to generate the request with an existent bapi.
My doubt is how can I send many records in same request and how can I read this inside sap gateway in method created ? Can you please share a tutorial or explain me how can I do this ?
Thanks very much for your help.
Best Regards
Cristina Rodrigues
Hi Cristina,
The batch operation in GW is used for sending multiple update or retrieve operations in one request .Update can be POST or a PUT .In your case it is POST operation for multiple Items.
In your above example Item 1,Item 2 and Item 3 belong to a Changeset (say changeset 1 ) inside a request.The concept of changeset is that all the operations should be succesful or none should be succesful.For eg if Item 2 post fails it shud rollback item 1 post and shud not continue with Item 3 post. ..
Coming to how this request 1 is handled in the GW framework class, This request will first call the CHANGESET_BEGIN of the correspoding DPC_EXT class and then then it will call in a loop the CREATE_ENTITY method of the ITEM (in your case 3 times) and then finally it will call the CHANGESET_END method.
I think your backend API interface can accept the items in mass and do the post for all the items. In that case , you redefine the CREATE_ENTITY of the ITEM entity to buffer the individual items to an internal table attribute MT_ITEM and finally in the CHANGE_SET_END method you call the backend AP with MT_ITEMS I to persist the change ..
BR
Arshad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Akhilesh,
I saw this tutorial but anyone explain what I need to in method created and if I need make any change in methods CHANGESET_BEGIN and CHANGESET_END.
My question is , what is necessary to do in methods created , CHANGESET_BEGIN and CHANGESET_END for put the items I need in a table , but read one by one from http request ? For me is a little confused.
Because from what I understand is that the gateway can read many records but I don't know if this records need to be separated.
Thanks very much
Best Regards,
Cristina Rodrigues
Hello Cristina,
What is the operation you are doing ? POST ?
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
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.