‎2008 Jul 22 9:32 PM
Hi all,
I am try trying to do the following.
Select statement to get the table name --> store in tname (variable).
Now, I have to do a select to read the data in this table (table name is in tname variable) based on some conditions
How do I do this?
1st step
Select ME_TECH from RSAC into tname
where NAME = 'PLANT'
and DATEFROM <= ldate
and DATETO >= ldate.
2nd step??
..........................................?
Thanks,
Anirudh.
‎2008 Jul 22 9:38 PM
‎2008 Jul 22 9:39 PM
‎2008 Jul 22 9:40 PM
Hi,
Select * from (Tname) into corresponding fields of table ITAB1.
Note: the braces are close, there is no space between the brackets and the word.
Regards,
Subramanian
Edited by: Subramanian PL on Jul 22, 2008 1:41 PM
‎2008 Jul 22 9:41 PM
Hi,
Please search in SDN with the keyword..Dynamic internal table..I am sure you will get lot of posts on this..which discuss about populating the data from a table name which is dynamic..
Thanks
Naren
‎2008 Jul 22 9:50 PM
report ztest.
parameters: p_table type dd02l-tabname.
field-symbols: <fs> type standard table." of (p_table).
select * from (p_table)
into table <fs>
up to 20 rows.There is another way using CL_ALV_TABLE_CREATE, for this you have to pass the fieldcatalog.
it return the internal table reference. using that you can proceed.
‎2008 Jul 23 4:28 AM
Hi,
When u want to fetch the data in a variable use select single stmt.
select single ME_TECH from <tablename>
into <variable name>
where <conditions>
Sharin.