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: 

Dynamic Internal Table Sort with field Symbol.

Former Member
0 Kudos
2,605

Hi All,

I have defined a dynamic internal table as follows.

CREATE DATA v_dref6 TYPE STANDARD TABLE OF (v_tabname).

ASSIGN v_dref6->* TO <fs_itab_calc>.

I am trying to sort this table by MATNR as follows.

DATA: l_matnr(5) VALUE 'MATNR'.

MOVE l_matnr TO <fs_sort>.

SORT <fs_itab_calc> BY <fs_sort>.

This is giving an error, that dynamic sort can be performed only on tables with header line.

Now how do i define this table with header line.

Regards

Rakesh.

1 REPLY 1

Former Member
0 Kudos
95

Hi

DATA: l_matnr(5) VALUE 'MATNR'.

<b>*MOVE l_matnr TO <fs_sort>.

*SORT <fs_itab_calc> BY <fs_sort>.</b>

SORT <fs_itab_calc> BY (l_matnr).

Max