Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

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.       



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.





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.



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=10b40de5e3d849c18fd11736e89...:



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=10b40de5e3d849c18fd11736e89...&X_CITY=DELHI:



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=2247024af21249078b8b42b3c19...&X_CITY=DELHI;CHENNAI :



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=2247024af21249078b8b42b3c19...&X_CITY=DELHI&X_DESC=1000;1800;1900 




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.



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.



3. ON STARTUP:

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



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.



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.



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=2247024af21249078b8b42...&X_CITY=DELHI


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.



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=2247024af21249078b8b42...&X_CITY=DELHI



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=2247024af21249078b8b42... :



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=2247024af21249078b8b42...&X_CITY=DELHI;BANGALORE:



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.



2. ON VARIABLE INITIALISATION:

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



3. ON STARTUP:



4. DATA BINDING:


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.



6. OUTPUT:

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



On appending the global variable and the corresponding date values:


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



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


12 Comments
Labels in this area