Dear colleagues,
I need to create simple XML payload for API_MATERIAL_DOCUMENT_SRV for direct posting to S/4 via OData service from Postman, but all payloads I try lead me to error
"System expected the element '{http://www.w3.org/2005/Atom}entry".
Even such simple:
<?xml version="1.0" encoding="UTF-8"?>
<A_MaterialDocumentHeader>
<A_MaterialDocumentHeaderType>
<GoodsMovementCode>01</GoodsMovementCode>
<PostingDate>2018-06-09T00:00:00</PostingDate>
<to_MaterialDocumentItem>
<A_MaterialDocumentItemType>
<QuantityInEntryUnit>20</QuantityInEntryUnit>
<Plant>1710</Plant>
<Material>TG11</Material>
<PurchaseOrderItem>10</PurchaseOrderItem>
<PurchaseOrder>4500000107</PurchaseOrder>
<GoodsMovementRefDocType>B</GoodsMovementRefDocType>
<GoodsMovementType>101</GoodsMovementType>
<EntryUnit>PC</EntryUnit>
<MaterialDocument/>
<MaterialDocumentYear/>
<MaterialDocumentItem/>
</A_MaterialDocumentItemType>
</to_MaterialDocumentItem>
<MaterialDocument/>
<MaterialDocumentYear/>
</A_MaterialDocumentHeaderType>
</A_MaterialDocumentHeader>
While JSON payload works fine:
{
"DocumentDate": "/Date(1611320834000)/",
"PostingDate": "/Date(1611320834000)/",
"MaterialDocumentHeaderText": "testAPI",
"GoodsMovementCode": "01",
"to_MaterialDocumentItem": {
"results": [
{
"Material": "1016158",
"Plant": "ROT1",
"StorageLocation": "RO1Z",
"GoodsMovementType": "101",
"Supplier": "90011172",
"PurchaseOrder": "4500001080",
"PurchaseOrderItem": "10",
"GoodsMovementRefDocType": "B",
"GoodsMovementReasonCode": "0",
"EntryUnit": "PC",
"QuantityInEntryUnit": "1",
"GdsMvtExtAmtInCoCodeCrcy": "0.00",
"SlsPrcAmtInclVATInCoCodeCrcy": "0.00",
"IsCompletelyDelivered": false,
"SerialNumbersAreCreatedAutomly": true,
"ReservationIsFinallyIssued": false,
"MaterialDocumentLine": "1",
"MaterialDocumentParentLine": "0",
"HierarchyNodeLevel": "0",
"GoodsMovementIsCancelled": false
}
]
}
}
Could you, please, advise, what could be the reason?
Best regards,
Alexander
Request clarification before answering.
Hello Alexander,
Can yo ucheck directly in SAP S4 by posting the XML data.I feel it supports only JSON format for POST operation.
Regards,
Sriprasad Shivaram Bhat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sriprasad,
thank you for the prompt reply. Could you, please, advise, what do you mean by "directly in SAP S4 by posting the XML data"? What I did:
1. Created Communication Arrangement in S/4
2. Took the link:

3. Put it in Postman and add A_MaterialDocumentHeader to the end of the link:

Then it worked with JSON, but did not work with XML. Does it mean, that XML simply not acceptable format here?
Best regards,
Alexander
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.