cancel
Showing results for 
Search instead for 
Did you mean: 

Change variable value after user executes

Former Member
0 Kudos

Hi all!

I would like to know if it is possible to change a value entered for a variable by the user after they press execute in a BEx workbook. For example if for calendar year/month they do not enter a value, then I would like to enter the current month via an exit (probably ZXRSRU01), but only after they've pressed execute.

Ideally this workbook would be used for broadcasting as well as online execution.

Troy

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Troy,

I guess yes.

Probably with I-STEP = 3, in the same exit.

I havent done this on my own, but have seen someone doing this.

We also need to provide the query UID, if I remember it correct, in addition to variable name.

Naveen.A

Former Member
0 Kudos

Hi Naveen, thanks for your quick reply. But I do not think you can change variable values at I_step = 3. I think you can only validate the values. You get all the variables entered via the input structure I_T_VAR_RANGE, but you don't have an export structure to change the values.

In I_step = 1 and 2, the exit is called for each variable and you can change the values in the export structure E_T_RANGE. Not so with I_step = 3. That step is only called once per execution. And E_T_RANGE has no place for the variable name.

Former Member
0 Kudos

Hi Troy,

If I have understood your requirement correctly, it can achieved using i_step = 2.

You would need to create a customer exit, input ready variable on calmonth.

Populate the variable in ZXRSRU01 exit.

WHEN ' Variable on calmonth'.

IF i_step = 2. * Process variable after user enters a value & executes.

LOOP AT i_t_var_range INTO loc_var_range

WHERE vnam = 'Variable on calmonth'.

ENDLOOP.

IF loc_var_range-low IS INITIAL.

l_s_range-low = 'value you want to assign if user does not input a value'.

ELSE.

l_s_range-low = loc_var_range-low. * If user has entered value pass the same value.

ENDIF.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

APPEND l_s_range TO e_t_range.

ENDIF.

Hope this helps!

Former Member
0 Kudos

Hi Meera,

I believe that i_step = 2 only gets invoked for variables marked as not ready for input. I my case the variable is ready for input, but I still would want to process it at i_step = 2.