Skip to Content
author's profile photo Former Member
Former Member

How to retrieve current server and UID of the dashboard?

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 28, 2016 at 01:19 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on May 04, 2016 at 08:42 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 28, 2016 at 02:39 PM

    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. Design Studio 1.1: Pass URL parameters between applications

    Regards,

    Swapnil Koti

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.