cancel
Showing results for 
Search instead for 
Did you mean: 

SAP S/4HANA Cloud Public Edition API Response Data

espinaro
Participant
0 Kudos
303

Dear Community,

My question is about the data returned by SAP S/4HANA Cloud Public Edition APIs, for example, API_SALES_ORDER_SRV.

Let’s say I want to consult the root node of Sales Order with ID 7. This is the SO in SAP S/4HANA Cloud Public Edition:

Screenshot 2024-07-26 at 16.55.43.png

This is the API call:

https://my000000-api.s4hana.cloud.sap/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder('7')

This is the service response of the nodes marked in red on the image:

 

<content type="application/xml">
        <m:properties>
            <d:SalesOrder>7</d:SalesOrder>
            ...
            <d:TransactionCurrency>MXN</d:TransactionCurrency>
            <d:IncotermsClassification>DAP</d:IncotermsClassification>
            <d:CustomerPaymentTerms>0002</d:CustomerPaymentTerms>
           ...
        </m:properties>
</content>

 

As you can see, the API does not return associated texts with each of the codes:

  • MXN: Mexican Pesos
  • DAP: Delivered at Place
  • 0002: 14 Days 2%, 30 Net

My questions are: Is there any way to include the texts in the API response? If yes, is there any way to indicate in the API request the language in which you want to receive them?

Thanks!

OwenLiu
Product and Topic Expert
Product and Topic Expert
0 Kudos
Added Sales tag.
View Entire Topic
AndreasMuno
Product and Topic Expert
Product and Topic Expert
0 Kudos

Thank you for your question, @espinaro.

The properties and values you obtained with odata/sap/API_SALES_ORDER_SRV/A_SalesOrder('7') you may use as parameters for the next GET APIs:

For incoterms use OData V2 API "Incoterm - Read (A2X)", SAP Business Accelerator Hub. Here, you might want to filter by language:  /odata/sap/API_SD_INCOTERMS_SRV/A_IncotermsClassification('EXW')/to_IncotermsClassificationText?$filter=Language%20eq%20'EN' 

For currency, I found this CDS View I_CurrencyText (Basic) in the SAP Business Accelerator Hub. SAP Business Accelerator Hub. You could expose that view as a Read OData API on your own following the instructions within.

For terms of payment I found CDS View I_PaymenttermsText (Basic): SAP Business Accelerator Hub. Again, you could expose that view as a Read OData API on your own. 

If that solves your request, please mark accordingly. Thank you.

 

 

espinaro
Participant
0 Kudos

Dear AndreasMuno,

If the SAP APIs do not return associated texts based on a specific language, there is no choice but to make additional calls based on the required information.

Thank you for the proposed APIs for this particular case.

Kind regards