Skip to Content
avatar image
Former Member

REST API Customer create with multiple line items

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"
  }
}
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 04, 2016 at 07:48 AM

    For creating multiple customers you have to use $Batch.

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

    Add comment
    10|10000 characters needed characters exceeded