2007 Jun 14 7:02 AM
Hi all,
i wrote a statement as below.
LOOP AT itab_vkorg.
if itab_vkorg-vkorg IN ( 'ARO','SRO','WRO','NRO','ERO','SROB' ).
endif.
endloop.
But its giving error -- >Comma without preceding colon (after IF ?).
Can anyone tell whats the correct suntax for this.
Thanks in advance
Nitin
2007 Jun 14 7:04 AM
Hi,
You cannot use IN operator for the IF statement..Instead
Create a ranges and then use otherwise use OR condition..
IF ITAB_VKORG-VKORG = 'ARO' OR
ITAB_VKORG-VKORG = 'SRO' OR
ITAB_VKORG-VKORG = 'WRO' OR
ITAB_VKORG-VKORG = 'NRO' OR
ITAB_VKORG-VKORG = 'ERO' OR
ITAB_VKORG-VKORG ='SROB'.
ENDIF.
Thanks
Naren
Hi all,
i wrote a statement as below.
LOOP AT itab_vkorg.
if itab_vkorg-vkorg IN ( 'ARO','SRO','WRO','NRO','ERO','SROB' ).
endif.
endloop.
But its giving error -- >Comma without preceding colon (after IF ?).
Can anyone tell whats the correct suntax for this.
Thanks in advance
Nitin
2007 Jun 14 7:04 AM
Hi,
You cannot use IN operator for the IF statement..Instead
Create a ranges and then use otherwise use OR condition..
IF ITAB_VKORG-VKORG = 'ARO' OR
ITAB_VKORG-VKORG = 'SRO' OR
ITAB_VKORG-VKORG = 'WRO' OR
ITAB_VKORG-VKORG = 'NRO' OR
ITAB_VKORG-VKORG = 'ERO' OR
ITAB_VKORG-VKORG ='SROB'.
ENDIF.
Thanks
Naren
2007 Jun 14 7:07 AM
Hi Naren
Thanks a lot......In WHERE condition only we can use the IN stmt..right.
Anyway thank u very much
Nitin
2007 Jun 14 7:06 AM
data: itab like LFA1 OCCURS 0 with header line.
select * from LFA1 into table ITAB up to 3 rows.
loop at itab.
if itab-LIFNR = 'AB45'
OR ITAB-LIFNR = 'AB46'
OR ITAB-LIFNR = 'AB47'.
ENDIF.
endloop.
Try this
regards,
venkatesh
2007 Jun 14 7:08 AM
Hi,
Yes..If you are giving fixed values in the IN...
Thanks
Naren
2007 Jun 14 7:10 AM
Hi
Use IN paramter for a Range or select-options or in Where condn of select statement
Better put all these values 'ARO','SRO','WRO','NRO','ERO','SROB' in Ranges table and use the statement
if itab_vkorg-vkorg IN r_vkorg
endif.
Reward points for useful Answers
Regards
Anji
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |