cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting Issue in ALV table

Former Member
0 Kudos

Hi,

I have included a ALV table in my application. A column in the table is containing a list of amounts. When i am trying to sort it in ascending or descending order, the values are not listed properly. I am using "PAD_AMT7S" as the data type for the attribute which will accept up to 2 decimals. The issue is,

if the column is containing values like

0.00,

8.75,

17.00,

8.50 and

17.50.

if i perform ascending type of sorting the values are re-arranged as,

0.00

17.00

17.50

8.50

8.75

and on descending

8.75

8.50

17.50

17.00

0.00

Which are all incorrect. Please provide me your suggestions..

Thanks,

Mugundhan

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ,

Are you sure the the values are 17.50 , 17.00

The output looks correct if the values are 1.75 and 1.70

If the values are absolutely correct (17.50 , 17.00) then search for SAP notes related to ALV sorting.

Former Member
0 Kudos

Hi Baskaran,

ya the values which i mentioned are correct. May i know can this problem can be resolved?

Thanks,

Mugundhan

Former Member
0 Kudos

If the values are correct as you mentioned then open a sap service ticket. I am sure this will be resolved .

former_member225631
Active Contributor
0 Kudos

What is the data type you have used for that column?

Former Member
0 Kudos

Hi,

I had used "PAD_AMT7S" and also tried with string. But getting the same problem.

Thanks,

Mugu

Former Member
0 Kudos

Hi,

Have you checked wether only for this field the sorting is applied.Is any grouping on the fields is also applied.

Regards,

Lekha.

Former Member
0 Kudos

Hi Lekha,

Only this column is having the issue, rest other columns no issue. Yes, when the sorting is applied, internally similar values are grouped together under the column.

Thanks,

Mugu

former_member225631
Active Contributor
0 Kudos

Please confirm whether you have sorted this column or sorting of any other field could lead this result.

Former Member
0 Kudos

Anand,

I getting this problem for the first time itself if i do the sorting on this column.

Thanks,

Mugu

former_member186783
Participant
0 Kudos

Hi,

Are you using the IF_WD_TABLE_METHOD_HNDL for the sort, or you wrote your own code?

IF_WD_TABLE_METHOD_HNDL worked incorrectly for some special fields, in these cases I had to write the sorting code manually.

e.g.


CALL METHOD WDEVENT->GET_STRING
   EXPORTING
     NAME   = 'COL'
   RECEIVING
     VALUE  = lv_col_name.

  CALL METHOD WDEVENT->GET_STRING
   EXPORTING
     NAME   = 'DIRECTION'
   RECEIVING
     VALUE  = lv_direction.

  CASE lv_col_name.
    WHEN 'TABLE_FIELD1'.
      IF lv_direction EQ '00'.
        SORT lt_table BY CURR ASCENDING.
        ELSE.
          SORT lt_table BY CURR  DESCENDING .
      ENDIF.

Is the table sorted incorrectly here?

Bye

N.

Former Member
0 Kudos

Hi,

I am able to get the correct sorting order in a ordinary table. But i am still getting a issue with the ALV table.

Thanks,

Mugu

former_member186783
Participant
0 Kudos

Hi,

How is this possible? Am I understand correctly, that the internal table is correct, but the webdynpro table is sorted in the wrong way? Are you sure that you binded the sorted table to the context node after the sort?


lo_nd_table->bind_table( lt_table ).

Bye

N.

Former Member
0 Kudos

Hi,

As i am using a ALV table, i had not updated the code given by you. But when i had tried out the same with a ordinary UI table, i am able to achieve the correct sorting order. is it possible to update your code for ALV table?

Thanks,

Mugu