SAP Knowledge Base Article - Public

3838623 - Do not see the error M7064 when posting a duplicate Goods Issue for an STO using the API

Symptom

User can post a duplicate Goods Issue for an Stock Transport Order via the API: API_MATERIAL_DOCUMENT_SRV - error M7064 is not raised.

Environment

SAP S/4HANA Public Cloud Edition

Reproducing the Issue

  1. Created an STO 4500003143 for quantity 10.
  2. Go to MIGO / Post Goods Movement.
  3. Choose : Goods Issue / Purchase Order = 4500003143 / Movement Type 351.
  4. Select item / Quantity = 10
  5. Press Check & Save.
  6. Material Document is created.
  7. From MIGO - Try post the same goods issue again for the PO - we see the error M7064 Document 4500003143   does not contain any selectable items.

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

From the API - post a goods issue with Mvt 351 for STO 4500003143 

/sap/opu/odata/sap/API_MATERIAL_DOCUMENT_SRV/A_MaterialDocumentHeader


{
  "DocumentDate": "2026-10-14T00:00:00",
  "PostingDate": "2026-10-14T00:00:00",
  "GoodsMovementCode": "03",
  "to_MaterialDocumentItem": {
    "results": [
      {
        "Plant": "1010",
        "StorageLocation": "101A",
        "GoodsMovementType": "351",
        "PurchaseOrder": "4500003143",
        "PurchaseOrderItem": "10",
        "EntryUnit": "EA",
        "QuantityInEntryUnit": "10"
              }
    ]
  }
}

The goods issue posts, creating the MM Document : A_MaterialDocumentHeader(MaterialDocumentYear='2026',MaterialDocument='4900009007'.

Cause

The error M7064 is only applicable to dialog processes (such as MIGO).

Resolution

The API_MATERIAL_DOCUMENT_SRV does not perform the same checks as MIGO when performing goods movements.

Keywords

M7064, Goods Issue, 351, transit, STO,  API,  API_MATERIAL_DOCUMENT_SRV, dialog, , KBA , MM-IM-GI-2CL , Goods Issue and Return Delivery (Public Cloud) , Problem

Product

SAP S/4HANA Cloud Public Edition all versions