Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Xiao-fei_Song
Product and Topic Expert
Product and Topic Expert
294

Even with a lot of modern tools today's mobile development to consume an SAP backend system in a cloud environment like SAP Mobile Services still faces many challenges. For example below:

  • The backend system is running inside an on-premise system and the OData services implemented using NetWeaver Gateway system is out of date.
  • You have a big OData services that contains many entity sets that are not needed by the mobile apps. During the app development It ends up generating a pretty big proxy client in this case that becomes a burden for the client apps.
  • The backend system is not yet ready to be consumed by the mobile apps because it may be still under development, and the services might contain critical bugs to be fixed by the backend team. The mobile and frontend team have to wait until those issues get resolved before starting the actual coding for the UX and mobile app.
  • In the early stage of the project, the business consultants and architects need to create a PoC for the mobile consumption of the backend OData services, but the service is only allowed to be accessed in a read only mode and the client can't update any of its data.

In this blog post, we'll demonstrate how to create a development backend system that the mobile team can fully control out of the existing backend OData services using the SAP Mobile Services Mobile Backend Tools to overcome the above challenges. For example, in the early phase of your mobile project, you can build a PoC of the mobile app using the development backend system without having to make modifications on any of the existing backend systems.

Suppose you have set up correctly the SAP Mobile Services Mobile Backend Tools with the mobile services landscape, and you can view the mobile destinations in Visual Studio Code environment correctly:

2024-06-12_12-58-31.png

Please note that the OData services might contains many entity sets that are not needed by the client application:

2024-06-12_13-01-10.png

In this case we want to include only the entity sets needed by your mobile apps to our development backend system, click the "Prune" toolbar button:

2024-06-12_13-03-54.png

You will see the prune dialog like below:

2024-06-12_13-05-01.png

In the prune dialog, select only the entity sets that are needed by your mobile apps:

2024-06-12_13-08-22.png

Click "OK" button to close the dialog, and you will see an updated OData CSDL model that should only contain the entity sets you need in order to build your mobile app:

2024-06-12_13-09-33.png

Now let's build a development backend system using the above CSDL model. In order to do that, click the "Generate Development Backend" toolbar button:

2024-06-12_13-10-59.png

Select "Yes" to confirm the generation:

2024-06-12_13-11-43.png

Select "Yes" to include the test data from the original backend system. Mobile Backend Tools will copy 1000 records from the original backend system to the development backend system for each entity set in the current CSDL model.

2024-06-12_13-12-34.png

Press enter key to accept the mobile destination name for the development backend system:

2024-06-12_13-14-28.png

And the process of generating the development backend has started:

2024-06-12_13-15-52.png

When the generation has been complete, you will see below:

2024-06-12_13-19-23.png

You will also notice that a new mobile destination has been created in your mobile app. Now let's take a look at the generated development backend system in mobile services. Click "purchaseorder-dev" mobile destination:

2024-06-12_13-26-57.png

You will see the development backend system only contains the 6 entity sets we selected in the prune dialog. And in the "Diagram" view, you see a much smaller OData model in the UI:

2024-06-12_13-28-55.png

Now let's test this backend system. Right click the mobile destination for the development backend system, and click "Run Test Query" menu item:

2024-06-12_13-30-09.png

The test query page shows up like below:

2024-06-12_13-31-42.png

Run some tests in the test query page against this development backend system:

2024-06-12_13-32-18.png2024-06-12_13-33-20.png2024-06-12_13-34-22.png2024-06-12_13-34-57.png

You can see this newly generated OData services is working as expected.

As a summary, in this blog post we have demonstrated how to generate a development backend system from an existing backend system along with the test data using SAP Mobile Services Mobile Backend Tools. With the generated development backend system that is fully owned by the mobile frontend team, the development of the backend and mobile app can be decoupled and it's also very easy to build a PoC for a mobile project at the early stage of the project.