SAP Knowledge Base Article - Public

3034002 - Extensibility for the API Purchase Order – Send, Update, Cancel (OrderRequest_Out) for Custom Fields in SAP S/4HANA Cloud Public Edition

Symptom

The custom fields can be enabled for the SOAP API Purchase Order – Send, Update, Cancel (OrderRequest_Out). These custom fields can be added through the app Custom Fields and Logic

Find the guide below with the detailed steps

“Custom fields and logic” app updated to two different apps – Custom Fields and Custom Logic from CE2105

"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental."

Environment

SAP S/4HANA Cloud Public Edition

Resolution

1. Log on to the SAP Fiori launch pad as an administrator.

2. Open the app Custom Fields and Logic

3. Choose the “+” icon to create a new custom field.

4. Select the following as Business Context:

  • Business Context for Header: Procurement: Purchasing Document.
  • Business Context for Item: Procurement: Purchasing Document Item.

5. Enter Label for the custom field.

6. Select the Type based on the requirement. 

Please note:

Currently the following data types have been tested:

  • Text
  • Amount with currency
  • Checkbox

7. In the section UIs and Reports enable usage for the following UIs and reports where the field should be displayed:

Example :

If the UI and Report: Purchase Order GUI Application is enabled for this custom field, the field would be available in the app “Create Purchase Order Advanced”

If the UI and Report: Manage Purchase Order is enabled for this custom field, the field would be available from the app “Manage Purchase Order”.

 

8.Go to the section SOAP API as shown below and enable usage for the custom field for the APIs that is required. 

Example: Service Interface : OrderRequest_Out is used in the example given in this article. 

9.Save and publish the custom field.

10. Create an example purchase order with a given value to the newly added field. Save the PO. The value of the new field should appear in the outbound API message for OrderRequest_Out. The same can be validated with the app “AIF message dashboard” with the following steps.

a. Go to the tile message monitoring – App “Assign Recipients to users”

b. Click on Add (+)

c. Add the user name which is used to check the payload

d. Add the interface name - /MMEDI Recipient name – EDI_MM_ORDER_RECIPIENT and click on Assign.

e. Go to the app – Message Dashboard

    Give the date and time parameters and click on Search.

    Click on /MMEDI – OrderRequest_Out

    Click on the PO created with the value of the custom field output_trigger_hdr as ‘X’.

   The value of the field in the payload should be set to X.

Example:

In the examples below, a custom field has been added in both “Create Purchase Order Advanced” and “Manage Purchase Order” apps.

To validate the successful addition, we will have to create a PO having this field value = X via both the apps and check the payload via the AIF Message dashboard as explained in the main section.

  1. Suppose the below custom field is published for the app “Create Purchase Order Advanced”  

Once the field gets published, the field will appear in the custom fields tab of the “Create Purchase Order Advanced” app  under the tab “Custom Fields” in header section.

Item level


 2.  Suppose the intention is to add the custom field for “Manage Purchase Order” app. 

  1. a.     Login to the Fiori Launch pad of the S4/HANA system and Go to “Manage PO” app. 
  2. b.     Click on the top right corner where there is the user icon and click on “Adapt UI”

     

2. c. Now place the cursor on any section of the UI intended for adding the new field. Click on the add (+)button

  

     2.d.This will give a list of the fields that are available to be added to this app. Choose one/more fields and click on Ok

   2.e.Click on “Save and Exit”.

Please note: This step would make the custom field available publicly for every user in this app.

We can now see that the new custom field added is available in the “Manage PO” app for usage.

Important Note:

Custom fields should be added to Manage Purchase Order application only if it is needed from a functionality perspective. Also, it is best to always use Adapt UI functionality only to add a new custom field where as not to affect/modify the functionality of an existing field.

Keywords

MM, PO, ME21N, MMEDI, SOAP, API , KBA , MM-PUR-GF-EDI-2CL , Electronic Data Interchange (Public Cloud) , MM-PUR-GF-EDI , Electronic Data Interchange , How To

Product

SAP S/4HANA Cloud Public Edition all versions