Skip to Content

How to use Batch operation of SAP HANA Service layer for multiple transaction in one request

How to use Batch operation of SAP HANA Service layer for multiple transaction in one request

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jan 29 at 02:27 PM

    Hi Rahul,

    Please allow me some time to check it and come back to you.

    Kind regards,

    ANKIT CHAUHAN

    SAP SME Support

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 30 at 11:36 AM

    Hi Rahul,

    Service Layer supports executing multiple operations sent in a single HTTP request through the use of Batch Operations. Refer to the "Service_Layer_Documentation" which shows how you can use Batch Operations using Service Layer.

    Below is an example to Create Multiple Business Partners in a Single HTTP Request Using Service Layer Batch Operations:

    1. Batch Request Headers:

    In the Header, you must set the key “Content-Type” with the value as multipart/mixed;boundary=batch_36522ad7-fc75-4b56-8c71-56071383e77c. The boundary is arbitrary, pick whatever you want. Just make sure you use it as the same on the body of your request.

    2. Batch Request Body:

    The body of a batch request consists a series of individual requests and change sets, each represented as a distinct MIME part, and separated by the boundary defined in the Content-Type Header.

    The HTTP request is provided in the attached "HTTP Request.txt" file.

    http-request.txt

    Hope it helps!

    Kind regards,
    ANKIT CHAUHAN

    SAP SME Support

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Rahul,

      Make sure that you have selected the Content-Type Header value correctly. Also we are using the POSTMAN app to check the request.

      If you are using some other application, then please make sure the equivalent options are selected.

      Kind regards,

      ANKIT CHAUHAN

      SAP SME Support

  • Feb 22 at 12:24 PM

    The http-request is missing a line break and should be probably like this:

    --batch_36522ad7-fc75-4b56-8c71-56071383e77c
    Content-Type: application/http 
    Content-Transfer-Encoding:binary
    
    POST /b1s/v1/BusinessPartners
    
    {"CardCode":"TestBatch004", "CardName":"Test Batch 01", "CardType": "C"}
    
    --batch_36522ad7-fc75-4b56-8c71-56071383e77c
    
    Content-Type: multipart/mixed;boundary=changeset_77162fcd-b8da-41ac-a9f8-9357efbbd
    --changeset_77162fcd-b8da-41ac-a9f8-9357efbbd
    Content-Type: application/http 
    Content-Transfer-Encoding: binary 
    Content-ID: 1 
    
    POST /b1s/v1/BusinessPartners
    
    {"CardCode":"TestBatch005", "CardName":"Test Batch 02", "CardType": "C"}
    
    --changeset_77162fcd-b8da-41ac-a9f8-9357efbbd--
    --batch_36522ad7-fc75-4b56-8c71-56071383e77c--

    This still results in a "Bank account is missing" error in my demo system, but at least the request's format seems to be okay.

    Add comment
    10|10000 characters needed characters exceeded

    • And if you're new to using Postman, make sure that you enter value for content-type in the "value" field and not in "description". If there is no "value" field click on "..." to select it.

      postman.png (12.9 kB)