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

display Red triangle in the sorting column header

Former Member
0 Likes
1,403

Dear All,

In the customized ALV report,we need the display of Red triangle in the column header While sorting.

In standard report, we can see the display of Red triangle in the sorted column header. how to enable that in my customized report

Thanks,

Raj V

  • Kindly do reply for the above threat

Edited by: raj on Sep 20, 2011 10:11 AM

Dear All,

In the customized ALV report,we need the display of Red triangle in the column header While sorting.

In standard report, we can see the display of Red triangle in the sorted column header. how to enable that in my customized report

Thanks,

Raj V

  • Kindly do reply for the above threat

Edited by: raj on Sep 20, 2011 10:11 AM

6 REPLIES 6
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,195

This is the standard behavior of ALV as soon as the SORT is executed in the ALV (not a SORT of the internal table before calling the ALV) - fill the SORT parameter (*) (or use a variant with a sort option) in the call of ALV

Regards,

Raymond

(*) eg. parameter IT_SORT of method [set_table_for_first_display|http://help.sap.com/saphelp_erp2004/helpdata/en/0a/b5533cd30911d2b467006094192fe3/frameset.htm] of [Methods of Class CL_GUI_ALV_GRID|http://help.sap.com/saphelp_erp2004/helpdata/en/22/a3f5ecd2fe11d2b467006094192fe3/frameset.htm]

Read only

0 Likes
1,195

Dear Raymond,

Thanks for your reply .....

Since we use customized Sorting icons in our ALV report, when we sorting the coulmn header, the Red triange is not get displayed. Pls let us know the ' BLOCK OF CODE ' to show the red triangle while do sort the column header.

Thanks,

Raj V

Edited by: raj on Sep 20, 2011 12:16 PM

Read only

0 Likes
1,195

Just fill IT_SORT with sort criteria and apply the change to sort via a (*)

CALL METHOD <ref.var. to CL_GUI_ALV_GRID > ->set_sort_criteria

   EXPORTING
      IT_SORT  =   <internal table of type LVC_T_SORT > .

Regards,

Raymond

(*) For (old) Reuse FM use a GET_GLOBALS_FROM_SLVC_FULLSCR to get the ref to cl_gui_alv_grid.

Read only

0 Likes
1,195

Thank you, Raymond!

This solves the issue.

Best regards,

Anton

Read only

Former Member
0 Likes
1,195

Hi,

Just fill the SORT parameter in RESUE_ALV_grid_display or in SET_TABLE_FOR_FIRST_DISPLAY method of CL_GUI_ALV_GRID.

like this

WA_SORT-FIELDNAME = 'field name'.

WA_SORT-TABNAME = ' table name'.

WA_SORT-UP = 'X'.

WA_SORT-DOWN = 'X'.

WA_SORT-SUBTOT = 'X'.

APPEND WA_SORT TO IT_SORT.

Hope this will helps you.

Regards,

Kiran

Edited by: kiran kumar on Sep 20, 2011 11:07 AM

Read only

0 Likes
1,195

Hi,



Data: it_sort        TYPE slis_t_sortinfo_alv,
         wa_sort     TYPE slis_sortinfo_alv.

wa_sort-fieldname = 'VBELN'.
wa_sort-tabname = 'ITAB'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'......... Use this only if you have currency columns.

append wa_sort to it_sort.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program = sy-repid
      i_default          = 'X'
      i_save             = 'A'
      is_layout          = wa_layout
      it_fieldcat        = it_fcat
      it_sort            = it_sort........................ used for automatic sorting
      it_events          = it_events
    TABLES
      t_outtab           = itab
    EXCEPTIONS
      program_error      = 1
      OTHERS             = 2.
  IF sy-subrc <> 0.
    MESSAGE 'Error in displaying records.' TYPE 'E'.
    LEAVE LIST-PROCESSING.
  ENDIF.

Regards,

Danish.

Edited by: Danish2285 on Sep 20, 2011 3:06 PM