Skip to Content
avatar image
Former Member

How can i tell if my UI5 application is running on SAP or on my local pc

How can i tell if my UI5 application is running on SAP or on my local development environment localhost (tomcat)

when i am in development mode i want my target service urls to be specific

var sServiceUrl = "http://myserver:8010/sap/opu/odata/sap/ZPM_HD_SRV?sap-client=130";

but when from server to ge generic:

var sServiceUrl = "../../../../opu/odata/sap/ZPM_HD_SRV/";

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 22, 2017 at 02:53 PM

    if (window.location.hostname == "localhost") {
    serviceurl= "../proxy" + serviceurl;
    } else {

    }

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 19, 2017 at 02:31 PM

    Hi Yossi,

    On local you can use as

    var sServiceUrl = "proxy/http/myserver:8010/sap..................................;

    on server/launchpad use

    var sServiceUrl = "/sap/opu/odata/sap/ZPM_HD_SRV"

    Add comment
    10|10000 characters needed characters exceeded