‎2007 Dec 30 3:15 PM
hi all,
i write this logic but i get syntax error see my code
select-options carrid for spfli-carrid.
data itab type table of spfli.
select *
from spfli into table spfli where carrid in carrid.
if sy-subrc ne 0.
write / 'no records'.
endif.
plzz help what is the worng in my code it's urgent.
thanks
swapna rani
‎2007 Dec 30 3:17 PM
Hi Swapna,
I think you didn't write tables before select-options see this.
tables spfli.
select-options s_carrid for spfli-carrid.
data itab type table of spfli.
select *
from spfli into table spfli where carrid in s_carrid.
if sy-subrc ne 0.
write / 'no records'.
endif.
Plzz Reward if it is useful,
Mahi.
‎2007 Dec 30 3:48 PM
rani!!
first al data declarations at on place and that too on top.
next take it like this.
Data: d_carrid like splfi-carrid.
select-options carrid for d_carrid.
you wont get any more syntax errors.
Regards
‎2007 Dec 30 4:38 PM
Hi Swapna,
you've declared the table as ITAB, but you r trying top store in spfli which has no existence in the program.
select *
from spfli into table ITAB where carrid in carrid.
Moreover TABLES statement is not a mandatory one. it just creates a work area in the same name of the tablename.
Reward if useful
Regards
ANUPAM
‎2007 Dec 31 8:32 AM
Hi,
I think you have used 'into table spfli' instead of using 'into table itab', and that is the cause of error. Please try the code given below:
TABLES: spfli.
DATA itab TYPE TABLE OF spfli.
SELECT-OPTIONS carrid FOR spfli-carrid.
START-OF-SELECTION.
SELECT *
FROM spfli
INTO CORRESPONDING FIELDS OF TABLE itab
WHERE carrid IN carrid.
IF sy-subrc NE 0.
WRITE / 'no records'.
ENDIF.
Please reward points if it works.
Regards,
Renjith Michael.
‎2007 Dec 31 8:34 AM
tables spfli.
select-options carrid for spfli-carrid.
data itab like table of spfli.
select *
from spfli into table itab where carrid in carrid.
if sy-subrc ne 0.
write / 'no records'.
endif.
Cheers,
Hakim
Mark all useful answerss
Edited by: Abdul Hakim on Dec 31, 2007 3:35 AM