cancel
Showing results for 
Search instead for 
Did you mean: 

How do I configure my UI5 dataSource to work on ABAP server and Web IDE local preview/sandbox?

MikeDoyle
Active Contributor
0 Kudos

At many of my customers I deploy my UI5 apps to Cloud Platform and they run on the portal service. The dataSource property in the manifest.json starts with something like '/destinations/[dest_name]' and in the neo-app.json I declare that the path '/destinations/[dest_name]' maps to a target of type destination.

In this case whether the app runs in the local Web IDE sandbox or deployed as a an html5 app running in the portal service the destination works the same way.

Now what should happen when I deploy from full-stack Web IDE to a Gateway hub? When running on Gateway the neo-app.json is ignored. That server does not know of the destination that I had created. To work on this server my dataSource url must start with the path '/sap/opu/odata/SAP/'.

What I want is for the same code to run in the Web IDE sandbox and on Gateway. I have a work-around, which means declaring a 2nd destination in Cloud Platform, including the path '/sap/opu/odata/SAP/' after the virtual host. Then in the neo-app.json I map that path to the new destination. On Gateway the dataSource path is the usual one but in the Web IDE sandbox it gets mapped to my destination.

This feels like a bit of a cheat to me. I can't use the 2nd destination exclusively because when I come to deploy to Gateway the path will be incorrect. Also, it might not be obvious to another developer what is going on.

So, what should I do? Can I somehow use the localUri property in the dataSource and include the destination there?

Can I create a destination of the same name on the Gateway server so that the full path works there?

What does everyone else do?

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor
0 Kudos

"routes": [
{
"path": "/sap/opu/odata",
"target": {
"type": "destination",
"name": "YOURDESTINATION",
"entryPath": "/sap/opu/odata"
},
"description": "YOURDESTINATION"
},

this is generated by sap, I never need to adjust anything to make it run in web ide or gw.

in manifest, you don't have to mention destination....

MikeDoyle
Active Contributor
0 Kudos

Thanks Jun, that does work for me, and it means I don't need the two destinations. The key thing is the entryPath property. I'm not sure why I didn't get that with the templates I used.

NabiZamani
Contributor
0 Kudos

I do it exactly like jun.wu5, and it has always worked perfectly.

junwu
Active Contributor
0 Kudos

can you accept the answer, if your problem is solved. thanks.

Answers (2)

Answers (2)

MikeDoyle
Active Contributor
0 Kudos

Thanks Zsolt, that KBA confirms that this is the 'official' way to do it

UxKjaer
Product and Topic Expert
Product and Topic Expert
0 Kudos

You need to declare your service with the opu odata path. Then you map that in your neo-app.Json file to the actual path within your destination. If you create one from template you'll see what I mean. We do the same for our component reuse apps.

The neo-app.Json file works on a pattern match, so if you make sure to have that path matched up and tell it where to go. There should be no issues. We have our odata services being consumed both in the testing environment of scp and gateway only one destination is needed.