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

How to create an internal tables dynamically

Former Member
0 Likes
1,434

Hi all,

For my requirment i want to create multiple internal tables dynamicall and also i will pass the data into those internal tables to pass those internal tables as a parameter to the FM REUSE_BLOCK_LIST_APPEND. And also i have to use those internal tables to create field catelog.

Kindly help me.

Regards

Srinivas K

Hi all,

For my requirment i want to create multiple internal tables dynamicall and also i will pass the data into those internal tables to pass those internal tables as a parameter to the FM REUSE_BLOCK_LIST_APPEND. And also i have to use those internal tables to create field catelog.

Kindly help me.

Regards

Srinivas K

9 REPLIES 9
Read only

Former Member
0 Likes
1,406

This message was moderated.

Read only

MarcinPciak
Active Contributor
0 Likes
1,406

Welcome on SCN,

Please ensure you have read [Forum Rules and Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] before posting.

As for your question there are plenty of examples how you can do that in plenty ways. Below example how you can ahcieve that using [RTTS classes|http://help-abap.blogspot.com/2008/09/dynamic-internal-table-creation.html]

Regards

Marcin

Read only

0 Likes
1,406

Hi

Thnaku for the reply.

I have a structure (fixed), by using this structure i want to create multiple internal tabnles with the same structure. For example i have a data in an internal table which has n company codes. So i need to take n company codes data into n internal tables. like itab1, itab2, itab3,........ itabn with the same structure. And also i need to assign these internal table as a patrameters to the funtion module REUSE_ALV_BLOCKLIST_APPEND.

I hope u undestand my requirment. Kindly help me in this.

Regards,

Srinivas K

Read only

0 Likes
1,406

Hi Kaduri, <li>By the way, You can call REUSE_ALV_BLOCKLIST_APPEND only 19 times in any report. If it goes beyond, It gives dump. Thanks Venkat.O

Read only

Former Member
0 Likes
1,406

Hi,

use field-symbols and rtts classes...

do r&d on field-symbol....

Rgds/Abhi

Read only

Former Member
0 Likes
1,406

This message was moderated.

Read only

Former Member
0 Likes
1,406

Hi,

For creating dynamic internal table we need to use class

CL_ALV_TABLE_CREATE

Basic principal would be, we need to fill the field catalog table and pass it to static method CREATE_DYNAMIC_TABLE from class

CL_ALV_TABLE_CREATE.

CALL METHOD cl_alv_table_create=>create_dynamic_table



 CALL METHOD cl_alv_table_create=>create_dynamic_table 
    EXPORTING 
      it_fieldcatalog = t_fldcat                   
    IMPORTING 
      ep_table        = t_newtable.        

    

Thanks,

Krishna

Read only

Former Member
0 Likes
1,406

first you can create reference work area and filed symbols(dynamic internal table) like below

data : ref_area type ref to data .

filed-symbols : <fs_itab> type standard table .

after user reference work area to create data that include fixed structure data attribute .

create data ref_area like standard table of str_fixdata(u2192this is you fixed structure )

finally assign field symbols to reference area

assign ref_area->* to <fs_itab> .

the <fs_itab> is dynamic internal table that attribute likes you defined fix structure .

Read only

matt
Active Contributor
0 Likes
1,406

Frequently asked question. Locked.

matt