To create a Service Consumption Model (SCM) for making API calls from your on-stack extension to the Poetry Slam Manager app on SAP BTP, follow these steps:
-
Right-click the
ZPRA_PSE_SALES_ORDERpackage and choose New > Other ABAP Repository Object. -
Search for
Service Consumption Model, select it and choose Next. -
Enter the following data and choose Next:
-
Name:
ZPRA_PSE_SO_PS_SCM -
Description:
Service Consumption Model for Poetry Slam Event Application -
Select Remote Consumption Model :
OData
-
-
Retrieve the metadata of the CAP service from the Poetry Slam Manager app. Save it in either
.xmlor.edmxformat. You'll upload this file in the next step. You can refer to a sample metadata.edmx here. -
Upload the saved metadata file and choose Next.
-
The wizard shows all the components of the OData service that have been uploaded as metadata file. Check the components and choose Next.
-
Select the components for which ETag is required. For this on-stack extension scenario, we select all the components shown in the image below and choose Next:
-
Select a transport request and choose Finish.
-
The SCM model and the class are generated with the following names:
- Service Consumption Model :
ZPRA_PSE_SO_PS_SCM - Class :
ZPRA_PSE_SO_PS_SCM
They look similar to the following images:
- Service Consumption Model :
-
You initiate this proxy wherever you want to make an API call to the Poetry Slam Manager app from the on-stack extension. In this scenario, you call this proxy in the
ZPRA_PSE_R_SO_BEXTbehavior definition class andZCL_PRA_PSE_VHvalue help class. These classes are implemented in the next step to extend the sales order. -
In the SCM file, you can check the sample code to see how to instantiate the SCM class and make the necessary API calls to the Poetry Slam Manager app.
-
Make sure you have the necessary configurations for the API calls to work properly. This involves creating outbound services and setting up the communication scenario. You can find detailed instructions in the first two points of the Communication Setup section.
-
For more information on how to use the generated SCM class to make API calls, refer to Service Consumption Model on SAP Help Portal.






