cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic internal table

Former Member
0 Kudos

hi,

can anybody explain me how to create the dynamic internal table with an example? It's a bit urgent.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Pls go through the sample program.

report z_dynamic.

type-pools : abap.

field-symbols: <dyn_table> type standard table,

<dyn_wa>,

<dyn_field>.

data: dy_table type ref to data,

dy_line type ref to data,

xfc type lvc_s_fcat,

ifc type lvc_t_fcat.

selection-screen begin of block b1 with frame.

parameters: p_table(30) type c default 'T001'.

selection-screen end of block b1.

start-of-selection.

perform get_structure.

perform create_dynamic_itab.

perform get_data.

perform write_out.

form create_dynamic_itab.

  • Create dynamic internal table and assign to FS

call method cl_alv_table_create=>create_dynamic_table

exporting

it_fieldcatalog = ifc

importing

ep_table = dy_table.

assign dy_table->* to <dyn_table>.

  • Create dynamic work area and assign to FS

create data dy_line like line of <dyn_table>.

assign dy_line->* to <dyn_wa>.

endform.

pls refer this link

/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap

If it is useful reward points

Answers (4)

Answers (4)

Former Member
0 Kudos

HI,

you can use this function module to create interna table dynamically

DB_CREATE_TABLE

hope it is useful.

regards,

sreelakshmi

uwe_schieferstein
Active Contributor
0 Kudos

Hello Khadeer

You may want to have a look at [Creating Flat and Complex Internal Tables Dynamically using RTTI|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/creating%2bflat%2band%2bcomplex%2binternal%2btables%2bdynamically%2busing%2brtti]

Regards

Uwe

chaithanya_mk
Participant
0 Kudos

Hi Khadeer,

Check the below blog, it shows step by step procedure to create dynamic internal tables.

/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap

Rewards if useful.

Cheers,

Chaith.

ThomasZloch
Active Contributor
0 Kudos

this question pops up every other day. Just use the search function.

only a trip to the loo is urgent.