on 03-05-2019 3:38 PM
I'm accessing a URI from my controller which at the moment is hardcoded to my current SAP Cloud Platform Sub-Account.
window.open("https://rsaactionplan-%28subaccount%29.dispatcher.hana.ondemand.com/index.html#/actionplan/">rsaactionplan-(subaccount).dispatcher.hana.ondemand.com/index.html#/actionplan/" + oBindingContext.JobId, "_system");
Rather than hard-code it, how can I access the current sub-account ID so I can dynamically setup the sub-account in the SAPUI5 controller?
Solution for Moble + Web app..
Following ANY oData call.....
var uriStr;
if (typeof sap.hybrid !== 'undefined') {
uriStr = oUserData.__metadata.uri;
}
else{
uriStr = window.location.href;
}
var split1 = uriStr.split("-"); // split by -
var secondSubString = split1[1]; // all characters AFTER the first -
var split2 = secondSubString.split("."); // split by .
self.subAccount = split2[0]; // all characters BEFORE the first .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Adam,
take a look at HashChanger.
It seems to me, that you just want to change the Hash.
If you want to have more control over the whole url, you can get it with window.location.href.
Best regards,
Christian.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.