SAP Knowledge Base Article - Public

3651756 - Error M7018 "Enter Purchase Order" occurs when posting goods movement using API_MATERIAL_DOCUMENT_SRV

Symptom

Error M7018 "Enter Purchase Order" occurs when attempting to post a goods receipt without a purchase order or scrapping using the API API_MATERIAL_DOCUMENT_SRV.

Environment

SAP S/4HANA Cloud Public Edition

Reproducing the Issue

Use the API API_MATERIAL_DOCUMENT_SRV to attempt posting a goods receipt without a purchase order (movement type 501) or scrapping (movement type 551).

Cause

The property "GoodsMovementRefDocType": "B" is included in the payload. This indicates that the goods movement references a purchase order. This triggers the system to require a purchase order number. However, movement types 551 and 501 do not operate with reference to a purchase order. Ther.efore, the inclusion of this property in the payload is incorrect for these movement types.

Resolution

Remove the property "GoodsMovementRefDocType": "B" from the payload when using movement types 551 or 501.

Keywords

M7018, enter purchase order, goods receipt, API_MATERIAL_DOCUMENT_SRV, goods movement, movement type 551, 501, GoodsMovementRefDocType, payload , KBA , MM-IM-GF-2CL , Basic Functions (Public Cloud) , Problem

Product

SAP S/4HANA Cloud Public Edition all versions