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

without table decalrtion.

jaheer_hussain
Active Contributor
0 Likes
532

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
500

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'.

3 REPLIES 3
Read only

Former Member
0 Likes
501

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'.

Read only

Former Member
0 Likes
500

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

Read only

Former Member
0 Likes
500

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