‎2005 Jun 24 4:21 PM
hi,
I would like to request your help.
I want to select some data from one table .but the table is dynamic.
It is continuously changing.So what i thought is accept the tablename as
parameter and then do the select from the parameter but the select
statement is not working .
Please advise whether i can select from parameter any data or is there
any other way to do that.
Thanks in advance.
aasr.
‎2005 Jun 24 4:35 PM
Post your code. Are you looking for a dynamic where clause?
Here is a short sample of a dynamic select statement.
Enter your table name in the parameter on selection screen. Enter you where clause in the select-option on selection screen.
I used.....
MARA
MTART = 'HALB'
report zrich_0004 .
data: xwhere(30) type c.
data: iwhere(30) type c occurs 0.
data:itab(1000) type c occurs 0 with header line.
parameters: p_table(30) type c.
select-options: s_where for xwhere.
loop at s_where.
clear iwhere.
xwhere = s_where-low.
append xwhere to iwhere.
endloop.
select * up to 100 rows into table itab
from (p_table)
where (iwhere).
loop at itab.
write:/ itab.
endloop.
Regards,
Rich Heilman
Message was edited by: Rich Heilman
‎2005 Jun 24 4:35 PM
Post your code. Are you looking for a dynamic where clause?
Here is a short sample of a dynamic select statement.
Enter your table name in the parameter on selection screen. Enter you where clause in the select-option on selection screen.
I used.....
MARA
MTART = 'HALB'
report zrich_0004 .
data: xwhere(30) type c.
data: iwhere(30) type c occurs 0.
data:itab(1000) type c occurs 0 with header line.
parameters: p_table(30) type c.
select-options: s_where for xwhere.
loop at s_where.
clear iwhere.
xwhere = s_where-low.
append xwhere to iwhere.
endloop.
select * up to 100 rows into table itab
from (p_table)
where (iwhere).
loop at itab.
write:/ itab.
endloop.
Regards,
Rich Heilman
Message was edited by: Rich Heilman
‎2005 Jun 24 5:30 PM
hi Rich,
Your solution is excellent.
I fixed my problem .
Your knowledge is amazing.
Thanks a ton.
aasr