cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing CPI endpoint from mta application in SAP BAS

UdayMS
Participant
0 Kudos

Hi All,

I want to consume SAP CPI endpoint URL and post some parameters to that link basically. There is a URL provided by CPI team for that. In order for my app to work in all environments, I am trying to take a destination approach for that. We have a destination created in SAP BTP for CPI. I am doing following steps

1. Creating a fiori module inside mta application with datasource as none. I am manually adding in xs-app.json in routes

2. Making ajax call in my controller as /uimodule/dest_name/cpiendpointname?parameters

uimodule - is the name of fiori module inside mta

dest_name is the name i have given in source part of routes in xs-app.json

When I run the application, its given by 404 error. Basically my destination is not resolving to actual CPI URL .

Kindly help if my approach is right and if so anything I am missing here

Thanks

UDay

kc_kristris
Active Participant
0 Kudos

Hello Uday,

You can directly use the endpoint URL of CPI, no need for any destination. CPI tenant is available over cloud, You just need to pass the credentials of your CPI tenant.

Regards,

Kris

UdayMS
Participant
0 Kudos

Hi Kris

Yes we can use it but our ADO pipeline build blocks the direct url if used in the code. Also that url will be environment specific like dev, staging etc. If we use direct tenant url would it work in all environments?

Thanks

Uday

UdayMS
Participant
0 Kudos

Hi All,

Any help? Still stuck with the issue

Thanks

Uday

0 Kudos

Hi,

could you share how you configured destination in BTP ?

- Avinash

Accepted Solutions (0)

Answers (2)

Answers (2)

UdayMS
Participant
0 Kudos

Hi avinash.m5 daviddasilva

Thank you so much for the inputs. However I was able to resolve the issue by splitting the App ID and appending with my endpoint in the ajax call.

Marking this as closed as my issue is resolved

Once again thank you everyone for your valuable suggestions

Thanks

Uday

daviddasilva
Active Contributor
0 Kudos

Hello,

404 means it can't find the endpoint so check with your CPI team that the endpoint is deployed and that the correct target URL has been used in the destination.

In your Destination, ensure that the configured URL is the target URL that you are trying to access and not just the hostname of the CPI tenant.

In your destination, you can do a connectivity test - if this is also showing a 404 error then you can say that the endpoint is not yet deployed.

If the destination is working fine, then the issue is somewhere between your application and the destination, so double-check your ajax call.

Kind regards,

David