cancel
Showing results for 
Search instead for 
Did you mean: 

Set Header Delivery Note/Reference field in API Material Documents Create

SFY50013
Explorer
0 Kudos

Hello Community,

We have a requirement where we need to create a PO and its Goods Receipt. We created a specific iFlow using both APIs ( API_PURCHASEORDER_PROCESS_SRV/A_PurchaseOrder and API_MATERIAL_DOCUMENT_SRV/A_MaterialDocumentHeader) and managed to get the flow work.

The problem we are facing is that in the created Material document we cannot set the Delivery Note/Reference. Following error is returned : Field ReferenceDocument cannot be set for this operation on header level.

Is there any solution to set that field ?

Here is the payload :

{

    "PostingDate": "2019-06-01T00:00:00",

    "MaterialDocumentHeaderText": "Reference XXXX",

    "ReferenceDocument": "My Delivery", <------------------ when this field is removed the GR is created

    "GoodsMovementCode": "01",

    "to_MaterialDocumentItem": [

        {

            "Material": "300204",

            "Plant": "1000",

            "StorageLocation": "",

            "GoodsMovementType": "101",

            "PurchaseOrder": "4500001709",

            "PurchaseOrderItem": "90010",

            "GoodsMovementRefDocType": "B",

            "MaterialDocumentItemText": "",

            "EntryUnit": "ROL",

            "QuantityInEntryUnit": "1"

        }        

    ]

}

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

MartyMcCormick
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello

I do see the ReferenceDocument field on the API and it looks like it should be available to you in a POST operation when you look at API Hub. However, when I look at the documentation on help.sap.com, I don't see this field list at the Header level for a create operation: https://help.sap.com/viewer/7760de6f44074d4994c4da9832f7bfca/1905.500/en-US/8bb0d08295044ee3af444b4f...

I would recommend opening up a customer message for final confirmation. You can use component MM-IM-GF

Thanks,

Marty

SFY50013
Explorer
0 Kudos

Hello marty.mccormick

the reference field is mandatory for my requirement unfortunatly...The SOAP version seems the right one but I can't make work (https://api.sap.com/api/MATERIALDOCUMENTCREATEREQUEST1/). Here's my payload:

2019-06-20T06:39:58Z

true

01

2019-06-20

My Delivery

101

1

1000

100A

10

4500001421

10

MartyMcCormick
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello

Do you see any errors in the message monitor as it looks like you are using async service. Assign Recipient app subscribe yourself to MMIM namespace and MMIM_SOAP_MONITOR recipient. You may see the error details.

Also, how are you testing? Can you enable Reliable Messaging (RM)? Or at a minimum pass in the message id in this format at the end of your URL calling the service: ?MessageId=989C6E5C-2CC1-11CA-A044-08002B1BB4F5

Thanks,

Marty

SFY50013
Explorer
0 Kudos

Hello marty.mccormick ,

thank you very much for your time and valuable inputs.

I'm new to those concepts (RM). I believe you are talking about the SOAP adapter RM in my iFlow, which I used and managed to make the API work and the AIF monitoring as well.

The problem with this approach is the SOAP RM adapter is a one way call (no response). Is there a way to call those SOAP APIs with classical adapter ? I'm having this issue

with https://api.sap.com/api/MMPUR_PURCHASEORDERREQUEST_IN/ as well (PO create SOAP Api).

I can't make it work with a SOA Adapter 1.x. Error is : - WSDL must not contain WSRM policies - (i've searched the forum with no luck so far).

My requirement is to simulate the received file (500-1000 purchase orders), if the simuation has no errors, the file is commited, if any error no PO is to be created then.

The OData API for purchase orders works but does not have a simulation flag

Is there a solution to make this scenario work (simulate multiple POs), same as we can do with the journal entry Async API - JOURNALENTRYCREATEREQUESTCONFI) ?

Best Regards

MartyMcCormick
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Soufiane

If you want to use the standard adapter, to get around your error can you try removing the WSDL from the adapter (you can keep it in the resource view though for your mapping)? It's not a mandatory field on the adapter.

I think alternatively you can remove all policy segments from the wsdl and then use this.

The reason for this is because CPI does not yet support WSRM policy.

Thanks,

Marty

SFY50013
Explorer
0 Kudos

Thank you marty.mccormick .

I've already tried removing the tags but it is not working. I think that the API in the backend system (S4C) is expecting WSRM protocole (like setting up a webservice in SOAMANAGER for ECC systems). Note that journal entry WSDL contains policy tags but it is working the SOAP adapter (no policy setup in SAP for this WS).

I'm giving up the SOAP and i'll stick with OData API with its constraints (no simulation possible). I've found threads in this forum having the same issue with this API. I'll update the current one if I find a soution.

Thank you very much for your help.

Answers (3)

Answers (3)

NickSYYang
Active Participant
0 Kudos

Ran into same error like you but in my case I used OData version of the same API in my client's S4HANA Cloud system to create goods receipt.

Found note "2825462 - Reference Document field not accepted via API" saying it's not support yet.

Regards,

Nick

SFY50013
Explorer
0 Kudos

Thank you marty.mccormick for the confirmation.

former_member132363
Active Contributor
0 Kudos

Here are some SAP resources you may review based on your topic "delivery,community,delivery,material,material,create,po,goods receipt"

SAP S/4HANA Cloud

This service enables a remote system to read, create and update requests for quotation from / in ... Product Master - Confirmation from Client to SAP S/4HANA.

https://api.sap.com/package/SAPS4HANACloud

SAP Globalization Services

Deliver local best practices according to country needs - and stay tuned with latest ... The product management team provides dedicated services to evaluate, ?...

https://support.sap.com/en/product/globalization.html

FAQs

Sep 18, 2018 ... SAP plans to deliver full SAP Cloud ALM in 2021 ... Requirement to deploy (SAP Cloud ALM Build) .... I have received the email, but am not the correct recipient. ... As SAP Cloud ALM is a new product. ... for ?new? problems (problems not yet known to SAP) are typically charged based on time and material.

https://support.sap.com/en/alm/sap-cloud-alm/faq.html