11-27-2006 1:49 PM
Hi,
is it possible in 6.20 to create a type dynamically ?
I have a type TY_OUTPUT with 3 fields F1, F2 and F3. And depending on some user selections i want to add several fields to the TY_OUTPUT type, for instance D1, D2, D3 and D4.
I know that it is possible in 6.40 with RTTS, but we're not on 6.40
regards,
Hans
03-16-2007 5:19 PM
Hi,
May this one help you.
parameters: p_tabnam type tabname default 'MARA'.
data: dref type ref to data.
field-symbols: <struc> type any.
create data dref type (p_tabnam).
assign dref->* to <struc>.
select single * from (p_tabnam) into <struc>.
aRs
11-27-2006 1:51 PM
11-27-2006 1:56 PM
S Ray,
you answered my question, but i cannot give you points for that
So my next question is :
how is it possible ?
11-27-2006 1:56 PM
I am not sure if you can create a type, you can have a structure or a table.
Take a look at these blogs which are based on WAS < 6.40
/people/ravikumar.allampallam/blog/2005/05/31/expand-the-list-of-columns-in-a-report-dynamically
/people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table
/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap
Regards,
Ravi
Note - Please mark all the helpful answers
11-27-2006 2:06 PM
Hi Ravi,
i'm known with these blogs, but i was looking for a dynamic TYPE definition. In my program the type is used several times in several ways. So the most efficient way to modify the program is by modifying the TYPE on runtime.
regards,
Hans
03-16-2007 4:51 PM
Hans,
Did you find a way of defining a type dynamically? If you found a way I would appreciate it if you could let me know.
Thanks and regards
John.
03-16-2007 5:19 PM
Hi,
May this one help you.
parameters: p_tabnam type tabname default 'MARA'.
data: dref type ref to data.
field-symbols: <struc> type any.
create data dref type (p_tabnam).
assign dref->* to <struc>.
select single * from (p_tabnam) into <struc>.
aRs