cancel
Showing results for 
Search instead for 
Did you mean: 

Copying items with reference to a contract using an API

former_member131745
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi all,

This query was raised with me earlier today. The documentation is strong in this area, so I have added both the answer and the links to the documentation in case community users have similar issues around APIs in the future.

Question - "I'm trying to create a sales order with reference to 'value contract' using SalesOrder API 'SAP_COM_0109'. I am passing over the contract number in payload using field '"ReferenceSDDocument". The expectation is that both the header & line items will be copied over from the contact to sales order. In this case only the header fields are getting filled. Is there a way to automatically copy over header & line items from contract to sales order without adding all item information into the payload?"

Thanks

0 Kudos

Hi

how you have checked if contract is already contract available or not?

Regards

Ghadeer

Accepted Solutions (1)

Accepted Solutions (1)

former_member131745
Product and Topic Expert
Product and Topic Expert
0 Kudos

Answer: "So that the system knows which item(s) to copy into the sales order, you need to fill in the reference item number and reference document number at item level for the item(s) that you want to copy. Try using the following:

{

"SalesOrderType" : "OR",

"ReferenceSDDocument" : "40000xxx",

"to_Item":[

{

"ReferenceSDDocument" : "40000xxx",

"ReferenceSDDocumentItem" : "10"

},

{

"ReferenceSDDocument" : "",

"ReferenceSDDocumentItem" : ""

}

]

}

-------------------

See the following documentation for further info:

https://help.sap.com/viewer/635f557c455d42eaae20f169d9c43d9b/1908.500/en-US/03373661272d43b0b43538f1...

https://api.sap.com/api/API_SALES_ORDER_SRV/resource "

Answers (0)