‎2008 May 03 1:37 PM
Hi all there.
I am writing the
if vbfa_tab-vbtyp_n = 'M' OR 'R' OR '8' OR 'A'.
..........
.....
giving error in OR
pl suggest
Regards
Shashi
‎2008 May 03 1:56 PM
Hi
Whats the error.
Anyway by looking at your code , it is in wrong syntax.
Try this.
if vbfa_tab-vbtyp_n = 'M' or if vbfa_tab-vbtyp_n = 'R' OR if vbfa_tab-vbtyp_n = '8 '.
Reward points if helpful
Regards,
Raghu
‎2008 May 03 1:56 PM
do a
case vbfa_tab-vbtyp_n.
when 'M' OR 'R' OR '8' OR 'A'.
....
endcase.
‎2008 May 03 2:01 PM
hi sashi !
write like this..,
if vbfa_tab-vbtyp_n = 'M' OR
vbfa_tab-vbtyp_n = 'R' OR
vbfa_tab-vbtyp_n = '8' OR
vbfa_tab-vbtyp_n = 'A'.
or
if this does'nt work out.
then go for elseif
if vbfa_tab-vbtyp_n = 'M' .
.......
.......
elseif vbfa_tab-vbtyp_n = 'R'.
.......
.......
elseif vbfa_tab-vbtyp_n = '8'.
.......
.......
elseif vbfa_tab-vbtyp_n = 'A'.
.......
.......
endif.
if this works ...
rewrd me..!
Thanks & regards,
Rajesh.,
‎2008 May 03 2:08 PM
Hi shashikanth,
Ur If statement is syntactically wrong. Replace it like below.
IF ( vbfa_tab-vbtyp_n = 'M'
OR vbfa_tab-vbtyp_n = 'R'
OR vbfa_tab-vbtyp_n = '8'
OR vbfa_tab-vbtyp_n = 'A' ).
do some thing.
ENDIF.
Also If u have if elseif elseif else endif. then replace it with case statement.
eg: If u have like below.
IF ( vbfa_tab-vbtyp_n = 'M'
OR vbfa_tab-vbtyp_n = 'R'
OR vbfa_tab-vbtyp_n = '8'
OR vbfa_tab-vbtyp_n = 'A' ).
do some thing.
ELSEIF ( vbfa_tab-vbtyp_n = 'X'
OR vbfa_tab-vbtyp_n = 'Y'
OR vbfa_tab-vbtyp_n = 'Z' ).
do some thing
ELSEIF (vbfa_tab-vbtyp_n = 'C'
OR vbfa_tab-vbtyp_n = 'D'
OR vbfa_tab-vbtyp_n = 'E' )
Do some thing
ELSE.
Do some thing
ENDIF.
Above code can be replaced by CASE statement like below.
Case vbfa-vbtyp_n.
WHEN 'M' OR 'R' OR '8' OR 'A'.
Do some thing.
WHEN 'X' OR 'Y' OR 'Z'.
Do some thing.
WHEN 'C' OR 'D' OR 'E'.
Do some thing.
WHEN OTHERS.
Do some thing.
ENDCASE.
Thanks,
Vinod.