‎2007 Oct 22 12:42 PM
Hi all,
i have to wrote a generator for a Pattern here. But i got a small problem.
I have to got a table and the big problem is i don't know whick TYPE i got
the code looks like this
SELECT *
FROM (im_table)
INTO TABLE ????.
But how to define the ????. I allready tried
DATA test TYPE ANY TABLE.
and
DATA test TYPE TABLE.
FIELD-SYMBOLS <table> TYPE ANY.
ASSIGN test TO <table>
.....
INTO TABLE <table>.
But no luck this time. Maybe some of you get a hint for me.
greetings
P.S Sorry for my bad english.
‎2007 Oct 22 12:44 PM
Where do you put this dynamic select? Method? Function module?
‎2007 Oct 22 12:44 PM
Where do you put this dynamic select? Method? Function module?
‎2007 Oct 22 12:46 PM
This is a method.
The (im_table) is a Parameter from the Type CHAR where the table is set.
greetings
‎2007 Oct 22 12:55 PM
Try this:
DATA:
ptr_it_table type any table.
field-symbols:
<fstable> type any table.
create data ptr_it_table type table of (im_table).
assign ptr_it_table ->* to <fstable>.
select *
from (im_table)
into table <fstable>.
this should work.
‎2007 Oct 22 1:01 PM
The Answere before work. Your last answer didnt work ... I Got a error message like this:
You cannot use generic types for fields. The table Types ANY and INDEX are generic.
But thanks a lot ...
greetings
‎2007 Oct 22 1:04 PM
Hello Moritz
Perhaps it is possible to add the following option to the DATA definition:
DATA:
ptr_it_table type any table
WITH DEFAULT KEY.Regards
Uwe
‎2007 Oct 22 1:06 PM
Thanks a lot it works now
Now i can work on thank you thousand times
greetings
‎2007 Oct 22 1:09 PM
Sorry, it must be like this:
instead:
DATA:
ptr_it_table type any table.
it must be
DATA:
ptr_it_table type ref to data
‎2007 Oct 22 12:53 PM
Hello Moritz
Add the following lines of coding:
DATA:
lo_data TYPE REF TO data.
FIELD-SYMBOLS:
<lt_itab> TYPE table,
<ls_record> TYPE any.
CREATE DATA lo_data TYPE (im_table).
ASSIGN lo_data->* TO <lt_itab>.
SELECT *
FROM (im_table)
INTO TABLE <lt_itab>.
LOOP AT <lt_itab> ASSIGNING <ls_record>.
ENDLOOP.Regards
Uwe