can u create internal table dynamically ? how?

Answer Posted / ravi kiran sankuru

By Using RTTI , we can create internal table dynamically.

PARAMETERS: P_TABLE TYPE CHAR20.

DATA : lo_table_struc TYPE REF TO cl_abap_structdescr,
lt_itab type ABAP_COMPDESCR_TAB.

*-----> Get structure of Table.
lo_table_struc ?= cl_abap_typedescr=>describe_by_name( P_TABLE ).

*-----> Move Table fields to Internal Table.
lt_itab[] = lo_table_struc->components[].

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sap luw or update transaction?

606


What is the maximum number of match code id's that can be defined for one match code object ?

533


Different between Interface and Abstract classes?

1113


What is pretty printer?

591


What are the tcodes for performance tuning?

907






How can we set the tablespaces and extent sizes ?

565


How to creat transactions? : abap data dictionary

640


What is the difference between sum and collect?

882


What is the difference between call transaction and session method? : abap bdc

657


The commands through which an abap/4 module can “branch to “ or “call” the next screen are?

630


Where do you create indexes in abap?

619


What is pnp-sw-found ? : abap hr

861


Cds views

7669


When the get cursor command used in interactive lists?

593


What are the differences between interactive and drill down reports?

540