‎2009 Jan 06 5:25 PM
Dear experts,
Please find the code below.This is text variable customer exit.Can u ple help me to put these multiple loops into one loop.Do u suggest this code is ok?
Appreciate your help.
WHEN 'ZSTXTPE01AA'or 'ZSTXT0FISCPER305AA'or 'ZSTXT0FISCYEAR01AA'
INCLUDE Z_VARIABLES_TEXT
DATA: vtype i,
fisper i,
fisyear i
IF I_STEP=2.
LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0VTYPE01AA'
vtype=LOC_VAR_RANGE-LOW
ENDLOOP.
CLEAR L_S_RANGE.
L_S_RANGE-LOW= vtype.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0FISCPER305AA'
fisper=LOC_VAR_RANGE-LOW
ENDLOOP.
CLEAR L_S_RANGE.
L_S_RANGE-LOW= fisper.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0FISCYEAR01AB'
fisyear=LOC_VAR_RANGE-LOW
ENDLOOP.
CLEAR L_S_RANGE.
L_S_RANGE-LOW= fisyear.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDIF.
Rgds
ACE
‎2009 Jan 06 5:31 PM
Hi,
Use Case endcase inside the loop to check for the name of the vnam and append to the appropriate ranges.
LOOP AT I_T_VAR_RANGE INTO loc_var_range.
case VNAM.
when 'ZS0VTYPE01AA'.
" Your code for ZS0VTYPE01AA
when ''...
endcase.
Endloop.
regards,
Advait
‎2009 Jan 06 6:49 PM
LOOP AT I_T_VAR_RANGE INTO loc_var_range
WHERE VNAM IN('ZS0VTYPE01AA', 'ZS0FISCPER305AA','ZS0FISCYEAR01AB')
vtype=LOC_VAR_RANGE-LOW.
endloop.
L_S_RANGE-LOW= vtype.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
L_S_RANGE-LOW= fisper.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
L_S_RANGE-LOW= fisyear.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
try the above code
also
What u r doing inside ur loop endloop?
‎2009 Jan 07 9:09 AM
Dear Karthik,
Thanks alot.Well am trying to get the text of the base variable(with processing type customer exit) i. e ZS0VTYPE01AA.My text variable is ZSTXTPE01AA.Same case for fisccal period and fiscal year.I have declared Vtype i,fisper i and fisyear i,is this ok?.I will use your approach to make one loop.As you said i will explore about case statement given above.
Thanks
ACE
‎2009 Jan 07 9:48 AM
Hi,
How did you declare L_S_RANGE ?
I can see three different values passed to the L_S_RANGE-LOW but only one append statment and thus it is overwritten and only the third value will be passed to L_S_RANGE-LOW.
I have declared Vtype i,fisper i and fisyear i,is this ok?.
But you have only one range (E_T_RANGE). You need 3 different ranges to handle three different types of values.
So depending on the VNAM, you will pass the low, high, sign and option to the work area and append to its respective range.
regards,
Advait