If you don't have access to a SAP S/4HANA system but still want to create an application consuming an OData service with SAP Business Application Studio, you can make use of this mock server application. It contains some entities of the SAP S/4HANA API_Business_Partner OData service (A_BusinessPartner & A_BusinessPartnerAddress) with sample data.
To install the mock server, you need an SAP BTP subaccount with Cloud Foundry Environment and 256 MB of Cloud Foundry runtime.
Also you have to create a destination to the mock service in the same subaccount as your SAP Business Application Studio subscription.
-
Open the SAP Business Application Studio and create a new Dev Space using the Full Stack Cloud Application type
-
Switch to the tab where you have opened SAP Business Application Studio. In the tabs, choose View and select Find Command.
-
Search for CF Login and select CF: Login on to Cloud Foundry.
-
Enter CF API endpoint
Hint: You can find your API Endpoint in the overview section of your SAP BTP account → Cloud Foundry Environment
-
Enter your SAP BTP account Email and Password when prompted.
-
Select your Cloud Foundry Org
Hint: You can find your Org Name in the overview section of your SAP BTP account → Cloud Foundry Environment
- Select the space name. Once you have selected the Org and Space, you would log in to Cloud Foundry in SAP Business Application Studio.
Hint: You can find your space name in your SAP BTP account → Cloud Foundry → Spaces
- Now, you have successfully created a workspace and pointed to our desired SAP BTP Org and Space.
-
In the menu select Terminal → New Terminal. In the terminal go to the projects folder
cd projects
-
Clone the mock server GitHub repository:
git clone -b mock https://github.com/SAP-samples/cloud-extension-ecc-business-process.git
-
Choose File in the menu on the top and then select Open Workspace from the dropdown menu.
-
Open the project by choosing projects > cloud-extension-ecc-business-process and choose Open.
-
In the project folder right-click on the
mta.yaml
file and select Build MTA Project. -
When the build was successful, you will see a new folder mta_archives in your project with the Mockserver_1.0.0.mtar file. Right-click on that file and select Deploy MTA Archive.
-
The next step is to create a destination to the mock server
-
Open your SAP BTP account and navigate to your Subaccount.
-
Choose Connectivity in the menu on the left then choose Destinations → New Destination.
-
Again, choose Destinations → New Destination and enter the following information destination:
- Name:
bupa
- URL:
https://<mock_srv_url>/api-business-partner
- Authentication:
No Authentication
- Name:
-
Choose New Property and enter the following properties and Save your input:
Key Value HTML5.DynamicDestination true WebIDEAdditionalData full_url WebIDEEnabled true WebIDEUsage odata_gen
- Open your SAP BTP Account and navigate to your space
- Find the mockserver application in the table and choose mock-srv to open
- Click on the link for application routes to open mock server
- Now you can open the service endpoints for /api-business-partner and have a look on the provided data