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 table - convert internal table

Former Member
0 Kudos

hi,

I create a internal table like:



FIELD-SYMBOLS: <dyntable> TYPE standard table.

  CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
      it_fieldcatalog = lt
    IMPORTING
      ep_table = t_data
    EXCEPTIONS
      generate_subpool_dir_full = 1
    OTHERS = 2.

  IF sy-subrc <> 0.
  ENDIF.

assign t_data->* to <dyntable>.

The result of the method is a standard table. Now I need a sorted table.

Is it possible to convert the internal table from a standard to a sorted table?

thanks

markus

2 REPLIES 2

Former Member
0 Kudos

Hi,

Basically the method inside calls the FM : ALV_TABLE_CREATE, which actually constructs the syntax of declaring an internal table and then generates this code within a form routine of the program that was called.

This is done using syntax :

generate subroutine pool lt_source name l_name

message l_message line l_line word l_word.

So you can copy the FM ALV_TABLE_CREATE make the required modifications in the declaration of statements.

athavanraja
Active Contributor
0 Kudos

if you are on WAS6.40 you can create dynamic internal table of different type (standard , sorted, etc) using class

CL_ABAP_TABLEDESCR

method

CREATE

do let me know if you need code sample on this.

Regards

Raja

(i dont know a way to achieve this using cl_alv_table_create)