cancel
Showing results for 
Search instead for 
Did you mean: 

Use CF destination in SAPUI5 module

alejiandro_sensejl
Active Participant

Hi,

I am struggling for almost two days to get a freestyle SAP UI5 application which was used for on-prem Fiori server up and running in cloud foundry FLP service.

Following the two blogs "Develop your first SAP Fiori launchpad site with portal service on SAP Cloud Platform Multi Cloud" by iris_blog I was able to deploy my app to cloud foundry space, but there is no data coming in.

In Neo subaccount there was a destination (let's say:) "neo-destination" for testing which was working fine. In cloud foundry there is a destination "cf-destination" that was prepared on subaccount destination service.

I think I already learned that I need to map the destination in the xs-app, but I have a hard time to understand the SAP help guide and I was not able to find some blog for this scenario.

What are the steps to perform such a mapping to a cf destination service (subaccount level)?

Best regards,

Alej

0 Kudos

Hi Alejandro,

As I come to know that you have already solved the issue
I would like to know how you resolved the issue

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert

Hi Alejandro,

I explain your doubt partially here. On the blog you will see the route mapping in the App Router is directing data reads to the odata service running on CF.

However, you could simply replace the srv_api with your own destination service pointing to an internet odata service or an on-premise system connected via SAP Cloud Connector.

Therefore, please let me know where your odata service resides and we can go from there.

Best regards,
Ivan

alejiandro_sensejl
Active Participant
0 Kudos

Hi ivan.mirisola,

thank you for helping out!

I will briefly try to explain my question a little bit more:

We have a SAPUI5 application that is currently running on on-prem Fiori server. That application should additionally run on SCP, so if possible I do not want to change the application code itself. When deploying the app to NEO I can map the destination from app descriptor to the real destination (see screenshot) and the app works there, too.

Now I am struggling to perform the same in cloud foundry. Can you explain how to do that, please?

Please note that I am coming from on-prem world. I have worked with NEO space a little bit in the past, but this is the first time for me to work with cloud foundry space...

Thanks a lot!!

Best regards,

Alej

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Alejandro,

So your question is on how you can dynamically switch the used destination on an application running on CF. Is this correct?

If so, the simple answer is no - there is no way to assign a different destination to an application in the SCP Cockpit tools when you are talking about Cloud Foundry. Moreover, the destination is only defined in manifest.yml or MTA.yml files and used by the App Router application. Thus you would need to change it on both artifacts and perform a redeploy.

I'm curious why one would need to switch between destinations in an application anyway.

Do you mean you want to have a single application instance that performs calls to an OData service sitting in an on-premise system while being able to switch it to another on-premise system? Is this the case here? If so, what would be the reason to perform such a switch? Wouldn't it make more sense to have a single application using a single destination name and change the destination settings instead?

A more sophisticated scenario would be to have two or more destinations registered in your space sub-account and registered as different paths in the routing (xs-apps). Then, according to your business logic you would send requests either to one or the other destination paths which would then translate to a call to one particular destination.

Unfortunately, as of today, you cannot share an application instance in CF with two or more sub-accounts like you do with Neo's application subscription. In Neo, sub-accounts have all configuration distinct from another sub-account. Thus, it is possible to have a destination with a unique name created on two sub-accounts pointing to different systems. Then, you can subscribe to an application from another sub-account - which basically makes the same application call different backend systems depending on the URL being called. But that is not available on CF.

Regards,
Ivan

alejiandro_sensejl
Active Participant
0 Kudos

Hi Ivan,

no, my question is MUCH more simple...

The SAPUI5 application is developed in Neo stack as standalone application using Web IDE and deployed to on-prem ABAP Fiori-Frontend-Server, so it has destination from Neo in neo-app.json. I tried to add that application to MTA project but I do not know what changes need to be done in order to use Cloud Foundry destination that has a different name while pointing to the same on-prem system (destination was already created by some admin on CF subaccount level some while ago). Probably changes to xs-app and mta.yaml are required but I do not know what to do exactly and I still have a hard time to find some proper documentation covering such a "migration" from Neo FLP to CF FLP...

Best regards,
Alej

seankogn
Explorer
0 Kudos

Hi, Ivan

I was able to bind my ui5 app to destination_instance with destination to an internet URL and it worked. BUT, to an on-prem URL not working (http status 500). After binding to connectivity_instance, I got the error 404. I double checked the cloud connector and on-prem URL, they are all working. Anything else I may miss? Any ideas?

Thanks

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Alejandro Sensejl, Hi Sean Kong,

In Cloud Foundry you must bind your app to an instance of both connectivity and destination services. Furthermore, your application must be deployed in CF in such a way that there is a JWT present. The connectivity service demands your app is authenticated Therefore, you have to have the AppRouter setup for user authentication. In addition to it, you have to address the destinations in xs-app.json. It is all explained in my blog.

Alejandro Sensejl,

I think we have a misconception about MTAs. Both Neo and CF support MTAs. However, an MTA must be created for Neo or CF - only they are not interchangeable in that sense. Your HTML5 app must be reconfigured to use the AppRouter - so it supports user authentication and destinations accordingly. Destinations in CF and Neo are not at all compatible - so you need to perform a lot of changes to your MTA. Besides my blog, have you read the official Migration Guide.

Best Regards,

Ivan

Answers (2)

Answers (2)

Hi, i've the same issue of Alejandro Sensejl, can someone help me about this topic?

thanks in advance,

nadia

former_member628788
Discoverer
0 Kudos

Hi Nadia,

Since I am facing the same problem could you explain how did you solve it?

Thank you very much!

0 Kudos

Hi Alejandro,


I would like to know how you resolved the issue

Thanks