Skip to Content
0
Former Member
Jun 27, 2008 at 12:09 PM

sort order blank field explanation sought

12 Views

TYPES : BEGIN OF ty_data,

field1(10), field2(10),

field3(10), field4(10),

field5(10),

END OF ty_data.

DATA : it_data TYPE TABLE OF ty_data WITH HEADER LINE.

DATA : it_data1 TYPE TABLE OF ty_data WITH HEADER LINE.

DEFINE fill_table.

&1-field1 = &2. &1-field2 = &3.

&1-field3 = &4. &1-field4 = &5.

&1-field5 = &6.

append &1.

END-OF-DEFINITION.

fill_table it_data '1' ' ' ' ' ' ' '2'.

fill_table it_data '2' ' ' ' ' ' ' '6'.

fill_table it_data '3' ' ' ' ' ' ' '4'.

fill_table it_data '4' ' ' ' ' ' ' ' '.

fill_table it_data '5' ' ' '5' ' ' '7'.

fill_table it_data '6' ' ' '6' ' ' '2'.

fill_table it_data '7' ' ' ' ' ' ' '2'.

fill_table it_data '8' ' ' ' ' ' ' '6'.

fill_table it_data '9' ' ' ' ' ' ' '4'.

fill_table it_data '10' ' ' ' ' ' ' ' '.

fill_table it_data '11' ' ' '7' ' ' '7'.

fill_table it_data '12' ' ' '8' ' ' '2'.

fill_table it_data '13' ' ' ' ' ' ' '2'.

fill_table it_data '14' ' ' ' ' ' ' '6'.

fill_table it_data '15' ' ' ' ' ' ' '4'.

fill_table it_data '16' ' ' ' ' ' ' ' '.

fill_table it_data '17' ' ' '1' ' ' '7'.

fill_table it_data '18' ' ' '3' ' ' '2'.

fill_table it_data '19' ' ' ' ' ' ' '7'.

fill_table it_data '20' ' ' ' ' ' ' '2'.

APPEND LINES OF it_data TO it_data1.

SORT it_data1 stable BY field3 .

LOOP AT it_data1.

WRITE : / it_data1-field1, it_data1-field2,

it_data1-field3, it_data1-field4.

ENDLOOP.

for the code above :the outptut is of the order

9,10,13,14,15,16,19,20,3,4,2,1,8,7,17,18,5,6,11,12

my question is how is the order of the output :

9,10,13,14,15,16,19,20,3,4,2,1,8,7 determined when the contents of field3 is blank for all these records.