This blog explains the use of BI commands to pass variable parameters to a BEx query.

Scenario:

It is quite usual scenario that we will have to open a BEx query from another Web Application Designer report or from any other portal. This will generally be implemented by having a button / URL pointing to the target query.

At times, it is also required that we have to pass the selections made in the landing page to the query so that the output will be filtered according to the values passed.

Solution:

In order to achieve this, we can make use of the standard BI commands. One such command is SET_VARIABLES_STATE. This command is used to set the value of a variable which is used in BEx query.


Consider the following example, where in a query has a single value variable ZVAR_DATE created on InfoObject ZDATE. From the landing page, when the user clicks on the URL of the target query, it should pass the date value selected in the landing page to the above said query.


Below is the BI command which we need to append it to the actual query URL with required <variable name> and <variable value>.


<Generated_URL>&BI_COMMAND_1-BI_COMMAND_TYPE=SET_VARIABLES_STATE&BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE=<variable_name>&BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE=VARIABLE_INPUT_STRING&BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE-VARIABLE_INPUT_STRING=<variable_value>


In our case, we should replace <variable_name> with ZVAR_DATE and <variable_value> with 01.01.2014(or any other required date).


Similarly, it is possible to pass values for multiple variables by appending the query URL with the above command with ‘N’ number of times, where N= number of variable values that needs to be passed.


Thanks for reading this blog 🙂


Appreciate any suggestions/feedbacks!



To report this post you need to login first.

Be the first to leave a comment

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

Leave a Reply