Skip to Content
Technical Articles
Author's profile photo Jose Sequeira

SCP Mobile Services: MDK Offline CRUD App


Have you heard about SAP® Cloud Platform Mobile Services and/or Mobile Development Kit (MDK)?

“Mobile development kit (MDK) enables developers and technical business users to build native mobile applications in a highly productive environment. The tool provides a cross platform native experience so users build the app once and deploy to iOS and Android devices.”

There are already some great tutorials on MDK, like this one, but i wanted to do a “FullStack” version, coding all the way from the ABAP backend to the App itself. So basically my Goal here is for you to create your first full CRUD MDK App (Offline).

Before we continue, you need to download the Mobile Services Client App:

So let’s get to it!

First, create a Z Table in your ABAP Backend like the one below:

This Table will be the CRUD repository. Also, create a Function Group and 4 RFC enabled Function Modules like the ones below:





Very simple ones right? Just to have a CRUD scenario!

After that, i’ve created a OData project (SEGW) mapping the User Entity to the Z Table, and did the mapping in all of the Operations (Create, Delete, GetEntity, GetEntitySet and Update) for the RFCs above, like this:

Save and generate your service, after that publish using IWFND/MAINT_SERVICE.

After that, don’t forget to test all the CRUD operations to make sure it’s all running fine:

Here is the Metadata:

  <?xml version="1.0" encoding="utf-8" ?> 
- <edmx:Edmx Version="1.0" xmlns:edmx="" xmlns:m="" xmlns:sap="">
- <edmx:DataServices m:DataServiceVersion="2.0">
- <Schema Namespace="ZSCPMS_DEMO_SRV" xml:lang="en" sap:schema-version="1" xmlns="">
- <EntityType Name="User" sap:content-version="1">
- <Key>
  <PropertyRef Name="Userid" /> 
  <Property Name="Userid" Type="Edm.String" Nullable="false" MaxLength="12" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" /> 
  <Property Name="Fullname" Type="Edm.String" Nullable="false" MaxLength="100" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" /> 
  <Property Name="Email" Type="Edm.String" Nullable="false" MaxLength="120" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false" /> 
- <EntityContainer Name="ZSCPMS_DEMO_SRV_Entities" m:IsDefaultEntityContainer="true" sap:supported-formats="atom json xlsx">
  <EntitySet Name="UserSet" EntityType="ZSCPMS_DEMO_SRV.User" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:pageable="false" sap:content-version="1" /> 
  <atom:link rel="self" href="http://MYSERVER:8001/sap/opu/odata/sap/ZSCPMS_DEMO_SRV/$metadata" xmlns:atom="" /> 
  <atom:link rel="latest-version" href="http://MYSERVER:8001/sap/opu/odata/sap/ZSCPMS_DEMO_SRV/$metadata" xmlns:atom="" /> 

If all the CRUD operations are running fine on your backend, you’re all set!

In my case, i don’t need Cloud Connector as the environment used is already exposed to the internet, if yours is not, you need to use Cloud Connector.

So here is what you need now:

  1. Trial(or not) SAP Cloud Platform Account (Neo and Cloud Foundry);
  2. Setup the Connection(destination) between Neo and Cloud Foundry for Web IDE, as described here.

If you need more details about the process (setup in general), check this tutorials here as well.

Now let’s go to the Mobile Services Cockpit to create our App:

Open Mobile Applications->Native/Hybrid, and select new:

Filling the info:

Don’t forget to select the Mobile Development Kit option here:

When your app is finished, select Mobile Connectivity to create our backend destination:

Again, as i don’t need Cloud Connector, i’m creating a simple URL destination here:

Simple Auth:

Don’t forget to PING to make sure it’s fine:

We’re ready, now let’s go to the Web IDE on the Neo Account:

On the left side, select the option below:

It’s a Workspace specific for Mobile Development Kit (MDK).

Let’s create a new project, MDK CRUD Project like this:

App name:

In here, your destination created on the previous step needs to be available(mobileservices_cf), for you to be able to select your newly created App on Mobile Services.


Insert a service Name and Check the Service(to retrieve the Metadata) before you’re able to continue:

Don’t forget to leave the Enable Offline Store checked, for your app to have Offline functionalities.



Here the Offline Store, Next:

After the creation of the project, you need to Deploy like this:

Next, and then make sure your App ID is selected:

As you select Next here, will start the deploy process. You can see it happening from the Web IDE console:

After is completed, you need to get your QR Code, like this:

With this QR Code, you will Onboard your downloaded App (Android or IOS):

Et voilà, now you have your MDK Offline App running.

Want to see it in action?



Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Jitendra Kansal
      Jitendra Kansal
      Great E2E guide, thanks for sharing your experience!
      Author's profile photo Jose Sequeira
      Jose Sequeira
      Blog Post Author

      Thanks Jitendra Kansal.

      Author's profile photo Wanderson Carvalho
      Wanderson Carvalho

      excellent job !!!

      Author's profile photo Jose Sequeira
      Jose Sequeira
      Blog Post Author

      Thanks wanderson carvalho, stay tuned for more.



      Author's profile photo Equipa LABS
      Equipa LABS


      I'm not getting update and create, do you have any idea why it might be happening to me?


      Author's profile photo Jose Sequeira
      Jose Sequeira
      Blog Post Author


      Can you please send what's is showing to you? Did you select the MDK CRUD on WebIDE?



      Author's profile photo Equipa LABS
      Equipa LABS
      yes i create a mdk crud project, but only getEntity works ..
      It has happened to me with several odatas, only the get works for me, However
      the example services if everything works for me: the metadata created by user is identical to yours, and I create a raw mdk
      project and at the time of editing it doesn't give any error. But when I send the
      synchronization it doesn't show any message. I am editing the name putting "ooo" at the end ... but at the moment of
      synchronizing the data does not arrive at sap a
      nd testing from the backend works.
      My CRUD project:  
      Author's profile photo Francisco José Carrasco Valverde
      Francisco José Carrasco Valverde

      Hello. Did you guess why only works the query ? I have the same problem, update, create and delete don't call the RFC.



      Author's profile photo Khabir Ahmad Raja
      Khabir Ahmad Raja

      Add this parameter to Enpoint Customized Property

      Author's profile photo Equipa LABS
      Equipa LABS

      Hello good afternoon


      By doing your example with an app mdk CRUD you are not letting me modify or update .. It gives me this error.

      Finished sending POST request to back end'123342') in 142 ms. HTTP status from the back end is 412.


      I don't understand what is missing in the body, if the crud mdk creates the updateEntity and the CreateEntity

      Thanks for your help

      Author's profile photo Jose Sequeira
      Jose Sequeira
      Blog Post Author

      Hello, did you test all your services CRUDs first using Gateway client? To make sure they are all working...



      Author's profile photo Equipa LABS
      Equipa LABS

      yes in gateway client everything works

      Author's profile photo Jose Sequeira
      Jose Sequeira
      Blog Post Author

      412 is a pre-condition failed, just making sure, you're sending a POST to the below URL?'123342‘)

      Because for POST(Create) calls you don't send the Entity Key on the URL, just for PUT (Update) Calls...

      Have you tried using a IOS device as well?

      Author's profile photo Khabir Ahmad Raja
      Khabir Ahmad Raja


      I have the same problem. For me only GetEntitySet request is working. All POST, MERGE  or DELETE requests are failed with status 412 from the back end.

      Any solution for this problem?

      Should we do something with URL Rewrite Modes or some Custom Header in Request?

      Author's profile photo Khabir Ahmad Raja
      Khabir Ahmad Raja

      I have solved this issue by adding a private parameter to the Endpoint Customized Property. The key-value of this parameter is


      For more details:


      Author's profile photo Leandro Freidenberg
      Leandro Freidenberg

      Hi, very good tutorial.

      I´m having an error while trying on checking the service to retrieve the metadata: "Failed to get valid service metadata.No service is found in XML".

      I have set up a destination pointing at my backend system. This destination is used for web-ide developments to deploy and retrieve apps without problems.

      Any help will be much appreciatted.


      Author's profile photo Jose Sequeira
      Jose Sequeira
      Blog Post Author


      Leandro Freidenberg , how are you?

      Have you tried to ping your Destination?



      Author's profile photo Adrian Borja
      Adrian Borja

      thanks for this! a great end to end tutorial to show proof of concept. the tutorial is a bit abridged though, would be very challenging to those who don't have prior exposure or reference to SAP Cloud Platform, creating destinations, creating oData from scratch. but overall, great content, I learned new things!

      Author's profile photo Fitha Zainab Zakkeer
      Fitha Zainab Zakkeer

      Hai sir

      Thank you for this blog.

      I am having some doubt regarding offline working of mdk app.

      While we make changes to mobile app during offline ,It will go to queue db, then what is the data limit of queue db ?

      what is retention period for data in the queue db?


      Author's profile photo Emilio Diaz
      Emilio Diaz



      Do you know what licenses are needed to use offline app?


      Thank you