Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SELECT

Former Member
0 Likes
803

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

7 REPLIES 7
Read only

Former Member
0 Likes
786

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.

Read only

Former Member
0 Likes
786

Hi , rahul.

Try this:

select matnr from mara into table itab1.

loop at itab1.

write: / itab1-matnr.

endloop.

Regards,

feng.

Read only

Former Member
0 Likes
786

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.

Read only

Former Member
0 Likes
786

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

Read only

Former Member
0 Likes
786

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

Read only

Former Member
0 Likes
786

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

Read only

Former Member
0 Likes
786

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