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

Dynamic table

Former Member
0 Likes
540

How do you create a dynamic table with header line. The below CALL METHOD creates one without the header line.

How do you sort the dynamic table?

CALL METHOD cl_alv_table_create=>create_dynamic_table

EXPORTING

it_fieldcatalog = it_fldcat

IMPORTING

ep_table = new_table.

ASSIGN new_table->* TO <dyn_table>.

  • Create dynamic work area and assign to FS

CREATE DATA new_line LIKE LINE OF <dyn_table>.

ASSIGN new_line->* TO <dyn_wa>.

1 ACCEPTED SOLUTION
Read only

athavanraja
Active Contributor
0 Likes
466

<i>How do you create a dynamic table with header line.</i>

you cannot create dynamic internal table with header line. moreover in the ABAP OO context itabs with header lines are not permitted and its a good practice to avoide itabs with header area.

Regards

Raja

2 REPLIES 2
Read only

Former Member
0 Likes
466

Hi,

For sorting the dynamic internal table..

Try this..

DATA: T_FIELD(30) OCCURS 0 WITH HEADER LINE.

FIELD-SYMBOLS: <FS> TYPE TABLE.

T_FIELD = 'MATNR'.

APPEND T_FIELD.

SORT <FS> BY (T_FIELD).

Thanks,

Naren

Read only

athavanraja
Active Contributor
0 Likes
467

<i>How do you create a dynamic table with header line.</i>

you cannot create dynamic internal table with header line. moreover in the ABAP OO context itabs with header lines are not permitted and its a good practice to avoide itabs with header area.

Regards

Raja