2005 Aug 03 12:06 PM
Hi
Quick one, can I dynamically create tables in 46B using the 'create data dref type table of ty_table' in 46B. It seems not but I just wanted to check. Otherwise I will resort to using the construct below:
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING it_fieldcatalog = gt_fieldcat
IMPORTING ep_table = gp_table.
From what I can see the RTTS has not been fully implemented yet.
Cheers
Ian
2005 Aug 03 12:11 PM
Hi,
See this weblog and the related comments.
/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap
Svetlin
2005 Aug 03 12:11 PM
Hi,
See this weblog and the related comments.
/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap
Svetlin
2005 Aug 03 12:19 PM
Thanks Svetlin but I can already create my table like this. What I wanted was a 'cleaner' version so that I can have for example:
if p_plant = 'X'.
create data dref type table of ty_plant.
elseif p_workcentre = 'X'.
create data dref type table of ty_workcentre.
endif.
assign dref->* to <gt_output>.
However I get a syntax error when I use the above or even when I create a table such such as;
begin of ty_gbp,
plant TYPE qals-werk,
insp_end TYPE qals-paendterm,
workcentre TYPE QAQEE-PRPLATZ,
lwr TYPE qals-zz_lwr,
insp_lot TYPE qals-prueflos,
end of ty_gbp,
ty_gbp_table type table of ty_gbp.
create data dref type ty_gbp_table.
It says the type specification of ty_gbp_table is incomplete.
Ian
2005 Aug 03 12:26 PM
Hi´Ian,
it's not possible with rel. 4.6 (B / C)
-> 6.1 / 6.2
regards Andreas
2005 Aug 03 12:51 PM
2005 Aug 03 1:20 PM
Hi Ian,
I think that using this sample code you can create a dynamic table even in 46B.
DATA: dref TYPE REF TO DATA.
FIELD-SYMBOLS: <fs> TYPE ANY.
data: booking TYPE sbook occurs 0.
CREATE DATA dref like booking[].
ASSIGN dref->* TO <fs>.
Regards,
Svetlin
2005 Aug 03 1:58 PM