S/4HANA Cloud APIs for Product Master
S/4HANA Cloud APIs for Product Master.
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:
|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:
- Goto Product Group Data – https://api.sap.com/api/PRODUCTGROUP_0001/overview – API Specification. Download the YAML API specification.
- Open the YAML file in an external editor and adjust/amend the values of x-targetEndpoint and servers
- 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> </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:
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
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