Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

dynamic internal table name

hymavathi_oruganti
Active Contributor
0 Likes
387

Hi all,

Is there any method which can create an internal table with the given name and type?

for example:

i want an internal table to be created dynamically with the name "itab_1" and type "typ_itab".

i cant declare the internal table statically because the name of the internal table is dynamic

it ca be itab_1 or itab_2 or... itab_n.

thanks in advance

hyma

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
361

tables:

spfli.

  • Macro definition

define declare_table .

data:

&1 type standard table of &2 with header line.

end-of-definition.

  • Dynamic Itab names and Field names

declare_table ITAB1 SPFLI.

  • can perform operations on ITAB1

clear itab1.

append itab1.

2 REPLIES 2
Read only

Former Member
0 Likes
362

tables:

spfli.

  • Macro definition

define declare_table .

data:

&1 type standard table of &2 with header line.

end-of-definition.

  • Dynamic Itab names and Field names

declare_table ITAB1 SPFLI.

  • can perform operations on ITAB1

clear itab1.

append itab1.

Read only

Former Member
0 Likes
361

Use this METHOD.

CALL METHOD cl_alv_table_create=>create_dynamic_table

EXPORTING

it_fieldcatalog = it_fieldcat

IMPORTING

ep_table = new_table.

Regards,

Rajasekhar Reddy.