Skip to Content
0

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

Oct 19, 2017 at 02:24 PM

49

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Jun Wu Oct 22, 2017 at 02:53 PM
1

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

}

Share
10 |10000 characters needed characters left characters exceeded
Irfan Gokak Oct 19, 2017 at 02:31 PM
1

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"

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

0

Hi Yossi,

Can you please tell why you want to do that?

0