on 02-07-2012 9:11 PM
Hi There
I have an issue with the code of type i_step = 2. What i want to do is to check a table and if a certain value is in that table i want to include a restriction for all values for the caracteristic on which the variable is based.
My code looks like this:
IF zuser_auth-comp_code = '*'.
ls_range-low = '*'.
ls_range-sign = 'I'.
ls_range-opt = 'CP'.
APPEND ls_range to e_t_range.
EXIT.
ENDIF.
THE CP = * restriction is used without problems for i_step = 0 variables but it does not work for i_step = 2. Does anybody know why or know another way to restrict to all values in a i_step = 2 variable exit??
I hope that you can help me.
/Chris
Hello Chris,
i think, you cannot use CP * in the step 2.
What you could try is to fill the e_t_range with all possible values from the master data table of the company in case that the user have the * authorization for the company:
ls_range-low = value_x.
ls_range-sign = 'I'.
ls_range-opt = 'EQ'.
Regards,
Kirill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi There
>
> I have an issue with the code of type i_step = 2. What i want to do is to check a table and if a certain value is in that table i want to include a restriction for all values for the caracteristic on which the variable is based.
>
> My code looks like this:
>
> IF zuser_auth-comp_code = '*'.
> ls_range-low = '*'.
> ls_range-sign = 'I'.
> ls_range-opt = 'CP'.
> APPEND ls_range to e_t_range.
> EXIT.
> ENDIF.
>
> THE CP = * restriction is used without problems for i_step = 0 variables but it does not work for i_step = 2. Does anybody know why or know another way to restrict to all values in a i_step = 2 variable exit??
>
> I hope that you can help me.
>
> /Chris
Hm, I assume you have not populated I_STEP1. Is it? Call takes place directly after variable entry. This step is only started up when the same variable is not input ready and could not be filled at I_STEP=1 & I_STEP = 2 will only be invoked when user has executed the query.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi again
You are right the I_step = 2 is executed after execution of the query. When i debug the exit my exit variable code is executed but the result is that the program ends with an illegal state.Below i have inserted the complete code.
WHEN 'ZCECCST2'. "Authorization check for Company Code
IF i_step = '2'.
READ TABLE i_t_var_range into loc_var_range with key IOBJNM = '0COMP_CODE'.
if sy-subrc <> '0'.
SELECT * FROM ZUSER_AUTH WHERE
username = l_uname.
IF zuser_auth-comp_code = '*'.
SELECT comp_code from /bi0/mcomp_code into ls_range-low.
ls_range-low = '*'.
ls_range-sign = 'I'.
ls_range-opt = 'CP'.
APPEND ls_range to e_t_range.
ENDSELECT.
EXIT.
ELSE.
ls_range-low = zuser_auth-comp_code.
ls_range-sign = 'I'.
ls_range-opt = 'EQ'.
if ls_range-low <> ''.
APPEND ls_range to e_t_range.
endif.
ENDIF.
ENDSELECT.
ELSE.
ls_range-low = loc_var_range-low.
ls_range-sign = 'I'.
ls_range-opt = 'EQ'.
APPEND ls_range to e_t_range.
ENDIF.
endif.
/Chris
Sorry Chris, I could not fully understand the code. I_STEP Executes on: 0 = Authorization / 1 = Before Variable Screen / 2 = After Variable screen. So, you must have 2 variables? /1/ User Input Variable /2/ Customer Exit Variable which will read the first variable. This variable should not be ready for input. I am only thinking what are the consequences now if we use 0.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.