Skip to Content
0

REST API Customer create with multiple line items

Nov 29, 2016 at 05:58 PM

75

avatar image

I have successfully created a Customer with a REST API but would like to have multiple line items for the Customer create. I get the following error when using the SAP NetWeaver Gateway Client, HTTP Request, with multiple line items: Error while parsing an XML stream.

The following code is a simple example of one entry into a customer create function module with a table type customer table as the import. How do I format the HTTP Request to insert an additional customer?

{
   "d" : {
     "__metadata" : {
     "id"  : "http://lsbdb.pok.bb.com:8002/sap/opu/odata/SAP/Z_C_SRV",
     "uri" : "http://lsbdb.pok.bb.com:8002/sap/opu/odata/SAP/Z_C_SRV",
     "type" : "Z_C_SRV.Customer"
                    },
        "IName1" : "Software Galleria",
        "IName2" : "SG"
  }
}
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Krishna Kishor Kammaje
Dec 04, 2016 at 07:48 AM
0

For creating multiple customers you have to use $Batch.

Read about it here. http://www.odata.org/documentation/odata-version-2-0/batch-processing/

Share
10 |10000 characters needed characters left characters exceeded