‎2007 Oct 29 4:43 AM
HI,
i have such code tht not fetching data why?
tables: mara.
types: begin of itab occurs 0,
matnr type mara-matnr,
end of itab.
data: itab1 type standard table of itab with header line.
select matnr from mara into itab1.
write: / itab1-matnr.
this code has right syntex but not fetching data from database.?
please provide me most comfortable solution with all possiblities
thanks
rahul
‎2007 Oct 29 4:44 AM
Hi,
tables: mara.
types: begin of itab,
matnr type mara-matnr,
end of itab.
data: itab1 type standard table of itab with header line.
<b>select matnr from mara into itab1.
write: / itab1-matnr.
endselect.</b>
(or)
<b>select matnr from mara into TABLE itab1.
loop at itab1.
write: / itab1-matnr.
endloop.</b>
rgds,
bharat.
‎2007 Oct 29 4:46 AM
Hi , rahul.
Try this:
select matnr from mara into table itab1.
loop at itab1.
write: / itab1-matnr.
endloop.
Regards,
feng.
‎2007 Oct 29 4:47 AM
Hi Rahul,
tables: mara.
types: begin of itab occurs 0,
matnr type mara-matnr,
end of itab.
data: itab1 type standard table of itab with header line.
select matnr from mara into <b>table</b> itab1.
loop at itab1.
write: / itab1-matnr.
endloop.
‎2007 Oct 29 4:47 AM
Hi,
tables: mara.
types: begin of itab occurs 0,
matnr like mara-matnr,
end of itab.
select matnr from mara into itab-matnr.
loop at itab.
write: / itab-matnr.
endloop.
regards,
paras
‎2007 Oct 29 4:49 AM
Code should look something like this - I am surprised why your code is not giving any error..
TABLES: mara.
DATA: BEGIN OF itab OCCURS 0,
matnr TYPE mara-matnr,
END OF itab.
SELECT matnr INTO TABLE itab FROM mara .
LOOP AT itab.
WRITE: / itab-matnr.
ENDLOOP.
Anyway Happy abaping ...
Rajiv
‎2007 Oct 29 4:54 AM
Hi,
Try this,
tables: mara.
types: begin of itab, " occurs 0,
matnr like mara-matnr,
end of itab.
data: itab1 type standard table of itab with header line.
select matnr from mara into itab1.
write: / itab1-matnr.
endselect.
Reward if useful.
Regards,
Ruthra
‎2007 Oct 29 10:49 AM
Hi
u need to end the select statement with ENDSELECT after the write statement.
otherwise
select matnr from mara into table itab1.
loop at itab1.
write: itab1-matnr.
endloop.
plz reward,if it is usefull.
regards,
chandu