‎2008 Jun 03 7:11 PM
tables: sbook,spfli.
data: begin of itab occurs 0 ,
carrid like sbook-carrid,
connid like sbook-connid,
fldate like sbook-carrid,
bookid like sbook-bookid,
carrid1 like spfli-carrid,
connid1 like spfli-connid,
cityfrom like spfli-cityfrom,
countryfr like spfli-countryfr,
distance like spfli-distance,
end of itab.
parameter: a like sbook-carrid.
select connid fldate bookid from sbook into table itab where
carrid = 'a'.
loop at itab.
write: / itab-connid.
endloop.
on executing i am getting error. please help me.
‎2008 Jun 03 7:13 PM
No Quotes for variables
select connid fldate bookid from sbook into table itab where
carrid = a.
‎2008 Jun 03 7:15 PM
‎2008 Jun 03 7:15 PM
Hi,
Change the sequence of the fields mentioned in the select statement, it should match the internal table declaration..Or change the internal table declaration according to the field selection.
select carrid connid fldate bookid from sbook
Thanks
Naren
‎2008 Jun 03 7:15 PM
Hi,
This is probably of a structure mismatch. Make use of 'Corresponding' fields --> into corresponding fields of table itab and then check it out.
Thanks.
‎2008 Jun 03 7:16 PM
Hi,
you need to add : Corresponding Fields Of
select connid fldate bookid from sbook into corresponding fields of table itab where
carrid = 'a'.
Regards
Sandeep Reddy
‎2008 Jun 03 7:19 PM
here you go
TABLES: sbook,spfli.
DATA:
BEGIN OF itab OCCURS 0 ,
carrid LIKE sbook-carrid,
connid LIKE sbook-connid,
fldate LIKE sbook-fldate, " This changed
bookid LIKE sbook-bookid,
carrid1 LIKE spfli-carrid,
connid1 LIKE spfli-connid,
cityfrom LIKE spfli-cityfrom,
countryfr LIKE spfli-countryfr,
distance LIKE spfli-distance,
END OF itab.
PARAMETER: a LIKE sbook-carrid.
SELECT connid fldate bookid " Select was rewritten because you were selecting fields that were not in position 1 and 2 of the itab
INTO CORRESPONDING FIELDS OF TABLE itab
FROM sbook
WHERE carrid = a.
LOOP AT itab.
WRITE: / itab-connid.
ENDLOOP.
‎2008 Jun 03 7:34 PM
HI
u r writing mistake in select statement
just check this once
u need to check the condition based on the parameters value not the feild value .
tables : sbook.
data : begin of it_itab occurs 0,
carrid like sbook-carrid,
connid like sbook-connid,
fldate like sbook-fldate,
bookid like sbook-bookid,
end of it_itab.
parameters : p_carrid like sbook-carrid.
select carrid connid fldate bookid from sbook into table it_itab where carrid = p_carrid.
loop at it_itab.
write 😕 it_itab-carrid,
it_itab-connid.
endloop.