Application Development 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: 

Creating Dynamic Internal tables

Former Member
0 Kudos

Hi,

I have to work on this scenario which involves a selection screen where user can enter multiple values for a department. For each department I have to display the different set of data based on the business logic. The same data also needs to be downloaded in different sheets of the same Excel file meaning different tab for each department.

The number of departments will be determined at the run time, therefore the tabs will also be determined during run time.

I think we need to create different internal tables dynamically.

Can anyone Please help me on this?

Best regards,

Amit

3 REPLIES 3

uwe_schieferstein
Active Contributor
0 Kudos

Hello Amit

Have a look at my sample reports <b>ZUS_SDN_RTTI_CREATE_STRUC...</b> in thread

Perhaps they may be useful to you.

Regards

Uwe

Former Member
0 Kudos

Hi Amit,

What you'll have to do is to loop at the select-option and for each entry dynamically create an internal table.

For creation of a dynamic internal table, try this.

There is a class called cl_alv_table_create.

This has a static method called create_dynamic_table.

This method requires a field catalog as an input and based on this it will return an internal table.

However, you have to use fields symbols in this.

Reward points if helpful

Regards,

Ravi

jaideeps
Advisor
Advisor
0 Kudos

hi,

link :

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/dynamic%2binternal%2btable

check out this blog :

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

thanks

jaideep