Skip to Content
Technical Articles
Author's profile photo Piotr Tesny

S/4HANA Cloud APIs for Product Master

S/4HANA Cloud APIs for Product Master.

SAP Extensibility Explorer for SAP S/4HANA Cloud

S/4HANA Cloud APIs for Product Master are implemented within the Product Integration scenario SAP_COM_0009.

Let me share how to implement both ODATA v2 and ODATA v4 APIs from SAP_COM_0009 with API Management, part of SAP Integration Suite bundle.

Quite recently, when trying to implement some of the APIs from the Product Integration (SAP_COM_0009), I came across an unexpected hurdle while trying to copy a stock s/4hana cloud ODATA v4 API in the API Management Portal.

The Unsupported service code error depicted below is raised because the “ODATAV4” serviceCode is currently not supported by the API Management Portal.

S/4HANA Cloud: Product Integration (SAP_COM_0009)

As a reminder you must have set up a communication arrangement in your S/4HANA Cloud system with the Product Integration scenario SAP_COM_0009.

APIM: Going around the unsupported ODATAV4 serviceCode

The best is to fully implement with APIM some other ODATA v2 API, if possible from the same communication arrangement, and then copy it using APIM copy function.

That’s what I eventually did. I had fully implemented with APIM the Product Master (A2X) API. (Including the saml bearer assertion security policy.)

Alternatively one can create a brand new API as well.

  • Please note, the following fields will need to be adjusted before validating the copy:
URL https://my30XXXX-api.s4hana.ondemand.com/sap/opu/odata4/sap/api_productgroup_2/srvd_a2x/sap/productgroup/0001/
Name PRODUCTGROUP_0001
Title Product Group Data – Read
API Base Path PRODUCTGROUP_0001

After the copy we need to replace the resources of the new API (if any) with the resources from the Product Group Data API as follows:

  1. Goto Product Group Data – https://api.sap.com/api/PRODUCTGROUP_0001/overview – API Specification. Download the YAML API specification.
  2. Open the YAML file in an external editor and adjust/amend the values of x-targetEndpoint and servers
  3. In APIM, goto Edit in API and replace the description of resources on the right-hand side with the slightly tweaked definition from our target API.
openapi: 3.0.0
info:
  title: Product Group Data - Read
  version: '1 '
  description: |2


    This synchronous inbound V4 OData service enables external systems and other consumers to read product group data and their descriptions. This service only supports the GET operation.
    <p><a href="https://api.sap.com/api/PRODUCTGROUP_0001/overview"
    rel="nofollow">https://api.sap.com/api/PRODUCTGROUP_0001/overview</a></p> 

    <p>&nbsp;</p>
  x-targetEndpoint: >-
    https://my30XXXX-api.s4hana.ondemand.com/sap/opu/odata4/sap/api_productgroup_2/srvd_a2x/sap/productgroup/0001/
externalDocs:
  description: Business Documentation
  url: https://help.sap.com:00443/http.svc/ahp2/SAP_S4HANA_CLOUD/latest/EN/27/9eb92259584b1891753250bc3ae320/frameset.htm
x-sap-api-type: ODATAV4
x-sap-shortText: Read product group data and their descriptions using this synchronous inbound service
x-sap-api-deprecated: 'No'
x-sap-ext-overview:
- name: Communication Scenario
  values:
  - text: Product Integration (SAP_COM_0009)
    format: plain
- name: Scope Items
  values:
  - text: '[Master Data Integration (1RO)](https://rapid.sap.com/bp/#/scopeitems/1RO " Link To BP ")'
    format: markdown
  - text: '[Opportunity-to-Order with SAP Cloud for Customer (1VP)](https://rapid.sap.com/bp/#/scopeitems/1VP " Link To BP ")'
    format: markdown
- name: Authentication Methods
  values:
  - text: Basic, x509, OAuth2
    format: plain
- name: Service Group Name
  values:
  - text: API_PRODUCTGROUP_2
    format: plain
- name: Business Object
  values:
  - text: ProductGroup
    format: plain
security:
- basicAuthentication: []
servers:
  - url: >-
      https://<APIM Proxy>/PRODUCTGROUP_0001
........... remove all fields after servers and before tags....................
tags:
............... the rest of the file is unchanged..............................

The end result is shown below:

 

Next steps

Once you are done with the prototyping of the APIs with SAP APIM you may want to go to the next level and implement them with the destination service on SAP BTP.

I have scrambled a sibling blog, namely S/4HANA Cloud Product Master APIs with OAuth2SAMLBearerAssertion that will tell you this story

__________

 

Additional resources

Product Master (A2X) – https://api.sap.com/api/API_PRODUCT_SRV/overview
Product Type – https://api.sap.com/api/PRODUCTTYPE_0001/overview
Product Group Data – https://api.sap.com/api/PRODUCTGROUP_0001/overview

__________

__________

Assigned Tags

      3 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Victor Figueroa Pinto
      Victor Figueroa Pinto

      Hi, you can help.

       

      1. This APIs can will used in not Cloud Hana ?
      Transaction Data Mapping
      API Name Description
      API_JOURNALENTRYITEMBASIC_SRV API Journal Entry Item (ACDOCA)
      API_FINPLAN_COSTESTIMATE_ITEMS_SRV API for Cost Estimate Items
      API_PRODUCT_SRV API for Product Units of Measure

       

      2. How i can determine the Tables Used by the APIs ?

       

      Thank you for you help.

      Author's profile photo Piotr Tesny
      Piotr Tesny
      Blog Post Author

      Hello @Victor Figueroa Pinto,

      Thanks for reading my blogs. What is your target SAP system ? Is it SAP S/4HANA Cloud ?

      Ad1. I'm not sure I understand your ask. Can you please clarify your question?

      Ad2. The whole purpose of the ODATA APIs is to rely on the contract that these APIs provide rather than relying on the "raw" database tables or views.

      I hope that helps; kind regards;

      Author's profile photo suchita tomar
      suchita tomar

      Hi,

      In Need your help to understand which Soap/Odata API call we will make to fetch product & customer master data from S4 HANA cloud to CPI ?

      Will this be the service?

      Service Name: Product master - Replicate from S4 HANA Cloud to Client

      Service URL: api.s4HANA.ondemand.com/sap/bc/srt/scs_ext/sap/productmdmbulkreplicaterequest