With this API method, you can define values for input-ready BW variables (prompts). If you want to set multiple variables, you can use the PauseVariableSubmit command with the SAPExecuteCommand method.
To call the method, use Application.Run and specify the following input parameters:
Name or technical name of the BW variable to be filtered.
String that represents the value for the prompt, for example the key. Note the syntax rules for entering values.
Single member as text.
Single member as key.
Single member with its internal key.
Complex selection of members.
Returns the input string as string as array.
Single member with its internal key.
With this value format, no immediate validation with the back-end system is executed. This improves the performance.
This format is only valid if you set the prompt value with its internal key and you use the syntax rule Equal To.
If the entered member is not valid, a message is displayed.
Enter the formula alias for the data source. You can set the alias when configuring the data source on the Components tab in the design panel.
You have to define this parameter if the variables in the workbook are not merged. If the variables in the workbook are merged, you can define this parameter but you do not have to define it.
Dim lResult As Long
lResult=Application.Run("SAPSetVariable", "0BWVC_COUNTRY", "DE", "INPUT_STRING", "DS_1")
With this example, you set the variable 0BWVC_COUNTRY in data source DS_1 to country Germany.
Call Application.Run("SAPSetRefreshBehaviour", "Off") Call Application.Run("SAPExecuteCommand", "PauseVariableSubmit", "On") Call Application.Run("SAPSetVariable", "0BWVC_COUNTRY", "US") Call Application.Run("SAPSetVariable", "0BWVC_MATERIAL", "Hardware") Call Application.Run("SAPExecuteCommand", "PauseVariableSubmit", "Off") Call Application.Run("SAPSetRefreshBehaviour", "On")