Skip to Content
Author's profile photo Former Member

Access Application Parameters on SAP Portal page

Hi all, this is my first blog post.

I would try to explain how to set Application Parameters in a web dynpro page and access them in the java code of the application.

I have this scenario: I have two pages that have the same model but two different iView. I want show or not a toolbar depending on the page I am.

After various attempt I found the solution!

Go to the page on the SAP Portal Content:

sap.PNG

Open the page, select the Web Dynpro and select Open:

sap2.PNG

Here go to All properties > Web Dynpro and select Modify Properties:

sap3.PNG

In Application Parameters insert <name_of_the_parameter>=<value_for_the_webdynpro>

Save the properties.

Now you have to repeat these steps for the second page (in my case the pages are Users and Users’ application, where in one case obn=true and in the other case obn=false).

Now I put in the wdDoInit method of the component controller this code:


IWDProtocolAdapter protAd = WDProtocolAdapter.getProtocolAdapter();
String idreq = protAd.getRequestObject().getParameter("obn");
        if (idreq.equals("true"))
            wdContext.currentUtilsElement().setButtonActionVisibility(WDVisibility.VISIBLE);
        else if (idreq.equals("false"))
            wdContext.currentUtilsElement().setButtonActionVisibility(WDVisibility.NONE);

The code sets to visible or not a button in case of which page is open.

See also http://wiki.scn.sap.com/wiki/display/EP/How+To+Test+A+WebDynpro+Java+Application+Outside+The+Enterprise+Portal

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.