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: 

ALV

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

Hi ,

Use sort in ALV.

regards,

Ramya

Former Member
0 Kudos

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