Skip to Content
0
Former Member
Feb 23, 2010 at 07:22 PM

Internal tables with dynamic names

15 Views

Please, I need to create "n" internal tables with dynamic names.

Already try with this options:

- with DEFINE

define internal_table .

data: ti_&1 &2 &3 occurs 0 with header line.

end-of-definition.

define z_define_output_file.

internal_table: &1 type &2.

end-of-definition.

do 2 times.

l_idx = sy-index.

concatenate lv_name l_idx into l_nome.

z_define_output_file l_nome ty_mod .

enddo.

- with FUNCTION and METHOD

call function 'REUSE_ALV_FIELDCATALOG_MERGE'

exporting

i_structure_name = p_tab

changing

ct_fieldcat = it_fcat[].

call method cl_alv_table_create=>create_dynamic_table

exporting

it_fieldcatalog = it_fieldcat

importing

ep_table = new_table.

it_field[] = it_fieldcat.

assign new_table->* to <l_table>.

create data new_line like line of <l_table>.

assign new_line->* to <l_line>.

but, I don't have success...

I need to create internal tables with this names :

tab001

tab002,

tab003,

tab...

tab...

--

Thanks.

JNilson.