WP856 SAP ERP Demo Source-code Guide

  • Updated on September 9, 2026 PDF Download

Prerequisites

Before you start the setup, ensure you have the following:

  • SAP ERP Demo Source-code package. (Download here)
  • SAP Business Technology Platform (BTP) Trial Account (Sign up here)
  • Cloud Foundry CLI installed – Required for deploying and managing applications on SAP BTP using command-line tools (refer to this link for more information). SAP Business Application Studio (BAS) can be used as an alternative for managing Cloud Foundry applications through a web-based interface. (Find more information here)
  • SAP Mobile Development Kit (MDK) configured (Setup guide)
  • SAP BTP SDK for Android downloaded and installed
  • Android Studio (Download here) installed and configured
  • Git Bash or Windows Subsystem for Linux (WSL) (For Windows users) – Required for running Cloud Foundry commands and scripts in a Linux-like environment on Windows.
  • Java and Gradle installed – Needed for building the Android app and ensuring compatibility with SAP development tools. (Ensure correct environment variables are set)

Set Up SAP BTP Trial Account

  1. Start a SAP trial account and log in to SAP BTP Cockpit.
  2. Set up an SAP Mobile Development Kit (MDK) app by following this guide.
  3. Obtain the MDK App URL (e.g., https://**trial-dev-.cfapps.us10-001.hana.ondemand.com) and API Key for future use.
  4. Change the security configuration of the MDK app to “API Key Only”.
MDK App Security Settings

OData Service Configuration

Create OData Service in SAP Business Application Studio

To set up a new SAP OData Service please refer to the steps below:

  1. Enter the SAP Business Application Studio (BAS) of your trial account.
SAP BTP Cockpit Service Marketplace
Open SAP Business Application Studio
SAP Business Application Studio Dev Spaces
  1. Create a new project as shown below.
Create a New Project in SAP BAS
  1. Navigate to the path of the newly created project.
Open the New Project Path
  1. At the top left of the page, go to View→Command Palette.
View Command Palette
  1. Select the New OData CSDL document command and input the parameters shown in the table below.
New OData CSDL document metadata

Schema namespace

com.gs.mtb.demo

Namespace alias name

Self

Metadata file name

metadata.csdl.xml

  1. Open the file metadata.csdl.xml at the project’s root directory
metadatacsdlxml file
  1. Modify the content of the file based on the following:
Note:

This content can be found in the SAP_ERP_Demo_Sourcecode repository under app/src/main/res/raw/com_gs_erp_sap_demo.xml

<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://docs.oasis-open.org/odata/ns/edmx http://docs.oasis-open.org/odata/odata/v4.0/os/schemas/edmx.xsd http://docs.oasis-open.org/odata/ns/edm http://docs.oasis-open.org/odata/odata/v4.0/os/schemas/edm.xsd">
    <edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Capabilities.V1.xml">
        <edmx:Include Namespace="Org.OData.Capabilities.V1" Alias="Capabilities"/>
    </edmx:Reference>
    <edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Repeatability.V1.xml">
        <edmx:Include Namespace="Org.OData.Repeatability.V1" Alias="Repeatability"/>
    </edmx:Reference>
    <edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.xml">
        <edmx:Include Namespace="Org.OData.Core.V1" Alias="Core"/>
    </edmx:Reference>
    <edmx:Reference Uri="https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Validation.V1.xml">
        <edmx:Include Namespace="Org.OData.Validation.V1" Alias="Validation"/>
    </edmx:Reference>
    <edmx:DataServices>
        <Schema Namespace="com.sap.mbtepmdemo" xmlns="http://docs.oasis-open.org/odata/ns/edm" Alias="Self">
            <EnumType Name="Gender" UnderlyingType="Edm.Int32">
                <Member Name="Male" Value="0"/>
                <Member Name="Female" Value="1"/>
                <Member Name="Other" Value="2"/>
                <Member Name="None" Value="3"/>
                <Member Name="Unknown" Value="4"/>
            </EnumType>
            <EntityType Name="Customer">
                <Key>
                    <PropertyRef Name="CustomerID"/>
                </Key>
                <Property Name="City" Type="Edm.String" Nullable="true" MaxLength="40"/>
                <Property Name="Country" Type="Edm.String" Nullable="true" MaxLength="3"/>
                <Property Name="CustomerID" Type="Edm.Int64" Nullable="false" MaxLength="10">
                    <Annotation Term="Org.OData.Core.V1.Computed"/>
                </Property>
                <Property Name="DateOfBirth" Type="Edm.Date" Nullable="false"/>
                <Property Name="EmailAddress" Type="Edm.String" Nullable="true" MaxLength="255"/>
                <Property Name="Gender" Type="com.sap.mbtepmdemo.Gender" Nullable="true"/>
                <Property Name="FirstName" Type="Edm.String" Nullable="true" MaxLength="40"/>
                <Property Name="HouseNumber" Type="Edm.String" Nullable="true" MaxLength="10"/>
                <Property Name="LastName" Type="Edm.String" Nullable="true" MaxLength="40"/>
                <Property Name="PhoneNumber" Type="Edm.String" Nullable="true" MaxLength="30"/>
                <Property Name="PostalCode" Type="Edm.String" Nullable="true" MaxLength="10"/>
                <Property Name="Street" Type="Edm.String" Nullable="true" MaxLength="60"/>
                <Property Name="Address" Type="com.sap.mbtepmdemo.Address" Nullable="true"/>
                <NavigationProperty Name="SalesOrders" Type="Collection(com.sap.mbtepmdemo.SalesOrderHeader)" Partner="Customer">
                    <OnDelete Action="None"/>
                </NavigationProperty>
            </EntityType>
            <ComplexType Name="Address">
                <Property Name="HouseNumber" Type="Edm.String" Nullable="true"/>
                <Property Name="Street" Type="Edm.String" Nullable="true"/>
                <Property Name="City" Type="Edm.String" Nullable="true"/>
                <Property Name="Country" Type="Edm.String" Nullable="true"/>
                <Property Name="PostalCode" Type="Edm.String" Nullable="true"/>
            </ComplexType>
            <EntityType Name="Supplier">
                <Key>
                    <PropertyRef Name="SupplierID"/>
                </Key>
                <Property Name="City" Type="Edm.String" Nullable="true" MaxLength="40"/>
                <Property Name="Country" Type="Edm.String" Nullable="true" MaxLength="3"/>
                <Property Name="EmailAddress" Type="Edm.String" Nullable="true" MaxLength="255"/>
                <Property Name="HouseNumber" Type="Edm.String" Nullable="true" MaxLength="10"/>
                <Property Name="PhoneNumber" Type="Edm.String" Nullable="true" MaxLength="30"/>
                <Property Name="PostalCode" Type="Edm.String" Nullable="true" MaxLength="10"/>
                <Property Name="Street" Type="Edm.String" Nullable="true" MaxLength="60"/>
                <Property Name="SupplierID" Type="Edm.Int64" Nullable="false" MaxLength="10">
                    <Annotation Term="Org.OData.Core.V1.Computed"/>
                </Property>
                <Property Name="SupplierName" Type="Edm.String" Nullable="true" MaxLength="80"/>
                <Property Name="Address" Type="com.sap.mbtepmdemo.Address" Nullable="true"/>
                <NavigationProperty Name="Products" Type="Collection(com.sap.mbtepmdemo.Product)" Partner="Supplier">
                    <OnDelete Action="None"/>
                </NavigationProperty>
                <NavigationProperty Name="PurchaseOrders" Type="Collection(com.sap.mbtepmdemo.PurchaseOrderHeader)" Partner="Supplier">
                    <OnDelete Action="None"/>
                </NavigationProperty>
            </EntityType>
            <EntityType Name="Product">
                <Key>
                    <PropertyRef Name="ProductID"/>
                </Key>
                <Property Name="Category" Type="Edm.String" Nullable="true" MaxLength="40"/>
                <Property Name="CategoryName" Type="Edm.String" Nullable="true" MaxLength="40"/>
                <Property Name="CurrencyCode" Type="Edm.String" Nullable="true" MaxLength="5"/>
                <Property Name="DimensionDepth" Type="Edm.Decimal" Nullable="true" Precision="13" Scale="4"/>
                <Property Name="DimensionHeight" Type="Edm.Decimal" Nullable="true" Precision="13" Scale="4"/>
                <Property Name="DimensionUnit" Type="Edm.String" Nullable="true" MaxLength="3"/>
                <Property Name="DimensionWidth" Type="Edm.Decimal" Nullable="true" Precision="13" Scale="4"/>
                <Property Name="LongDescription" Type="Edm.String" Nullable="true" MaxLength="255"/>
                <Property Name="Name" Type="Edm.String" Nullable="false" MaxLength="80"/>
                <Property Name="PictureUrl" Type="Edm.String" Nullable="true" MaxLength="255"/>
                <Property Name="Price" Type="Edm.Decimal" Nullable="true" Precision="23" Scale="3"/>
                <Property Name="ProductID" Type="Edm.Int64" Nullable="false" MaxLength="10">
                    <Annotation Term="Org.OData.Core.V1.Computed"/>
                </Property>
                <Property Name="QuantityUnit" Type="Edm.String" Nullable="true" MaxLength="3"/>
                <Property Name="ShortDescription" Type="Edm.String" Nullable="true" MaxLength="255"/>
                <Property Name="SupplierID" Type="Edm.Int64" Nullable="false" MaxLength="10"/>
                <Property Name="Weight" Type="Edm.Decimal" Nullable="true" Precision="13" Scale="3"/>
                <Property Name="WeightUnit" Type="Edm.String" Nullable="true" MaxLength="3"/>
                <Property Name="Picture" Type="Edm.Stream" Nullable="true"/>
                <NavigationProperty Name="Supplier" Type="com.sap.mbtepmdemo.Supplier" Nullable="false" Partner="Products">
                    <ReferentialConstraint Property="SupplierID" ReferencedProperty="SupplierID"/>
                </NavigationProperty>
                <NavigationProperty Name="Stock" Type="com.sap.mbtepmdemo.Stock" Nullable="true" Partner="Product">
                    <OnDelete Action="Cascade"/>
                </NavigationProperty>
                <NavigationProperty Name="PurchaseOrderItems" Type="Collection(com.sap.mbtepmdemo.PurchaseOrderItem)" Partner="Product">
</NavigationProperty>
                <NavigationProperty Name="SalesOrderItems" Type="Collection(com.sap.mbtepmdemo.SalesOrderItem)" Partner="Product">
</NavigationProperty>
            </EntityType>
            <EntityType Name="ProductCategory">
                <!-- TODO: reconsider key, navigation properties?-->
                <Key>
                    <PropertyRef Name="Category"/>
                </Key>
                <Property Name="Category" Type="Edm.String" Nullable="false" MaxLength="40"/>
                <Property Name="CategoryName" Type="Edm.String" Nullable="true" MaxLength="40"/>
                <Property Name="MainCategory" Type="Edm.String" Nullable="true" MaxLength="40"/>
                <Property Name="MainCategoryName" Type="Edm.String" Nullable="true" MaxLength="40"/>
                <Property Name="NumberOfProducts" Type="Edm.Int64" Nullable="true"/>
            </EntityType>
            <EntityType Name="ProductText">
                <!-- TODO: reconsider key, navigation properties?-->
                <Key>
                    <PropertyRef Name="ID"/>
                </Key>
                <Property Name="ID" Type="Edm.Int64" Nullable="false">
                    <Annotation Term="Org.OData.Core.V1.Computed"/>
                </Property>
                <Property Name="Language" Type="Edm.String" Nullable="true" MaxLength="2"/>
                <Property Name="LongDescription" Type="Edm.String" Nullable="true" MaxLength="255"/>
                <Property Name="Name" Type="Edm.String"/>
                <Property Name="ProductID" Type="Edm.Int64" Nullable="true" MaxLength="10"/>
                <Property Name="ShortDescription" Type="Edm.String" Nullable="true" MaxLength="255"/>
            </EntityType>
            <EntityType Name="PurchaseOrderHeader">
                <Key>
                    <PropertyRef Name="PurchaseOrderID"/>
                </Key>
                <Property Name="CurrencyCode" Type="Edm.String" Nullable="true" MaxLength="5"/>
                <Property Name="GrossAmount" Type="Edm.Decimal" Nullable="true" Precision="15" Scale="3"/>
                <Property Name="NetAmount" Type="Edm.Decimal" Nullable="true" Precision="15" Scale="3"/>
                <Property Name="PurchaseOrderID" Type="Edm.Int64" Nullable="false" MaxLength="10">
                    <Annotation Term="Org.OData.Core.V1.Computed"/>
                </Property>
                <Property Name="SupplierID" Type="Edm.Int64" Nullable="false" MaxLength="10"/>
                <Property Name="TaxAmount" Type="Edm.Decimal" Nullable="true" Precision="15" Scale="3"/>
                <NavigationProperty Name="Supplier" Type="com.sap.mbtepmdemo.Supplier" Nullable="false" Partner="PurchaseOrders">
                    <ReferentialConstraint Property="SupplierID" ReferencedProperty="SupplierID"/>
                </NavigationProperty>
                <NavigationProperty Name="Items" Type="Collection(com.sap.mbtepmdemo.PurchaseOrderItem)" Partner="Header">
                    <OnDelete Action="Cascade"/>
                </NavigationProperty>
            </EntityType>
            <EntityType Name="PurchaseOrderItem">
                <Key>
                    <PropertyRef Name="ItemNumber"/>
                    <PropertyRef Name="PurchaseOrderID"/>
                </Key>
                <Property Name="CurrencyCode" Type="Edm.String" Nullable="true" MaxLength="5"/>
                <Property Name="GrossAmount" Type="Edm.Decimal" Nullable="true" Precision="15" Scale="3"/>
                <Property Name="ItemNumber" Type="Edm.Int32" Nullable="false"/>
                <Property Name="NetAmount" Type="Edm.Decimal" Nullable="true" Precision="15" Scale="3"/>
                <Property Name="ProductID" Type="Edm.Int64" Nullable="false" MaxLength="10"/>
                <Property Name="PurchaseOrderID" Type="Edm.Int64" Nullable="false" MaxLength="10"/>
                <Property Name="Quantity" Type="Edm.Int32" Nullable="false" Precision="13" Scale="3"/>
                <Property Name="QuantityUnit" Type="Edm.String" Nullable="true" MaxLength="3"/>
                <Property Name="TaxAmount" Type="Edm.Decimal" Nullable="true" Precision="15" Scale="3"/>
                <NavigationProperty Name="Product" Type="com.sap.mbtepmdemo.Product" Nullable="false">
                    <ReferentialConstraint Property="ProductID" ReferencedProperty="ProductID"/>
                </NavigationProperty>
                <NavigationProperty Name="Header" Type="com.sap.mbtepmdemo.PurchaseOrderHeader" Nullable="false">
                    <ReferentialConstraint Property="PurchaseOrderID" ReferencedProperty="PurchaseOrderID"/>
                </NavigationProperty>
            </EntityType>
            <EntityType Name="SalesOrderHeader">
                <Key>
                    <PropertyRef Name="SalesOrderID"/>
                </Key>
                <Property Name="CreatedAt" Type="Edm.DateTimeOffset" Nullable="true"/>
                <Property Name="CurrencyCode" Type="Edm.String" Nullable="true" MaxLength="5"/>
                <Property Name="CustomerID" Type="Edm.Int64" Nullable="true" MaxLength="10"/>
                <Property Name="GrossAmount" Type="Edm.Decimal" Nullable="true" Precision="15" Scale="3"/>
                <Property Name="LifeCycleStatus" Type="Edm.String" Nullable="false" MaxLength="1"/>
                <Property Name="LifeCycleStatusName" Type="Edm.String" Nullable="false" MaxLength="255"/>
                <Property Name="NetAmount" Type="Edm.Decimal" Nullable="true" Precision="15" Scale="3"/>
                <Property Name="SalesOrderID" Type="Edm.Int64" Nullable="false" MaxLength="10">
                    <Annotation Term="Org.OData.Core.V1.Computed"/>
                </Property>
                <Property Name="TaxAmount" Type="Edm.Decimal" Nullable="true" Precision="15" Scale="3"/>
                <NavigationProperty Name="Customer" Type="com.sap.mbtepmdemo.Customer" Nullable="false" Partner="SalesOrders">
                    <ReferentialConstraint Property="CustomerID" ReferencedProperty="CustomerID"/>
                </NavigationProperty>
                <NavigationProperty Name="Items" Type="Collection(com.sap.mbtepmdemo.SalesOrderItem)" Partner="Header">
                    <OnDelete Action="Cascade"/>
                </NavigationProperty>
            </EntityType>
            <EntityType Name="SalesOrderItem">
                <Key>
                    <PropertyRef Name="ItemNumber"/>
                    <PropertyRef Name="SalesOrderID"/>
                </Key>
                <Property Name="MAC" Type="Edm.String" Nullable="true" MaxLength="48"/>
                <Property Name="CTN" Type="Edm.String" Nullable="true" MaxLength="48"/>
                <Property Name="CurrencyCode" Type="Edm.String" Nullable="true" MaxLength="5"/>
                <Property Name="DeliveryDate" Type="Edm.Date" Nullable="true"/>
                <Property Name="GrossAmount" Type="Edm.Decimal" Nullable="true" Precision="15" Scale="3"/>
                <Property Name="ItemNumber" Type="Edm.Int32" Nullable="false"/>
                <Property Name="NetAmount" Type="Edm.Decimal" Nullable="true" Precision="15" Scale="3"/>
                <Property Name="ProductID" Type="Edm.Int64" Nullable="false" MaxLength="10"/>
                <Property Name="Quantity" Type="Edm.Int32" Nullable="false" Precision="13" Scale="3"/>
                <Property Name="QuantityUnit" Type="Edm.String" Nullable="true" MaxLength="3"/>
                <Property Name="SalesOrderID" Type="Edm.Int64" Nullable="false" MaxLength="10"/>
                <Property Name="TaxAmount" Type="Edm.Decimal" Nullable="true" Precision="15" Scale="3"/>
                <NavigationProperty Name="Product" Type="com.sap.mbtepmdemo.Product" Nullable="false">
                    <ReferentialConstraint Property="ProductID" ReferencedProperty="ProductID"/>
                </NavigationProperty>
                <NavigationProperty Name="Header" Type="com.sap.mbtepmdemo.SalesOrderHeader" Nullable="false">
                    <ReferentialConstraint Property="SalesOrderID" ReferencedProperty="SalesOrderID"/>
                </NavigationProperty>
            </EntityType>
            <EntityType Name="Stock">
                <Key>
                    <PropertyRef Name="ProductID"/>
                </Key>
                <Property Name="LotSize" Type="Edm.Int32" Nullable="true" Precision="13" Scale="3"/>
                <Property Name="MinStock" Type="Edm.Int32" Nullable="true" Precision="13" Scale="3"/>
                <Property Name="ProductID" Type="Edm.Int64" Nullable="false" MaxLength="255"/>
                <Property Name="Quantity" Type="Edm.Int32" Nullable="true" Precision="13" Scale="3"/>
                <Property Name="QuantityLessMin" Type="Edm.Boolean" Nullable="false"/>
                <NavigationProperty Name="Product" Type="com.sap.mbtepmdemo.Product" Nullable="false">
                    <ReferentialConstraint Property="ProductID" ReferencedProperty="ProductID"/>
                </NavigationProperty>
            </EntityType>
            <Action Name="GenerateSamplePurchaseOrders">
                <ReturnType Type="Edm.Boolean" Nullable="false"/>
            </Action>
            <Action Name="GenerateSampleSalesOrders">
                <ReturnType Type="Edm.Boolean" Nullable="false"/>
            </Action>
            <Action Name="ResetSampleData">
                <ReturnType Type="Edm.Boolean" Nullable="false"/>
            </Action>
            <Action Name="UpdateSalesOrderStatus">
                <ReturnType Type="Edm.Boolean" Nullable="false"/>
                <Parameter Name="id" Type="Edm.Int64" Nullable="false"/>
                <Parameter Name="newStatus" Type="Edm.String" Nullable="false"/>
            </Action>
            <EntityContainer Name="Com_sap_mbtepmdemoService">
                <Annotation Term="Repeatability.Supported"/>
                <Annotation Term="Repeatability.DeleteWithClientIDSupported"/>
                <Annotation Term="Repeatability.DeleteWithRequestIDSupported"/>
                <Annotation Term="Capabilities.AcceptableEncodings">
                    <Collection>
                        <String>gzip</String>
                    </Collection>
                </Annotation>
                <Annotation Term="Capabilities.BatchSupported"/>
                <Annotation Term="Capabilities.SkipSupported"/>
                <Annotation Term="Capabilities.TopSupported"/>
                <EntitySet Name="Customers" EntityType="com.sap.mbtepmdemo.Customer">
                    <NavigationPropertyBinding Path="SalesOrders" Target="SalesOrderHeaders"/>
                </EntitySet>
                <EntitySet Name="Suppliers" EntityType="com.sap.mbtepmdemo.Supplier">
                    <NavigationPropertyBinding Path="Products" Target="Products"/>
                    <NavigationPropertyBinding Path="PurchaseOrders" Target="PurchaseOrderHeaders"/>
                </EntitySet>
                <EntitySet Name="Products" EntityType="com.sap.mbtepmdemo.Product">
                    <NavigationPropertyBinding Path="Supplier" Target="Suppliers"/>
                    <NavigationPropertyBinding Path="Stock" Target="Stock"/>
                    <NavigationPropertyBinding Path="PurchaseOrderItems" Target="PurchaseOrderItems"/>
                    <NavigationPropertyBinding Path="SalesOrderItems" Target="SalesOrderItems"/>
                </EntitySet>
                <EntitySet Name="ProductCategories" EntityType="com.sap.mbtepmdemo.ProductCategory"> </EntitySet>
                <EntitySet Name="ProductTexts" EntityType="com.sap.mbtepmdemo.ProductText"> </EntitySet>
                <EntitySet Name="PurchaseOrderHeaders" EntityType="com.sap.mbtepmdemo.PurchaseOrderHeader">
                    <NavigationPropertyBinding Path="Items" Target="PurchaseOrderItems"/>
                    <NavigationPropertyBinding Path="Supplier" Target="Suppliers"/>
                </EntitySet>
                <EntitySet Name="PurchaseOrderItems" EntityType="com.sap.mbtepmdemo.PurchaseOrderItem">
                    <NavigationPropertyBinding Path="Header" Target="PurchaseOrderHeaders"/>
                    <NavigationPropertyBinding Path="Product" Target="Products"/>
                </EntitySet>
                <EntitySet Name="SalesOrderHeaders" EntityType="com.sap.mbtepmdemo.SalesOrderHeader">
                    <NavigationPropertyBinding Path="Items" Target="SalesOrderItems"/>
                    <NavigationPropertyBinding Path="Customer" Target="Customers"/>
                </EntitySet>
                <EntitySet Name="SalesOrderItems" EntityType="com.sap.mbtepmdemo.SalesOrderItem">
                    <NavigationPropertyBinding Path="Header" Target="SalesOrderHeaders"/>
                    <NavigationPropertyBinding Path="Product" Target="Products"/>
                </EntitySet>
                <EntitySet Name="Stock" EntityType="com.sap.mbtepmdemo.Stock">
                    <NavigationPropertyBinding Path="Product" Target="Products"/>
                </EntitySet>
                <ActionImport Name="GenerateSamplePurchaseOrders" Action="com.sap.mbtepmdemo.GenerateSamplePurchaseOrders"/>
                <ActionImport Name="GenerateSampleSalesOrders" Action="com.sap.mbtepmdemo.GenerateSampleSalesOrders"/>
                <ActionImport Name="ResetSampleData" Action="com.sap.mbtepmdemo.ResetSampleData"/>
                <ActionImport Name="UpdateSalesOrderStatus" Action="com.sap.mbtepmdemo.UpdateSalesOrderStatus"/>
            </EntityContainer>
        </Schema>
    </edmx:DataServices>
</edmx:Edmx>
  1. Login to Cloud Foundry by navigating to View → Command Palette and inputing CF Login.
Login to Cloud Foundry
  1. Follow the steps mentioned to login, the result is shown below.
Successful Login to Cloud Foundry
  1. At the top left, go to View → Command Palette and input MTB:Create Mobile Backend Server Project.
Create Mobile Backend Server Project
  1. Modify the content of “TestSettings.java” as such:
TestSettingsjava
  1. Modify the “manifest.yml” as shown below:
    – Add random-route: true
    – Change the mem/disk to 1GB since it’s the limitation for trial
manifestyml

Deploy the OData Service

  1. Deploy the service by clicking Runtask and choosing deploy-mobile-server.
Run Task
Deploy Mobile Server
  1. Once the deployment is successful, copy the URL which will be used to bind the OData with the MDK app instance.
Service Root URL
  1. Check the status of your new OData service from Trial Home as below.
SAP BTP Cockpit Trial Home

Bind the OData Service to the MDK App

  1. Open the MDK app details screen.
  2. Select Mobile Connectivity.
  3. Click + to add a new destination.
  4. Enter the OData Service URL.
Add OData Service URL
OData Service Bound to MDK App

Building the SAP ERP Demo App

Set Up the Build Environment

  1. Download and install the SAP BTP SDK for Android.
  2. Install and set up Android Studio.
  3. Open the SAP_ERP project directory in Android Studio.
  4. Let Gradle complete initialization.

Modify Configuration Files

  • Update app/src/main/res/raw/sap_mobile_services.json:
    – Replace the Service URL with the MDK App URL.
    – Replace the appID with the MDK app ID.
  • Modify SAPWizardApplication.kt:
    – Replace the API Key at line #113.

Build the APK

  1. Open the Gradle tool window in Android Studio.
  2. Navigate to GsSAPDemo → app → build → assemble.
  3. Execute the build task.
  4. When build finished, the apks will output to path as belows:
  • ./app/build/outputs/apk/tencentAppStoreforChinaMarket/debug/app-tencentAppStoreforChinaMarket-debug.apk
  • ./app/build/outputs/apk/tencentAppStoreforChinaMarket/release/app-tencentAppStoreforChinaMarket-release-unsigned.apk
  • ./app/build/outputs/apk/googlePlayStoreforGlobalMarket/debug/app-googlePlayStoreforGlobalMarket-debug.apk
  • ./app/build/outputs/apk/googlePlayStoreforGlobalMarket/release/app-googlePlayStoreforGlobalMarket-release-unsigned.apk
  1. Choose the correct APK for your target device.

Running the SAP ERP Demo

Deploy and Verify the OData Service

  1. Deploy the mobile backend server.
  2. Verify the service status from SAP BTP Trial Home.

Run the SAP ERP Demo App

  • Install the generated APK on an Android device or emulator.
  • Launch the application.
  • Authenticate using the API Key.
  • The application should now connect to the OData Service and display ERP data.

Additional Customizations (Optional)

  • Modify the generated SDK Wizard App:
    – Adjust network requests.
    – Customize onboarding and UI components.
  • Implement offline support using SAP’s Offline OData library.
  • Enable Push Notifications if required.

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support