cancel
Showing results for 
Search instead for 
Did you mean: 

Question on sap.ushell - sap.ushell.Container is undefined

Former Member

Hy everybody,

i'm currently trying to navigate to another fiori application. I would like to use CrossApplicationNavigation Service of sap.ushell.Container. The navigation should be triggerd by a button press in the application.

Now i would like to describe my problem:

In the press="" function of the button (Marked green in the printscreen), i only have sap.ui and sap.m object available.

If i enter this variable (sap) in the console, when the app is loaded, the console shows that ushell_abap, fiori, and ushell are available.

At the moment i don't understand, why the variable sap is different in the press="" method of the button. In the press="" function onNavigateToNextApp, sap.ushell.Container is undefined and i do not realy get why.

This is the printscreen of the chrome console.

If somebody could give me a hint or a tip how to it comes that sap differs in these two spots i would really apreciate that.

Help will be rewarded with points.

Best regards,

Michael

Accepted Solutions (0)

Answers (9)

Answers (9)

0 Kudos

Hi,

you also can get all the system information (user Id, fullname, system, ...) from the config.

sap.ui.require([ 
	'sap/ushell_abap/bootstrap/abap'
], function () {
	var sysinfo = window["sap-ushell-config"].services.Container.adapter.config;
	console.log(sysinfo.id);
});

Regards,

Mario

Former Member
0 Kudos

var oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");

var hash = oCrossAppNavigator.hrefForExternal({

  target: {

  semanticObject: "Product",

  action: "displayprice&/detail/"+ orderDetail.Kunwe +"/1/1/X/"+ orderLine.Matnr

  }

  });

var url = window.location.href.split('#')[0] + hash;

  sap.m.URLHelper.redirect(url, true);

Former Member
0 Kudos

Hi Marc,

'sap.ushell.Container' is active only in Fiori Launchpad

But , when ı use navigation service, ı noticed that the data is not cached and when back again  , views are re-installed.

At the code below ,  I  called the application on a new tab at browser

Former Member
0 Kudos

Hi Marc,

'sap.ushell.Container' is active only in Fiori Launchpad

But , when ı use navigation service, ı noticed that the data is not cached and when back again  , views are re-installed.

At the code below ,  I  called the application on a new tab at browser

Former Member
0 Kudos

Hi,

    <script src="resources/sap/ushell_abap/bootstrap/abap.js"></script>

     <script src="resources/sap-ui-core.js"

             id="sap-ui-bootstrap"

             data-sap-ui-libs="sap.m,sap.ushell,sap.ui.layout,sap.ui.commons"

             data-sap-ui-xx-bindingsyntax="complex"

             data-sap-ui-theme="sap_bluecrystal"></script>

//-------------------------------------------------------------------------------------------------------------------------------

var navigationService = sap.ushell.Container.getService("CrossApplicationNavigation");

           navigationService.toExternal({

                                target : { semanticObject : "ZSO_ODATA", action: "display" }

                             });

Former Member
0 Kudos
Former Member
0 Kudos

This document points to the same code he already has, that leads to the problem he (and myslef) have.

sap.ushell doesn't present to have the .Container method..

how can we get it solved?

We do had included the sap.ushell on the index.html..

0 Kudos

Hi Marc,

I am facing the same issue. How was your issue solved?

I see 'sap.ushell.Container' as undefined.

Thanks

former_member189945
Contributor
0 Kudos

Hi Michael,

Sorry to bring this topic up but I'm having the same problem with cross app navigation between custom SAPUI5 apps on Fiori Launchpad.

Did you solve the problem? If yes, how?

EDIT

OK, I found the reason:

Additional information in pld_cust Launchpad Application was incorrect and thus the application was loaded into an iframe. This resulted in sap. js namespace containing only Component's dependency libraries.

Console logs contained this line:

"Not resolved as "SAPUI5.Component=" or "SAPUI5=" , will attempt to load into iframe"

Best regards,

Kimmo

Former Member
0 Kudos

Hi Michael,

Please refer following link:

JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.ushell

You need to initializes the Unified Shell container. Add following statement before your bootstrap.


<script src="/sap/public/bc/ui5_ui5/resources/sap/ushell_abap/bootstrap/abap.js"></script>


Regards,

Vikram

Former Member
0 Kudos

If I past it just before  the following code ,  bootstrap

"(paste the code just here)"

<script

  id="sap-ui-bootstrap"

  src="resources/sap-ui-core.js"

  data-sap-ui-theme="sap_bluecrystal"

  data-sap-ui-libs="sap.m, sap.ui.layout, sap.ushell"

  data-sap-ui-xx-bindingSyntax="complex"

  data-sap-ui-resourceroots='{ "sap.ui.demo.ProjectName": "./" }' >

  </script>

the app don't even runs..

What are I(we) missing?

SandipAgarwalla
Active Contributor

Hello

Did you ever find a solution to this?

I am developing a custom UI5 App and need the CrossAppNav functionality. The app is not deployed on Launchpad.

While I add abap.js, the application simply does not run - otherwise it runs fine.

Thanks

Sandip

former_member182372
Active Contributor
0 Kudos

jQuery.sap.require("sap.ushell.Container"); ??

Former Member
0 Kudos

Hi,

I also tried your solution but the response is

Uncaught Error: failed to load 'sap/ushell/Container.js' from resources/sap/ushell/Container.js: 404 - NOT FOUND

Any more clue?