SAPUI5-从控制器内部访问子帐户ID



我正在从我的控制器访问一个URI,目前已将其硬编码到我当前的SAP Cloud Platform sub-account。

window.open(" https://rsaactionplan-(subaccount).dispatcher.hana.ondemand.com/index.html#/actionplan/" obindingcontext.jobid," _system"

而不是硬编码,我如何访问 current sub-account ID,以便我可以在sapui5 Controller中动态设置sub-Account?

您可以使用租户上下文API访问相关的详细信息。

最好的问候

索拉夫

我对Hybrid Web应用程序的解决方案。

遵循任何odata阅读......

    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 .

然后使用self.subaccount到调用uri中。

最新更新