05-10-2013 5:16 PM
Hello,
I am having trouble using the WHERE clause with 'IN' and 'select-option'.
I have a select-option with intervals, but when I executed the program it says that the operator is followed neither by an internal table nor by a value list.
Here's what I have:
SELECT-OPTIONS f_number FOR SFLIGHT-CONNID.
SELECT * INTO i_tab FROM SFLIGHT
WHERE CONNID IN f_number.
Thank you in advance.
05-10-2013 11:32 PM
Hi Rafael,
You need to have the select option interval declared locally and the easiest way to do this would be to use the tables statement i.e.
TABLES sflight.
SELECT-OPTIONS f_number FOR sflight-connid.
That should then stop the syntax error...
If your i_tab is an internal table then you'd need to alter your select statement to:
SELECT * INTO TABLE i_tab FROM sflight
WHERE connid IN f_number.
05-11-2013 6:29 PM
05-11-2013 3:10 AM
Hi Rafael,
This error occurred as you are fetching multiple rows in your select query, thus you are passing table I_ITAB but you are not supporting it with TABLE keyword. Please change the select query INTO clause to ''INTO TABLE ITAB''.
This should solve your problem.
Please revert if still any issue.
Regards,
DN.
05-11-2013 6:24 AM
Hi,
SELECT-OPTIONS f_number FOR SFLIGHT-CONNID.
SELECT * INTO i_tab FROM SFLIGHT
WHERE CONNID IN f_number.
The answered has been mentioned above that 'INTO' should be replaced with 'INTO TABLE' but I would like to add a point to it.
Please check the line of error. When you try to execute, it will give the error in the second line and you have asked query on the third line.
Regards
Purnand
05-11-2013 7:16 AM
This has already been answered above. However, the below code will resolve your issue.
--------------------------------------------------------
TABLES: sflight.
DATA: i_tab TYPE STANDARD TABLE OF sflight.
SELECT-OPTIONS f_number FOR sflight-connid.
SELECT * INTO TABLE i_tab FROM sflight
WHERE connid IN f_number.
--------------------------------------------------------
-Satya
05-11-2013 7:37 AM
Hi Rafael,
Keyword INTO TABLE is missing.......make the changes and it will work fine.........
regards,
narayan
05-13-2013 5:37 AM
05-13-2013 9:42 AM
Hi,
Change your select query as below:
SELECT * INTO TABLE i_tab FROM SFLIGHT
WHERE CONNID IN f_number.
05-13-2013 7:13 PM