Step 1: Copying the inbound service URL
-
Logon to SAP S/4HANA Cloud system as administrator.

-
Go to Communication Management and select Communication Arrangement.

-
Select the communication arrangement that you have created.

-
Select OAuth 2.0
Details in the inbound communication area.

-
Copy the user name and SAML2 audience for later use.

Step 2: Create destination with basic authentication
-
Log on to the SAP Cloud Platform cockpit as administrator.

-
Choose your global account.

-
Select Subaccounts.

-
Select your Cloud Foundry subaccount.

-
Choose the space that you have created for your ABAP environment during the setup.

-
Go to the service market place for the selected space, search for destination and select it.

-
Click Instances.

-
Choose your instance.

-
Select Destinations.

-
Click New Destination.

-
Enter destination configuration:
- Name: your destination name
- Type: HTTP
- Description: your description
- URL: Service URL from communication arrangement (Inbound Services screen -> ODataV2 service Business Partner Integration)
- (without
/sap/opu/odata/sap/API_BUSINESS_PARTNER
)
- Proxy Type: Internet
- Authentication:
BasicAuthentication
- User: <Communication user name from Oauth2.0 Details>
- Password:

-
Check connection.

Step 3: Create Custom CDS View in SAP S/4HANA Cloud
-
Logon to your 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 click Add and select Add Primary Data Source.

-
Search for I_SalesOrderItemCube
, select it and click Add.

-
Click Add and select Add Associated Data Source.

-
Search for I_BusinessUser
, select it and click Add.

-
Select Yes and move on.

-
Select External API and click on the butterfly symbol.

-
In the field section search for following fields and add them to your CDS view.
SalesOrder
SalesOrderItem
_CreatedBy.BusinessPartner
_SalesOrder.OverallSDProcessStatus
CreationDate
NetAmountInDisplayCurrency
DisplayCurrency
-
Go to properties and check your result.

-
Switch to Parameters and set following manual default values:
P_ExchangeRateType
: EUR
P_DisplayCurrency
: M
Click Publish.
Step 4: Create custom communication scenarios
-
Navigate to Extensibility and select Custom Communication Scenario.

-
Click New.

-
Create a communication scenario:
- Communication Scenario ID:
Salesorderitemcubexxx
- Description: Sales order item cube
Click New.
-
Click +
to add an inbound service.

-
Search for YY1_SalesOrderItemCubeXXX
, select it and click OK.

-
Select your inbound service and click Publish.

Step 5: Download metadata for business partner
-
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
Login 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: Create service consumption model for business partner
-
Switch to Eclipse an create a package:
- Name:
Z_Package_XXX
- Description: My Package
Click Next.
-
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.
-
Click Next.

-
Click Next.

-
Click Finish.

-
Check your result.

Step 7: Create service consumption model for sales order item
-
Navigate to Communication Management and select Communication Arrangement.

-
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 login with you communication user and password to see your metadata.

-
You can see the metadata. Save your metadata as an edmx
file.
Use salesorder.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.
-
Click Next.

-
Click Next.

-
Click Finish.

-
Check your result.
