cancel
Showing results for 
Search instead for 
Did you mean: 

Problems getting the ShellHash

tom_parsons
Participant
0 Kudos

Hello all,
I am having problems getting the current shell hash. In principle, I should be able to get want I want using the service sap.ushell.Container.getService("URLParsing"), but I'm encountering difficulties getting the app specific part.

Consider the code;

var oURLService = sap.ushell.Container.getService('URLParsing');
var sShellHash = oURLService.getShellHash(document.URL);
var oShellHash = oURLService.parseShellHash(sShellHash);

If the document URL is "TheThing-theAction?fld=1", oShellHas looks like this;

{ semanticObject: "TheThing",  action: "theAction",  contextRaw: undefined,  params: {fld: ['1']},  appSpecificRoute: undefined}

The fld and '1' can be found in the paramaters

But if the URL is in a standard Fiori form like this;

LeaveRequest-manage&/detail/C81F66DA90A51ED785CA61B693549534

The getShellHash function returns "LeaveRequest-manage" so the parseShellHash obviously does not have the detail.

I could try to get the "/detail/C81F66DA90A51ED785CA61B693549534" by splitting the document.URL, but I'd prefer to use a more standard approach.

Can someone recommend a tidy way of extracting the part after the ampersand?

Accepted Solutions (0)

Answers (0)