cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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/";

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor

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

}

Answers (1)

Answers (1)

irfan_gokak
Contributor

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"

Former Member
0 Kudos

but how can i know in runtime if my code runs now on server or on local?

irfan_gokak
Contributor
0 Kudos

Hi Yossi,

Can you please tell why you want to do that?