Skip to Content
Technical Articles
Author's profile photo SaiNithesh Gajula

Consume ABAP RESTful Application Programming Model (RAP) Service in SAP UI5 Application

Hello Everyone

In this blog will see how to consume RAPM (ABAP RESTful Application Programming Model) service in SAP UI5 App through SAP Business Application Studio (BAS).

Step 1: Required SAP Cloud Platform Trial account. Refer below link to create.

https://developers.sap.com/tutorials/hcp-create-trial-account.html

Step 2: Considering we have ABAP RESTful Application Programming Model (RAP) service developed in SAP Cloud Platform ABAP Environment. To create one you can follow OpenSAP course Building Apps with the ABAP RESTful Application Programming Model

Step 3: Create Destination for RAP

Name RAPM
Type HTTP
Description ABAP Restful Service
URL Enter the URL of the ABAP system that you copied from the <url> element in the service key
ProxyType Internet
Authentication OAuth2UserTokenExchange
Client ID Enter the content of the <clientID> element that you copied from the service key
Client Secret Enter the content of the <clientsecret> element that you copied from the service key
Token Service URL Enter <uaa-url>/oauth/token, where is the content of the element that you copied from the public key section of the service key https://xxxxx.authentication.eu10.hana.ondemand.com/oauth/token
Token Service URL Type Choose Dedicated

 

Step 4: Configure SAP Business Application Studio and create dev by following below links.

https://developers.sap.com/tutorials/appstudio-onboarding.html

https://developers.sap.com/tutorials/appstudio-devspace-fiori-create.html

Step 5: Launch SAP Business Application Studio, use Ctrl+Shift+P to launch command palette and search for Yeoman Generator

Step 6: Select SAP Fiori freestyle SAP UI5 application and click on “Next”.

Step 7: Select SAP Fiori Worklist application and click on “Next”.

Step 8: Choose Connect to an SAP System and click on “Next”.

Step 9: Select RAPM (SCP), which is our destination name, and click on “Next”.

Step 10: Select service ZUI_RAP_TRAVEL_O2_2143, which was developed in ABAP environment, and click on “Next”.

Step 11: Select fields for the floorplan as mentioned below or anything of your choice, and click on “Next”.

Step 12: Provide Project Attributes as shown below and click on “Finish”.

Step 13: Open the project in the New Workspace.

Step 14: We can see the project file in the explorer section as below

Step 15: Right click on the webapp and we can see below popup. Choose Preview Application.

Step 16: Select start as shown below

Step 17: Application will be launched in the New Tab as shown below and click on the Tile “ABAP Env UI5 APP”

Step 18: Finally, we can see our application data loading from ABAP RESTful Application Programming Model (RAP) Service developed in ABAP Environment in SAP Cloud Platform.

 

Hope you guys like this blog post.

Feel free to comment

 

Regards,

Sai Nithesh Gajula

Assigned tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Nanda Kishore Kishore
      Nanda Kishore Kishore

      Keep going Sai....Great work

      Author's profile photo SaiNithesh Gajula
      SaiNithesh Gajula
      Blog Post Author

      Thanks Nanda 🙂

      Author's profile photo anitra carol
      anitra carol

      Thanks for the great information in your blog

      The ABAP RESTful Application Programming Model offers developers an efficient way to build enterprise-ready, SAP HANA-optimized, OData-based Fiori UI services and Web APIs in the cloud as well as on-premise. It is the evolutionary successor to the ABAP Programming Model for SAP Fiori.

      Author's profile photo SUBBA KRISHNA VIJAYA KUMAR
      SUBBA KRISHNA VIJAYA KUMAR

      Hi Sai,

      I am getting below response when i try to check if destination is working.

      Connection to "RAPM" established. Response returned: "302: Redirect"

       

      Also cannot see the services listed in ABAP on Cloud. It says services unavailable.

      Can you please help.

       

      Thanks,

      Subba

       

      Author's profile photo SaiNithesh Gajula
      SaiNithesh Gajula
      Blog Post Author

      Hi Krishna,

      Connection to “RAPM” established. Response returned: “302: Redirect” is an expected message in the destination. Can you please elaborate on the "Also cannot see the services listed in ABAP on Cloud. It says services unavailable." with screenshot.

      Regards,
      Sai Nithesh Gajula

      Author's profile photo SUBBA KRISHNA VIJAYA KUMAR
      SUBBA KRISHNA VIJAYA KUMAR

      Hi Sai,

      Here's the attachmentServices%20unavailable. I do now see any services listed in dropdown.Not sure what i am missing.

      Services unavailable

       

      Thanks,

      Subba

      Author's profile photo SaiNithesh Gajula
      SaiNithesh Gajula
      Blog Post Author

      Hi Subba,

      Seems like there some issue in accessing destination. Make sure you have added all the additional properties in the destination.

       

      Regards,

      Sai Nithesh Gajula