‎2010 Jan 04 8:16 AM
Hi,
With out table decalrtion in my program how can I use mara table(for example) to get data in internal table.
tables:mara(I donot want to declare)
select * from
with Regards,
Jaheer
‎2010 Jan 04 8:20 AM
Hello
Try without declaration:
data: itab like mara occurs 0 with header line.
select * from mara into table itab.
*" OR
select * from mara into table itab where matnr eq '12345'.
‎2010 Jan 04 8:20 AM
Hello
Try without declaration:
data: itab like mara occurs 0 with header line.
select * from mara into table itab.
*" OR
select * from mara into table itab where matnr eq '12345'.
‎2010 Jan 04 8:29 AM
Hi ,
Check this , you can use as type.
DATA : gi_mara TYPE STANDARD TABLE OF mara.
SELECT *
FROM mara
INTO TABLE gi_mara.
Same way you can declare a workarea.
DATA : wa_mara type mara.
Hope this helps you.
Edited by: Harsh Bhalla on Jan 4, 2010 2:00 PM
‎2010 Jan 04 8:45 AM
Hi
The statament TABLES means it needs to use a workarea structurated as a dictionary table, it doesn't mean it want to do a selection from a dictionary table.
So every comand to declare a workarea as a dictionary table can be used, but it has to be indecated in the selection sentence, so it has to need to use the option INTO:
DATA: W_MARA TYPE/LIKE MARA.
SELECT * FROM MARA INTO MARA.
WHERE ....
ENDSELECT.It's like:
TABLES: MARA.
SELECT * FROM MARA
WHERE ....
ENDSELECT.It can use an internal table if it mean to upload several records:
DATA: T_MARA TYPE/LIKE OF MARA WITH HEADERLINE.
SELECT * FROM MARA INTO TABLE MARA.
WHERE ....Anyway check the help for SELECT statament
Max