If you don't have access to an SAP S/4HANA system but still want to create an application consuming an OData service with SAP Build Apps, you can use 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.
For the installation, you could either use SAP Business Application Studio or your local system.
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 Build Apps subscription.
Prerequisite: Entitlement and setup of SAP Business Application Studio at your SAP BTP account - see the Getting Started Guide.
-
Open the SAP Business Application Studio and create a new Dev Space using the Full Stack Cloud Application type.
-
Open a new terminal.
-
You have opened SAP Business Application Studio and created and opened a Dev workspace.
-
In the next step, you will log in to Cloud Foundry in SAP Business Application Studio, so let us copy the needed parameters in a text editor of your choice.
-
Switch to the tab in your browser where you have SAP BTP cockpit opened and choose Overview of the subaccount. Copy the Org Name and API Endpoint into a text editor of your choice.
-
From the left-side subaccount menu, navigate to Cloud Foundry → Spaces and write down the space name as well to a text editor of your choice.
-
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 the CF API endpoint, which you have copied in step 3 or take the default suggested API endpoint.
-
Enter your SAP BTP account Email and Password when prompted.
-
Select your Cloud Foundry Org, which you have noted down in step 3.
-
Select the space name, which you have noted down in step 4. Once you have selected the Org and Space, you would log in to Cloud Foundry in SAP Business Application Studio.
-
Now, you have successfully created a workspace and pointed to our desired SAP BTP Org and Space.
-
In the menu in SAP Business Application Studio, select Terminal → New Terminal and navigate to the projects folder using:
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 Add Folder to 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.yamlfile 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.
For building and deploying the mock server, you need to install the following tools on your device:
-
Cloud MTA Build Tool - you can install it using Node.js.
npm install -g mbt
-
Open a terminal or on Windows the command prompt.
-
Clone the mock server GitHub repository:
git clone -b mock https://github.com/SAP-samples/cloud-extension-ecc-business-process.git
Build your application by using the mta.yaml build file. With the -t parameter, the file will be created in the specified folder.
mbt build -t ./mta_archives
-
Set the SAP BTP API endpoint. You can find it in overview of your SAP BTP subaccount:
cf api <your-api endpoint>
-
Log in to your subaccount and select your org and space:
cf login -u <your-user> -p <your-password>
Now, you can deploy the application to your subaccount and space by using the created mtar file:
cd mta_archives
cf deploy Mockserver_1.0.0.mtarIf the deployment was successful, you will see the following log:
Starting application "mock-srv"...
Application "mock-srv" started and available-
In your SAP BTP subaccount, navigate to the space where you have deployed the mock server. In the Applications section, select the
mock-srvapplication.
-
In the application overview screen, copy the Application Route of the mock server.
-
Go back to the subaccount overview and select Connectivity → Destination. Choose New Destination. Enter the following values:
- Name = bupa
- Type = HTTP
- URL = https://<The application route of the mock server>/v2/op-api-business-partner-srv/
- Proxy Type = Internet
- Authentication = NoAuthentication
Choose New Property at create the following properties:
-
HTML5.DynamicDestination = true
-
WebIDEAdditionalData = full_url
-
WebIDEUsage = odata_gen
-
WebIDEEnabled = true
-
Check Use default JDK truststore
-
Save your settings
- Choose Check Connection and you should get a
200 OKmessage.










