on 2024 Apr 30 3:31 PM
Hi.
I tried to create a service in which we have to send more than one entry via OData service.
My project name is ZVBAP and I use VBAP table fields which are vbeln, posnr and matnr.
So by use of Create entity I can send the single entry to the Standard table but after many try I didn't get any solution to how to send more than one entry in Standard table.
Also I tried this in METHOD /iwbep/if_mgw_appl_srv_runtime~create_entity but still it doesn't run and it affects the Create entity service also.
Please help me to solve this.
Thanks in advance.
Rohan Chauhan
You can't create multiple entries with OData's CRUD operations. For bulk creation, use batch processing.
Edit: You can also make use of OData's deep create feature. You'll have to modify your OData to add a new parent entity type (For example, a VBAK entity type) which will hold multiple VBAP entities using navigation property (VBAK 1:N VBAP cardinality). Sending a deep create request on VBAK will let you pass multiple VBAP entries in same request, the multiple entries then can be created in backend all at once.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For Deep create, you have the control over whether the parent entity is created in the table. You can extend the CREATE_DEEP_ENTITY method in your data provider class. Simply omit the code responsible for inserting parent entity data into the table.
For batch processing see (https://community.sap.com/t5/technology-blogs-by-members/odata-batch-processing-part-1/ba-p/13484676)
If you are using Ui5, you don't have to worry about manually passing all these HTTP headers and payloads. For example, for Odata V4, you can simply call sap.ui.model.odata.v4.ODataListBinding:create method to add create requests to queue, and finally call sap.ui.model.odata.v4.ODataModel:submitBatch to send the batch create request to the server.
User | Count |
---|---|
69 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.