2007 Jul 23 2:10 PM
Hi,
Can i use range table in IF logical expression.
Example,
data: r_persk for p0001-persk.
intialization.
r_persk-sign = 'I'.
r_persk-option = 'EQ'.
r_persk-low = 'DU'.
APPEND r_persk.
r_persk-low = 'DS'.
APPEND r_persk.
r_persk-low = 'DT'.
APPEND r_persk.
Start-of-selection.
If p0001-persk in r_persk.
......
.......
.......
endif.
<b>Is the above logic is equal to the logic below</b>
If p0001-persk = 'DU' or p0001-persk = 'DS' or p0001-persk = 'DT'
.....
.....
.....
Endif.
I have checked but both are not giving same results, the first logic is not working.
Kindly help
Regards,
Kasi S
2007 Jul 23 2:14 PM
Hi Kasi,
check this one,
<b>If p0001-persk in ('DU' , 'DS' , 'DT').</b>
2007 Jul 23 2:16 PM
Hi kasi,
1. Minor mistake
2. Ur code only (slightly modified)
Just copy paste.
3.
REPORT ABC.
TABLES : P0001.
<b>RANGES</b> : R_PERSK FOR P0001-PERSK.
INITIALIZATION.
R_PERSK-SIGN = 'I'.
R_PERSK-OPTION = 'EQ'.
R_PERSK-LOW = 'DU'.
APPEND R_PERSK.
R_PERSK-LOW = 'DS'.
APPEND R_PERSK.
R_PERSK-LOW = 'DT'.
APPEND R_PERSK.
START-OF-SELECTION.
P0001-PERSK = 'DU'.
IF P0001-PERSK IN R_PERSK.
WRITE 😕 '1ST IF OK.'.
ENDIF.
<b> If 'DU' IN R_PERSK OR 'DS' IN R_PERSK OR 'DT' IN R_PERSK.</b> WRITE 😕 '2ND IF OK.'.
ENDIF.
regards,
amit m.
2007 Jul 23 2:18 PM
2007 Jul 23 2:25 PM
Hi Rich,
This is the actual condition check,
<b> If i use this method condition is not satisfied</b>
rp-provide-from-last p0001 space begin_date end_date.
IF p0001-persk IN r_persk AND p0007-schkz = 'NORM' AND p0007-empct GE 100 AND p0007-wostd GE '37.5'.
it_emps-wostd = 35.
ELSEIF p0001-persk IN r_persk AND p0007-schkz = 'NORM' AND p0007-empct < 100 AND p0007-wostd < '37.5'.
it_emps-wostd = p0007-wostd * '0.93333'.
ELSE.
it_emps-wostd = p0007-wostd.
ENDIF.
<b>If i use this method the condition is satisfied and logic is working fine</b>
rp-provide-from-last p0001 space begin_date end_date.
IF p0001-persk = 'DU' or p0001-persk = 'DS' or p0001-persk = 'DT' AND p0007-schkz = 'NORM' AND p0007-empct GE 100 AND p0007-wostd GE '37.5'.
it_emps-wostd = 35.
ELSEIF p0001-persk = 'DU' or p0001-persk = 'DS' or p0001-persk = 'DT' AND p0007-schkz = 'NORM' AND p0007-empct < 100 AND p0007-wostd < '37.5'.
it_emps-wostd = p0007-wostd * '0.93333'.
ELSE.
it_emps-wostd = p0007-wostd.
ENDIF.
Regards,
Kasi S