Skip to Content

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

Expand and collapse total lines in ABAP ALV grid display

Hi

In classic alv I remember an option to expand total lines (show detail lines) and collapse total lines (hide detail lines) by clicking an icon.

But I developed the Z report but it’s not appearing

I have used the variant sort functionality.

I used the sum on ZWREBTR field

   wa_fcat-do_sum = 'X'.
MODIFY it_fcat FROM wa_fcat  TRANSPORTING do_sum
WHERE  fieldname  = 'ZWRBTR' AND
fieldname 
= 'WRBTR' .

  wa_sort-spos      = '1'.
wa_sort
-fieldname = 'ZAUGBL_GL'.
wa_sort
-tabname   = 'IT_Z070_CUR'.
wa_sort
-group     = 'UL'.
wa_sort
-up        = 'X'.
*  wa_sort-spos      = 'X'.
wa_sort
-subtot    = 'X'.

  APPEND wa_sort TO it_sort.
CLEAR:wa_sort.

Afeter that I am sung the grid display

t_slis_layout_alv-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program      
= sy-repid
i_callback_pf_status_set
= 'SET_PF_STATUS'
i_callback_user_command 
= 'MODIFY_ALV'
is_layout               
= t_slis_layout_alv
it_fieldcat             
= it_fcat
it_sort                 
= it_sort
i_save                  
= 'A'
is_variant              
= rs_variant
TABLES
t_outtab                
= it_z070_cur
EXCEPTIONS
program_error           
= 1
OTHERS                   = 2.
IF sy-subrc <> 0.
MESSAGE text-032 TYPE 'E'.   "'Display Error'
ENDIF.

If I use the *  wa_sort-expa = 'X'. it will hide all line items and also t was not showing expand and collapse option

Tags:
Not what you were looking for? View more on this topic or Ask a question