Skip to Content

xs-app.json rewrite not working


I'm deploying an HTML5 app from BAStudio to SCP's Fiori Launchpad using SAP Router (from the wizard, option "Managed by SAP Router") and I'm trying to rewrite a url to a subaccount destination, but it's not working.

My xs-app.json routes are defined like this:

"routes": [
        "source": "^/sap/opu/odata/sap/GBAPP_PRAPPROVAL;mo/(.*)$",
        "target": "/gw/odata/SAP/GBAPP_POAPPROVAL_QAS;v=1/$1",
        "destination": "SCI_SERVICES"
      "source": "^(.*)$",
      "target": "$1",
      "service": "html5-apps-repo-rt",
      "authenticationType": "xsuaa"

When I open the app in Fiori, the browser console shows the following messages:

And the application shows the following message:

The app is the standard purchase order approval application.


app-error.png (17.1 kB)
browser-error.png (48.6 kB)
Add a comment
10|10000 characters needed characters exceeded

  • It looks all right at first. This is the console of the browser and it would be helpful to see the approuter logs but unfortunately, you cannot access the logs of the managed router. I'd recommend trying the xs-app.json in a standalone approuter first to see if the routes are correct. The advantage here is that you can also check out the logs of the approuter to see what it says.

  • Marius, I'm creating a standalone approuter application, but I see 2 xs-app.json files (one in the approuter and one in the app). Which one should I change? The one in the app?

    I'm pretty sure that if I put the rewrite in the approuter file, it will work.

Related questions

1 Answer

  • Best Answer
    Posted on 2 days ago

    For anyone facing this issue, I solved it by migrating the "Managed by SAP Router" to a "Standalone Approuter" app.

    Add a comment
    10|10000 characters needed characters exceeded