2006 Jan 16 7:18 AM
Hello,
I have a problem with multiple selections in an if statment.
The code below is not working. Anyone who knows how to wright it? Can i somehow use () because OR is not working for the same "field".
if p0001-plans ne '99999999'
AND p0000-stat2 EQ '3'
AND p0001-vdsk1 EQ 'IT'
<i> AND p0001-persg EQ '1' <b>or</b>
p0001-persg EQ 'T'
AND p0001-bukrs EQ 'FR46' <b>or</b>
p0001-bukrs EQ 'GB21' <b>or</b>
p0001-bukrs EQ 'PL05' <b>or</b>
p0001-bukrs EQ 'BE06' <b>or</b>
p0001-bukrs EQ 'US22'</i>
endif
/ Claes
2006 Jan 16 7:27 AM
Claes,
Use it like this.
if p0001-plans ne '99999999'
AND p0000-stat2 EQ '3'
AND p0001-vdsk1 EQ 'IT'
AND ( p0001-persg EQ '1' or
p0001-persg EQ 'T' )
AND ( p0001-bukrs EQ 'FR46' or
p0001-bukrs EQ 'GB21' or
p0001-bukrs EQ 'PL05' or
p0001-bukrs EQ 'BE06' or
p0001-bukrs EQ 'US22')
This shuld work.
Regards,
Ravi
Note :Please reward the posts that help you.
Hello,
I have a problem with multiple selections in an if statment.
The code below is not working. Anyone who knows how to wright it? Can i somehow use () because OR is not working for the same "field".
if p0001-plans ne '99999999'
AND p0000-stat2 EQ '3'
AND p0001-vdsk1 EQ 'IT'
<i> AND p0001-persg EQ '1' <b>or</b>
p0001-persg EQ 'T'
AND p0001-bukrs EQ 'FR46' <b>or</b>
p0001-bukrs EQ 'GB21' <b>or</b>
p0001-bukrs EQ 'PL05' <b>or</b>
p0001-bukrs EQ 'BE06' <b>or</b>
p0001-bukrs EQ 'US22'</i>
endif
/ Claes
2006 Jan 16 7:27 AM
Claes,
Use it like this.
if p0001-plans ne '99999999'
AND p0000-stat2 EQ '3'
AND p0001-vdsk1 EQ 'IT'
AND ( p0001-persg EQ '1' or
p0001-persg EQ 'T' )
AND ( p0001-bukrs EQ 'FR46' or
p0001-bukrs EQ 'GB21' or
p0001-bukrs EQ 'PL05' or
p0001-bukrs EQ 'BE06' or
p0001-bukrs EQ 'US22')
This shuld work.
Regards,
Ravi
Note :Please reward the posts that help you.
2006 Jan 16 7:28 AM
Try followings.
> if p0001-plans ne '99999999'
> AND p0000-stat2 EQ '3'
> AND p0001-vdsk1 EQ 'IT'
> AND ( p0001-persg EQ '1' or
> p0001-persg EQ 'T' )
> AND ( p0001-bukrs EQ 'FR46' or
> p0001-bukrs EQ 'GB21' or
> p0001-bukrs EQ 'PL05' or
> p0001-bukrs EQ 'BE06' or
> p0001-bukrs EQ 'US22' )
> endif
>
Good Luck..
2006 Jan 16 7:29 AM
Hi,
try that:
IF p0001-plans NE '99999999'
AND p0000-stat2 EQ '3'
AND p0001-vdsk1 EQ 'IT'
AND ( p0001-persg EQ '1' OR
p0001-persg EQ 'T' )
AND ( p0001-bukrs EQ 'FR46' OR
p0001-bukrs EQ 'GB21' OR
p0001-bukrs EQ 'PL05' OR
p0001-bukrs EQ 'BE06' OR
p0001-bukrs EQ 'US22' ).
ENDIF .Andreas
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |