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
Advisor
Advisor

If you have an OData metadata document and you want to build an OData server from it, you can use SAP Mobile Services Mobile Backend Tools. SAP Mobile Backend Tools allows the developer to generate an OData services from an OData CSDL file and deploy the service to SAP Business Technology Platform.

In our previous blog post, we know how to add an SAP Mobile Services landscape to Mobile Backend Tools. In order to create a mobile server, you need to create a mobile backend server project first.

Run "MBT: Create Mobile Backend Server Project" command from the Visual Studio Code command palette:

2024-06-04_16-35-39.png

You will be able to see the mobile backend server wizard:

2024-06-04_16-37-44.png

Find an empty directory for the mobile backend server, and specify the location of the OData CSDL document:

2024-06-04_16-38-51.png

Press "OK" button to generate the server:

2024-06-04_16-40-55.png

Click "Open" button to open the mobile backend server project:

2024-06-04_16-43-25.png

Go to the "mobile services" view and click "server1" node:

2024-06-04_16-43-58.png

You will see a mobile backend server config console:

2024-06-04_16-45-22.png

There are 4 buttons you can use with your server:

  • Build the server. If you make changes in the source code, or you change the configuration of the server, you need to rebuild your server.
  • Preview the server. Before deploying the server to the cloud, you can preview the server using a local Tomcat.
  • Deploy the server. You can deploy the server to SAP Business Technology Platform Cloud Foundry environment, but before doing that you need to login to cloud foundry first through "cf login" command.
  • Deploy the server to SAP Mobile Services. You can deploy the server to the same cloud foundry environment as the SAP Mobile Services landscape added previously, and you can also create a mobile destination to an existing mobile application in the mobile services instance.

In this blog post, we will show you how to deploy the server through the "Deploy to Mobile Services" button:

2024-06-04_16-50-31.png

Click the "Deploy to Mobile Services" button, you will see the mobile services landscape name in the pop up window:

2024-06-04_16-51-25.png

Select this mobile services landscape and press enter key, you will be prompted with an option whether you want to create a mobile destination:

2024-06-04_16-52-42.png

Select "No" because we only want to deploy the service this time, and the deployment is started. Wait until the deployment has been finished:

2024-06-04_16-56-33.png

And then you can test the deployed OData server using your browser:

2024-06-04_16-59-25.png

 

As a summary, in this blog post we have demonstrated how to generate a mobile backend server using SAP Mobile Services Mobile Backend Tools from an OData CSDL document. We also demonstrated how to deploy the mobile backend server to the SAP BTP Cloud Foundry environment through the added mobile services instance.