‎2008 May 23 8:28 AM
Hi all
If I dont use OCCURS 0 or WITH HEADER LINE how can i can get data in the table for eg
TYPES : BEGIN OF xit_mara,
matnr TYPE matnr,
brgew TYPE brgew,
volum TYPE volum,
wheel_width TYPE zwid,
wheel_diam TYPE zdiam,
END OF xit_mara.
DATA : it_mara TYPE TABLE OF xit_mara WITH HEADER LINE.
DATA : wa_it_mara TYPE xit_mara.
what do i write in select querry and how do i get that into a table.
‎2008 May 23 8:35 AM
Hi,
TYPES : BEGIN OF xit_mara,
matnr TYPE matnr,
brgew TYPE brgew,
volum TYPE volum,
wheel_width TYPE zwid,
wheel_diam TYPE zdiam,
END OF xit_mara.
DATA : it_mara TYPE TABLE OF xit_mara .
DATA : wa_it_mara like line of it_mara.
select * into TABLE it_mara.
loop at it_mara into wa_it_mara.
endloop.
‎2008 May 23 8:31 AM
Hi,
When you use SELECT stmt, let it be in any scenario, ven if you use OCCURS 0 or not,
the best syntax is:
SELECT <DB fields> from <DB Table> into table <Internal table>.
Hope this is helpful to you. If you need further information, revert back.
Reward all the helpful answers.
Regards
Nagaraj T
‎2008 May 23 8:33 AM
Hi,
Your declaration is correct ,only thing you dont need is "WITH HEADER LINE" so remove that.
Then you can write the select as follows :
select * from mara
into table it_mara
where (your where clause )
once the records are selected in the internal table
you can either loop at it or read the internal table into a work area and process the records individualy.
regards,
Advait
‎2008 May 23 8:33 AM
Hi,
Write as below:
DATA : it_mara TYPE STANDARD TABLE OF xit_mara.
DATA : wa_it_mara TYPE xit_mara.
SELECT <fields>
FROM <database table name>
INTO CORRESPONDING FIELDS OF TABLE it_mara.Regards,
Raghu
‎2008 May 23 8:35 AM
Hi,
TYPES : BEGIN OF xit_mara,
matnr TYPE matnr,
brgew TYPE brgew,
volum TYPE volum,
wheel_width TYPE zwid,
wheel_diam TYPE zdiam,
END OF xit_mara.
DATA : it_mara TYPE TABLE OF xit_mara .
DATA : wa_it_mara like line of it_mara.
select * into TABLE it_mara.
loop at it_mara into wa_it_mara.
endloop.