Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Chetan_Bhatt
Explorer

OBJECTIVE-:

Consuming OData Service of CAPM Application into SAP Fiori Application in Business Application Studio.

CAPM (Cloud Application Programming Model)-:

It is an open-source framework that uses tools, libraries, and languages to create applications that can be used across multiple SAP products. CAPM is a multi-target application that runs at different times, with the persistence layer running in the HANA DB run time, the server layer running in the Node.js run time, and the UI/UX layer running in the browser run time.

CAPM is one of the approaches to developing cloud applications using the BTP platform. CAPM offers a more structured and seamless framework for data modelling and enhancing integration with services.

Advantage of CAPM over other approaches-:

  • It enables full-stack development in the same environment. (BAS), eliminating the need to switch between different environments for the backend and frontend development.
  • It offers flexibility in language selection, allowing developers to work with multiple languages according to their needs. BAS provides easy connectivity to required extensions for this purpose.
  • Seamless integration with git and other applications via APIs facilitating extension or development of the application.
  • Automatically handling dependencies to a certain extent, reducing frustration, and improving development speed. For example, handling the OData after exposing all entities and making it easier to consume in the UI.

Prerequisites-:

  • Create a CAPM project.
  • Log in to Cloud Foundry Credentials.
  • Ensure the HANA Database is created and running (I Used it for storage and data creation).

Chetan_Bhatt_0-1712859475702.png

 

Chetan_Bhatt_1-1712859475728.png

 

  • Set up a Dev Space.
  • Create a SAP Build Work Zone instance to act as a Fiori Launchpad for the CAPM Application

 

You Have to create a new Destination in BTP (Connectivity -> Destination)-:

 

Chetan_Bhatt_2-1712859475732.png

 

This destination will be used for passing system information when creating a Fiori Application.

For the URL, DEPLOY YOUR APPLICATION IN CLOUD FOUNDRY (Cloud Foundry ->Spaces ->Dev (Space Name)->Your Service (here it is CAPMChetan-srv) and copy Application Routes).

This URL will be shown only when you deploy your CAPM Application in Cloud Foundry-> A new blog will be there to deploy the CAPM Application.

Chetan_Bhatt_3-1712859475740.png

 

For Authorization, use the same authorization as created in the package.json -> a new blog will create a security configuration.

 

Now that the destination for the service is configured, proceed to create a FIORI APP: -

  • Open SAP BAS (Business Application Studio).
  • Open DEV Space where you want to create a Fiori Application.
  • Go to File -> New Project From template.
  • Choose a project from the Template (SAP Fiori Application).

Chetan_Bhatt_4-1712859475749.png

 

  • Choose any Template of your choice.

Chetan_Bhatt_5-1712859475756.png

 

  • In Data Source choose to connect to a system.

Chetan_Bhatt_6-1712859475760.png

 

Chetan_Bhatt_7-1712859475765.png

 

 

  • Specify the Destination created earlier.

Chetan_Bhatt_8-1712859475769.png

 

 

  • In the service path, specify the service path of the OData service that can be obtained by running the command “cds watch –profile hybrid” in your CAPM Project.

Chetan_Bhatt_9-1712859475773.png

 

  • Click on next.

Chetan_Bhatt_10-1712859475781.jpeg

 

 

  • Select any entity from the given list of entities  you created in your project.

Chetan_Bhatt_11-1712859475788.png

 

  • Customize the project attributes.

Chetan_Bhatt_12-1712859475796.png

 

  • Choose the target as Cloud Foundry and select the Destination name among the list of destination names (You can go with either Local CAPM Project API and the name of your destination too).

 

Chetan_Bhatt_13-1712859475804.png

 

  • Now, your FIORI project is created and is ready to use.

Chetan_Bhatt_14-1712859475814.png

 

  • Go to run configuration and start the project as usual.

Chetan_Bhatt_15-1712859475821.png

 

  • You can now run this Fiori Application which is the result of an Application created from CAPM.

Chetan_Bhatt_16-1712859475830.png

 

 

Labels in this area