Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

ALV

Hi Experts,

like AT NEW, do we have any option in ALV to display the data for every new field value.

thanks in advance

Narendra

Tags:
Former Member
Former Member replied

Hi,

You will have to pass the sort table to the function reuse_alv_grid.

the table should be of type slis_sortinfo_alv of type group SLIS.

Here you give the sort position, fieldname and table name, sort up or down etc.

Something like this :

* Sort Criteria
DATA : gt_sort TYPE  slis_t_sortinfo_alv,
       gw_sort  TYPE slis_sortinfo_alv.

  gw_sort-spos = '01'.
  gw_sort-fieldname = 'JOBNAME'.
  gw_sort-tabname = 'I_JOBLOG'.
  gw_sort-up = 'X'.
  gw_sort-group = 'UL'.
  APPEND gw_sort TO gt_sort.

  gw_sort-spos = '02'.
  gw_sort-fieldname = 'JOBCOUNT'.
  gw_sort-tabname = 'I_JOBLOG'.
  gw_sort-up = 'X'.
  gw_sort-group = 'UL'.
  APPEND gw_sort TO gt_sort.

  gw_sort-spos = '03'.
  gw_sort-fieldname = 'ENTERTIME'.
  gw_sort-tabname = 'I_JOBLOG'.
  gw_sort-up = 'X'.
  gw_sort-group = 'UL'.
  APPEND gw_sort TO gt_sort.

  gw_sort-spos = '04'.
  gw_sort-fieldname = 'ENTERDATE'.
  gw_sort-tabname = 'I_JOBLOG'.
  gw_sort-up = 'X'.
  gw_sort-group = 'UL'.
  APPEND gw_sort TO gt_sort.


  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program = e_repid
      is_layout  =     g_layout_jl
      it_fieldcat        = gt_fielcat_jl
*      it_events          = gt_jlevents
      it_sort    =           gt_sort
    TABLES
      t_outtab           = i_joblog
    EXCEPTIONS
      program_error      = 1
      OTHERS             = 2.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

The output of the ALV will then be displayed sorted and grouped as you have specified.

regards,

Advait

Edited by: Advait Gode on Oct 20, 2008 10:25 AM

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question