Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Passing variables to a BEx query dynamically

Hi All,

We have a requirement to pass values for variables dynamically to a Bex 7x query because we do not want to prompt any variable screen to the user. I tried few steps as suggested in SAPBEXsetVariables range but still have some questions unanswered. So request your thoughts on the same.

Below procedure has been followed.

1. Open Bex Analyzer

2. Navigate to Bex Analyzer (menu) -> Design Toolbar -> Insert Button. This will switch on the Design Mode.

3. Click on the button, select "Workbook-Specific Command" and click on next (Data provider need not be worried about at this point as it can be changed later also).

4. Select "Process Variables" and click on Finish.

5. One more window with an heading "Properties of Button" will be shown with fields like "Name of Button", "Range", "Button Text", "Command Range" and few other.

6. On the right side of this window, list of Static Parameters can be created.

7. As an example, i created below parameters

CMD                         0          PROCESS_VARIABLES

DATA_PROVIDER      0          DP_1

and created a range having below details and provided this range in "Command Range" field (in button properties)

VAR_NAME                     0         #NAME1#              

VAR_VALUE_EXT            0          #VALUE#

VAR_NAME_1                 0          #NAME2#

VAR_VALUE_EXT_1         0          #VALUE2#

8. This DID NOT WORK for me. Actually nothing was happening when the button was pressed.

After some investigation, i figured out that i need to have one command like below

CMD                     1      SHOW_VARIABLE_SCREEN

Without this neither the variable screen was shown nor it read the parameter values from the excel range provided.

Once this was done, the input screen was shown and with the values that i provided in my excel range.

Here are my questions. Pls provide your valuable inputs.

1. Why am i forced to have a command for "SHOW_VARIABLE_SCREEN"? Is this mandatory? problem with this is that user will always be shown a input screen which we don't want (in fact the very reason for this exercise is not to show the parameter screen but to supply values to it from the back end). Is there some setting that i need to do to get rid of this?

2. The setup can read values for only  2 parameters. i mean when there is an additional variable, the program is not reading the 3rd parameter values (of course i updated the "command range").

VAR_NAME                     0         #NAME1#              

VAR_VALUE_EXT            0          #VALUE#

VAR_NAME_1                 0          #NAME2#

VAR_VALUE_EXT_1         0          #VALUE2#

VAR_NAME_2                 0          #NAME3#

VAR_VALUE_EXT_2         0          #VALUE3#

Thank you. Looking for a sooner response.

Lohith

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question