Skip to Content

REQUIREMENT STATEMENT:

This document is aimed at explaining how to pass parameter as part of URL in SAP Design Studio 1.5 and in its preceeding versions. Going through some of the threads, I can see lots of people faced and facing the same issue, so here, I have tried to figure it out and consolidate it for different scenario possible, for which we can pass parameters as part of the URL.

INSTRUCTIONS:

When you make a new the Design Studio application, select the application name button on the Outline Tab on the left pane under Components Tab. The corresponding Properties Tab on the right side now will reflect various properties options, discussed in this document for all the scenarios. We will mainly be using the ‘Global Script Variable’ under Scripting section and ‘On Variable Initialization’ & ‘On Startup’ under Events section from this property tab.

SCENARIO 1:


PASSING PARAMETERS AS PART OF URL FOR OPEN/ LOCAL DOCUMENTS IN SAP DESIGN STUDIO:


1. ON GLOBAL SCRIPT:

From the properties tab of your application, under scripting tab, select Global Script Variables. Define the global variables. You can also give the optional default value which will be passed as a default parameter when you do not pass parameter as part of your URL.       


1a.PNG


2. ON VARIABLE INITIALISATION:

From the properties tab of your application, under events tab, select On Variable Initialisation. Filter is applied on the Data Source and not on the application. If content assistance (Ctrl + Space) is not working, you can try the same code on “On Startup” and can copy it from there. If running it on HANA Mode, unfortunately setFilterExt() function is not yet supported in Design Studio 1.3, hence it is suggested to use it in local and in SAP BusinessObjects BI Platform only.



1b.PNG



3. ON STARTUP:

From the properties tab of your application, under events tab, select ‘On Startup’. Use the function reloadData() instead of the loadDataSource(). reloadData() will be more helpful when you have prompts at application start up. loadDataSource() will also might work for this particular scenario.


1c.PNG


4. ORIGINAL DATASET (OUTPUT W/O PARAMETERS AS PART OF URL):

If any global variable is assigned a default value, it will be reflected on the output.


http://localhost:61878/aad/web.do?APPLICATION=TEST_URL&designersessionid=10b40de5e3d849c18fd11736e8988ba4:


1d.PNG


5. OUTPUTS WITH PARAMETERS AS PART OF THE URL:

So, to pass the parameters as part of the URL, you will have to manually append the global variables created to the URL of the output and pass the required values to those global variables.


http://localhost:61878/aad/web.do?APPLICATION=TEST_URL&designersessionid=10b40de5e3d849c18fd11736e8988ba4&X_CITY=DELHI:


1e.PNG


You can also pass multiple parameters to a variable by separating it with a semi-colon “;” as shown below:

http://localhost:55341/aad/web.do?APPLICATION=TEST_URL&designersessionid=2247024af21249078b8b42b3c199ea5e&X_CITY=DELHI;CHENNAI :


1F.PNG


Also, you can pass multiple parameters to multiple variables too, separating it with “&” (though it will only return you a common data set and not the union of the dataset)


http://localhost:55341/aad/web.do?APPLICATION=TEST_URL&designersessionid=2247024af21249078b8b42b3c199ea5e&X_CITY=DELHI&X_DESC=1000;1800;1900 


1g.PNG



SCENARIO 2:


PASSING PARAMETERS AS PART OF URL FOR DOCUMENTS WITH VARIABLE PROMPT (IN HANA):


1. ON GLOBAL SCRIPT:

Similar to the first scenario, set the global variable which you want to pass in the URL.


2A.PNG


2. ON VARIABLE INITIALISATION:

As can be seen below, for this scenario the variable value is set on the application rather than settling it on the data source.


2B.PNG


3. ON STARTUP:

As discussed in the first scenario, use reloadData() function on data source.


2C.PNG


4. DATA BINDING:

Select ‘Data Binding’ tab from the properties tab of the Data Source. Make sure Load in Script is set as ‘false’ which is usually by default.


2D.PNG


5. PROMPTS:

Again from the properties tab of your application, under prompts tab, select ‘Force Prompts on Startup’. On running the application with a variable prompt (in HANA), you will get a prompt screen for which you will need to select the required values from the list.


2E.PNG


Though on passing the parameters as part of URL, you will not be requiring to make the selection manually but still will be getting the prompt screen as can be seen below:


http://localhost:55341/aad/web.do?APPLICATION=TEST_VARIABLE&designersessionid=2247024af21249078b8b42b3c199ea5e&X_CITY=DELHI


2F.PNG

You can suppress this prompt screen by setting Force Prompts on Startup on the Properties tab of the Application as False. You can also suppress the prompt screens even for mandatory variables.


2E.PNG


The prompt screen now will not pop up for the variable selection screen and gives us the required output below:


http://localhost:55341/aad/web.do?APPLICATION=TEST_VARIABLE&designersessionid=2247024af21249078b8b42b3c199ea5e&X_CITY=DELHI


2G.PNG


6. OUTPUTS:

The default output will still be asking for a prompt as the global variable is still not appended to it and will give you the prompt screen rather than the output.


http://localhost:55341/aad/web.do?APPLICATION=TEST_VARIABLE&designersessionid=2247024af21249078b8b42b3c199ea5e :


2E.PNG


So, append the global variable and the pass the corresponding values to the global variable on the URL of the output obtained as shown in the link below :


http://localhost:55341/aad/web.do?APPLICATION=TEST_VARIABLE&designersessionid=2247024af21249078b8b42b3c199ea5e&X_CITY=DELHI;BANGALORE:


2D.PNG


SCENARIO 3:


PASSING PARAMETERS AS PART OF URL FOR DOCUMENTS WITH INPUT PARAMETER PROMPT (IN HANA):


1. ON GLOBAL SCRIPT:

Similar to scenarios discussed above, set the global variable for the input parameter prompts which in this case are the dates for which the data records are returned.


3a.PNG


2. ON VARIABLE INITIALISATION:

Similar to the variable prompt scenario, set the variable value on the application and not on the data source.


3D.PNG


3. ON STARTUP:


3C.PNG


4. DATA BINDING:

2D.PNG


5. PROMPTS:

Similar to Variable prompt scenario, you can suppress the input parameter prompt screen on the output of the application but setting Force Prompts on startup as False on the properties tab of the application.


2E.PNG


6. OUTPUT:

http://localhost:55341/aad/web.do?APPLICATION=TEST_INPUT_PARAMETER&designersessionid=2247024af21249078b8b42b3c199ea5e:


3b.PNG


On appending the global variable and the corresponding date values:


http://localhost:55341/aad/web.do?APPLICATION=TEST_INPUT_PARAMETER&designersessionid=2247024af21249078b8b42b3c199ea5e&X_FROMDATE=2013-01-01&X_TODATE=2014-09-01:


3G.PNG


http://localhost:55341/aad/web.do?APPLICATION=TEST_INPUT_PARAMETER&designersessionid=2247024af21249078b8b42b3c199ea5e&X_FROMDATE=2011-01-01&X_TODATE=2014-12-01:


3H.PNG

To report this post you need to login first.

11 Comments

You must be Logged on to comment or reply to a post.

    1. Arpit Shivhare Post author

      Hi Arjun,

      I went through the thread and as suggested by Karol APPLICATION.setVariableValueExt() and even Datasource.setVariableValueExt() should be working fine in your case, both in DS 1.4 and in DS 1.5.

      Before you proceed with the customer incident, just wanted to know did you try passing values via default value during the global variable assignment? Using global variable will enable you to pass the value as a string and not worry about single or double quotes.

      Hope this helps. Give it a try and do let me know. 🙂

      (0) 
  1. Senthilkumar VP

    How to add the same for Netweaver and Business Intelligence Platform Mode. Local Mode something for testing Purpose will be useful.

    For enterprise reporting How can we add this for Netweaver and BIP ?

    (0) 
  2. Afzal Kar

    Hello All,

    Can we use same logic with BeX as backend and DS 1.6 version. My requirement is same. I tried all these steps but doesn’t get required target dropdown as pop pup as is shown in the snaps.

    (0) 
    1. Jens Heger

      Hi Ankita Gupta,

      you can pass several variables in a url bei seperating them by “&”.

      You can pass several parameters in one variable bei seperating them by “;”.

      Eg:
      ….&X_CITY=BERLIN;DELHI;SYDNEY&X_DATE=20171103

      Regards,

      Jens

      (0) 

Leave a Reply