Create Service Consumption Model for Business Partner and Sales Order Item Cube
- How to create destination
- How to create service consumption model for business partner and sales order item cube
Prerequisites
- Create a developer user in a SAP BTP, ABAP Environment system.
- Download the latest Eclipse and install ADT https://tools.hana.ondemand.com/#abap.
- Step 1
-
Log in to SAP S/4HANA Cloud system as administrator and select Communication Arrangement in the Communication Management section.
-
Select the communication arrangement that you have created.
-
Copy the business partner (A2X) URL for later use.
-
- Step 2
-
Log in to the SAP BTP cockpit and navigate to your subaccount. Select Destinations under Connectivity and create a new destination.
-
Enter destination configuration:
- Name: your destination name
- Type: HTTP
- Description: your description
- URL: Service URL from communication arrangement ( Business Partner (A2CX) ODataV2 service URL)
- (without
/sap/opu/odata/sap/API_BUSINESS_PARTNER
) - Proxy Type: Internet
- Authentication:
BasicAuthentication
- User:
- Password:
-
Check connection.
-
- Step 3
-
Log in to your SAP S/4HANA Cloud system, navigate to Extensibility and open the Custom CDS Views tile.
-
Click Create to create your custom CDS view.
-
Name your CDS view
YY1_SALESORDERITEMCUBEXXX
and label. Select External API as scenario and click Create. -
Search for
I_SalesOrderItemCube
and select it. -
Click Add and select Associated Data Source.
-
Search for
I_BusinessUser
, select it and click OK. -
Select the butterfly symbol to add a join condition.
-
Click Add.
-
Search for
userid
and select it. -
Add a value to your join condition, therefore select the field symbol under Value.
-
Search for
CreatedByUser
underI_SalesOrderItemCube
and select it. -
Now your join condition is complete. Click Close.
-
Navigate to Parameters and add manual parameters for the exchange rate type and display currency.
-
Navigate to Elements, select Add > Elements.
-
Search for
BusinessPartner
, select it and click OK. -
Add also the following elements to your CDS view:
SalesOrder
SalesOrderItem
CreationDate
NetAmountInDisplayCurrency
DisplayCurrency
-
Check your result and click Publish.
-
- Step 4
-
Navigate to Extensibility and select Custom Communication Scenarios.
-
Click New.
-
Create a communication scenario:
- Communication Scenario ID:
Salesorderitemcubexxx
- Description: Sales order item cube
Click New.
- Communication Scenario ID:
-
Click
+
to add an inbound service. -
Search for
YY1_SalesOrderItemCubeXXX
, select it and click OK. -
Select your inbound service and click Publish.
-
- Step 5
-
Go to the SAP API Business Hub and select the OData service for business partner: (https://api.sap.com/api/API_BUSINESS_PARTNER/overview).
Copy the production URL.
-
Now open a browser of your choice and past the production URL with your hostname and port.
Add also$metadata
at the end, like following:URL https://{host}:{port}/sap/opu/odata/sap/API_BUSINESS_PARTNER/$metadata
Log in with you communication user and password to see your metadata.
-
You can see the metadata. Save your metadata as an
edmx
file. -
Use
bupa.edmx
and select all files as file type.
-
- Step 6
-
Switch to Eclipse an create a package:
- Name:
Z_Package_XXX
- Description: My Package
Click Next.
- Name:
-
Click Next.
-
Click Finish.
-
Select File > New > Other…
-
Search Service Consumption Model, select it and click Next.
-
Create a service consumption model.
- Name:
Z_BUSINESSPARTNER_XXX
- Description: Service Consumption Model for business partner
Select your metadata
bupa.edmx
and click Next. - Name:
-
Click Next.
-
Click Next.
-
Click Finish.
-
Check your result.
-
- Step 7
-
Open your SAP S/4HANA Cloud system and navigate to Communication Management and select Communication Arrangements.
-
Search for your communication arrangement
yy1_salesorderitemcubexxx
and select it. -
Copy the service URL of your communication arrangement.
-
Paste the copied service URL in your browser, add
/$metadata
at the end of your URL and log in with you communication user and password to see your metadata. -
You can see the metadata. Save your metadata as an
edmx
file.
Usesalesorder.edmx
and select all files as file type. -
Go to Eclipse and select File > New > Other…
-
Search Service Consumption Model, select it and click Next.
-
Create a service consumption model.
- Name:
Z_SALESORDERITEMCUBE_XXX
- Description:
Service Consumption Model for SalesOrderItemCube
Select your metadata
salesorder.edmx
and click Next. - Name:
-
Click Next.
-
Click Next.
-
Click Finish.
-
Check your result.
-
- Step 8
With which user do you logon to see your metadata
- Copying the inbound service URL
- Create destination with basic authentication
- Create Custom CDS View in SAP S/4HANA Cloud
- Create custom communication scenarios
- Download metadata for business partner
- Create service consumption model for business partner
- Create service consumption model for sales order item
- Test yourself