cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrieve current server and UID of the dashboard?

Former Member
0 Kudos

Hi,

our goal is, to have a dashboard, that can be called with different URL Parameters for selection and navigation state.

All the startup scripting is doing fine.

We also want to provide a functionality within the dashboard to create the correct URL (with parameters) for the current selection of the user.

For several reasons the bookmark functionality in DS 1.5 is not working sufficient for us.

Is there a way to retrieve the current server for creating the URL, like

https://<server>/BOE/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID


Furthermore I would need the UID of the dashboard.

APPLICATION.getInfo() only deliveres the name, but not the UID.

Each example I found (e.g. http://scn.sap.com/thread/3813702) is working with fixed URL strings.

Background for this requirement:

We have a 2 system landscape. Changing the URL string after promoting to productive system is not an option.

From time to time we use a copy of the dashboard for testing and further development.

Working with the UID of the current dashboard (version) would be great. This way we would not 'forget' to change the UID within the URL string.

SDK components are not welcome at the moment. There are some restrictions within the company...

Any hints, ideas and comments are welcome.

If more explanations are needed, just ask.

Regards

Steve

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Steve,

maybe this short piece of code can help you:

var S_LV_BOOKMARK = Bookmark.saveBookmark("URL");

S_GV_011__LOCALSERVER = Bookmark.getBookmarkUrl(S_LV_BOOKMARK).substring(7,19);

S_GV_012__DOCID = Bookmark.getBookmarkUrl(S_LV_BOOKMARK).substring(100,123);

Bookmark.deleteBookmark(S_LV_BOOKMARK);

Regards,

Balint

Former Member
0 Kudos

Hi,

thanks for this piece of code.

I will test and come back to you.

Regards

Steve

Former Member
0 Kudos

Hi again,

I did some small changes to your coding:

// create bookmark

var S_LV_BOOKMARK = Bookmark.saveBookmark("URL");

// 'BOE' should be after the server part of the URL

var lv_BOE = Bookmark.getBookmarkUrl(S_LV_BOOKMARK).indexOf("/BOE/");

var lv_SERVER = Bookmark.getBookmarkUrl(S_LV_BOOKMARK).substring(0,lv_BOE);

// after 'DocID' the CUID starts

var lv_iDOC = Bookmark.getBookmarkUrl(S_LV_BOOKMARK).indexOf("DocID");

// this is after the CUID for bookmarks

var lv_iBOOK = Bookmark.getBookmarkUrl(S_LV_BOOKMARK).indexOf("&BOOKMARK");

var lv_DOCID = Bookmark.getBookmarkUrl(S_LV_BOOKMARK).substring(lv_iDOC+6,lv_iBOOK);

// delete the bookmark again

Bookmark.deleteBookmark(S_LV_BOOKMARK);

This is working perfectly for me.

Thank you very much!

Regards

Steve

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Steve,

When opening an application from another you can just use the following syntax.

APPLICATION.openNewWindow("/BOE/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=<CUID_of_the_application_to_be_opened>);

The server name should be added automatically and so, when you promote to the Production system, it should then take the production system server name.

Also, the CUID should remain the same when you promote any application from one system to another. That way, even if you had hard coded the CUID in the URL it will still open the correct application on the same system as long as the target application is available.

We have used the above two methods in many applications and everything works without any issue. If the above two aren't working then you should probably get in touch with your BOE admin to check for changes in settings on the servers.

About passing the parameters from one application to another, you can do that too. Please take a look at this tutorial.

Regards,

Swapnil Koti

Former Member
0 Kudos

Hi,

unfortunately we cannot use the .openNewWindow function.

The goal is to provide a link like displayed in the following picture.

Regards

Steve

Former Member
0 Kudos

Hi Steve,

A solution to this, as there isn't one currently with SAP delivered functions is to create a table somewhere which will hold the values of the server name and uid or the whole link to the dashboard. And this will be read via a new DataSource. So when development needs to be done, you just update the table. You can be smart about it hold the two full links and filter the returned values on the name of the iDOC which is unique per dashboard.

Regards,

Bogdan