Skip to Content
0
Former Member
Aug 26, 2009 at 10:40 AM

ALV sums using REUSE_ALV_LIST_DISPLAY

413 Views

I am working in an old 4.0 system so I am using the function REUSE_ALV_LIST_DISPLAY to output my data, but I can't get teh ALV grid to include the totals button or indeed sum my values despite populating the field cat with 'Do_sum'.

Andy idead

    ls_fieldcat-fieldname = 'KWMENG'.                         
    ls_fieldcat-col_pos = '9'.                                
    ls_fieldcat-ref_fieldname  = 'KWMENG'.                    
    ls_fieldcat-ref_tabname    = 'GIT_DETAIL'.                
    ls_fieldcat-tabname        = 'GIT_DETAIL'.                
    "ls_fieldcat-ddictxt = 'L'.                               
    ls_fieldcat-outputlen = '14'.                             
    ls_fieldcat-seltext_l = 'Order Qty'.                      
    ls_fieldcat-do_sum    = 'X'.                              
    append ls_fieldcat to lit_fieldcat. clear ls_fieldcat.

* Displays the ALV grid                                       
      call function 'REUSE_ALV_LIST_DISPLAY'                  
        exporting                                             
          i_callback_program       = w_repid                  
          it_fieldcat              = lit_fieldcat[]           
          is_layout                = x_layout                 
          it_sort                  = lit_sort[]               
          i_callback_pf_status_set = w_status                 
          i_callback_user_command  = w_comm                   
          i_save                   = 'X'                      
          it_events                = lit_event[]              
          i_grid_title             = w_title                  
        tables                                                
          t_outtab                 = git_detail[]             
        exceptions                                            
          program_error            = 1                        
          others                   = 2.