Skip to Content
0
Nov 23, 2022 at 10:44 AM

SAP BTP Launchpad Services- Integrate the REST API via Destination Service for Fiori app

1387 Views Last edit Nov 24, 2022 at 08:27 AM 4 rev

Hi,

We all know that using Northwind OData on BAS and/or Launchpad services for HTML5 apps works perfectly fine. However when we use REST API and try to follow same steps we run into issues when running HTML5 app from sites on Launchpad services. Surprisingly, app run from BAS works fine.

I have gone through blog series SAP Tech Bytes: Consume Data Using Destinations with an Approuter – Cloud Foundry Basics #3 by Nicolai Geburek however have no luck yet.

Sharing some details and github repo as well

REST API endpoint

Github Repo to review xs-app.json, ui5.yaml etc

BTP destination config:

destination.png

Issue:

Ajax code:

ajax.png

Error for Ajax call under network tag

wrong-path.png

When we look at other calls on Network tab, I see one of them trying to call $metadata and when I use the Reuest URL and manually change the path I am able to reach the destination. However this doesn't happen when a AJAX call is made from one of the controllers :

manual-url-pick.png

manually change the path

manual-url.png

In other words, I understand is that, Launchpad service could use destination service(shown below) for OData calls however fails to do the same when a ajax call is made from app

destination-srv.png

Attachments

destination.png (43.7 kB)
wrong-path.png (14.5 kB)
ajax.png (32.9 kB)
manual-url.png (95.3 kB)