Tag Archives: bex variable

“Ready for Input” BEx Variables and MDX

When a front end tool wants to set values for “Ready for Input” BEx Variable via an MDX query, it will use the SAP specific MDX statement: “SAP VARIABLES”.

Here’s the syntax for the SAP VARIABLES clause:

SAP VARIABLES <sap_variables> INCLUDING|EXCLUDING <unique_member_name>


Note: I am working on a project involving OBIEE reporting on top of SAP BW BEx Queries.  OBIEE queries are sent to BW via the MDX query language.

BEx Variables – RRMS_MESSAGE_HANDLING popup disabled when calling RSDRI_INFOPROV_READ in customer exit.

I had this peculiar issue while working on a BEx report where I used FM RRMS_MESSAGE_HANDLING to report errors in the BEx Variable Exit in i_step = 3.

I needed to define the value of a BEx Variable by reading the content of a cube with FM RSDRI_INFOPROV_READ. This worked fine.

However, based on the result I also wanted to generate a popup error message in I_STEP = 3 of the BEx Variable Exit.

This can be achieved by calling FM RRMS_MESSAGE_HANDLING.

When I combined the call to FM RSDRI_INFOPROV_READ with a subsequent call to FM RRMS_MESSAGE_HANDLING, the BEx Variable exit considers that the Variable selection is in error (does not close variable screen, and expexts a new input) BUT, there is no popup message displayed in the user interface.

I had to submit an Incident (formerly Customer Message) in SAPs serivce site to figure out a solution to this. Finally, SAP told me that a call to FM RRMS_MESSAGE_OFF_RESET would solve the problem. This was the case, problem solved.

BEx Workbook – Popup to pass values to Planning Function


Below are the information I gathered regarding techniques to allow some kind of dynamic selection of values to be passed to Planning Functions.

1) See note 1121654 – Note 1121654 – Problems transferring variables to planning func/sequence

2) Extract from a SDN Discussion:
Iin BEx workbook there is no Possibility to call an automatic pop up for variables in planning functions. The functions in BEx Workbook take the entries from cells like described in the notes. If you want to give the user more usability with pop-ups then you have to program VBA coding which writes the entry in the VBA pop up in the cell from which the planning function take the entry and then call the planning function from VBA code
1.) You have your button for the planing function and the command range for the variables. Let’s assume the variable value is in Cell D4. The name of the planning function is BUTTON_34 (you see that in the properties window of the BEX Button. You can implment the command range in the button in an extra sheet and then hide it.

2.) On the sheet with your query or cockpit (from where you want to run the planning function) you implement a second button – but not from the BEx menubar, from the VBA forms. Then you assign a VBA macro to this button.
3.) in this button you have to:
 a.) call a Msgbox for prompt asking for the value of the period
 b.) assign the value entered from the user to CELL D4 in the hidden sheet
 c.) run the planning funtion button in the hidden Sheet

A sample coding could look something like this:

Public sub Call_Funtion()

Dim Useranswer as string

Useranswer = InputBox("Please enter the period in the format MM/YYYY", "Period")

Table1.Range(D4).Value = Useranswer


Application.Run "'" & ThisWorkbook.Name & "'!TABLE1.BUTTON_34_Click

end sub

This should do fine. If you are more experienced in VBA you can design a form with more input fields. It would look more comofortable for the user. But to explain this how to do it would be done in a different board.

See original post: https://scn.sap.com/message/7776844
If you do not have a single value variable but an interval the command range must look like this:

VAR_NAME_3                       1               MY_VAR_SO_TO
VAR_VALUE_LOW_EXT_3     1               04.2003 (Your Start value)
VAR_SIGN_3                         1               I
VAR_OPERATOR_3               1               BT
VAR_VALUE_HIGH_EXT_3     1               06.2003 (Your End value)

In the VBA code you then have to call 2 Propmts for input – one for start, one for end or you design a form if you are experienced. Then you assign the entered values to the ranges and call the buttoon via Application.run.

Limit BEx input variable F4 values via BADI

While running a SAP BW query, sometimes F4 help (Variable input help) returns a long list of unwanted
values. Users may not be interested to see all the returned values and this may confuse users or waste a lot
of time while selecting a right value from the list. There was no way to restrict the input help values before
SAP BI 7.01. With Support Package SAPKW70109 SAP has provided BADI

See the 2 following SCN articles on the subject: