Friday, October 1, 2010

Footer in ALV Grid Display

To display Footer in ALV Grid you have to use HTML_End_of_List Parameter in ALV Grid Function Module.

i.e.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
     I_CALLBACK_PROGRAM                    = sy-repid
     I_CALLBACK_TOP_OF_PAGE           = 'TOP_OF_PAGE'
     I_BACKGROUND_ID                              = 'ALV_BACKGROUND'
     i_callback_html_end_of_list                   = 'END_OF_LIST_HTML'
     IS_LAYOUT                                              = wa_layout
     IT_FIELDCAT                                           = it_fieldcat
     I_DEFAULT                                              = 'X'
     I_SAVE                                                     = 'A'
     IT_EVENTS                                              = it_event[]
     IS_PRINT                                                  = wa_print
   TABLES
      t_outtab                                                    = it_result
   EXCEPTIONS
     PROGRAM_ERROR                               = 1
     OTHERS                                                   = 2.



Write your Footer content in Subroutine using OOABAP.


FORM end_of_list_html USING end TYPE REF TO cl_dd_document.
  DATA: ls_text TYPE sdydo_text_element,
        l_grid     TYPE REF TO cl_gui_alv_grid,
        f(14) TYPE c VALUE 'SET_ROW_HEIGHT'.
   ls_text = 'Footer title'.
 * adds and icon (red triangle)
  CALL METHOD end->add_icon
    EXPORTING
      sap_icon = 'ICON_MESSAGE_ERROR_SMALL'.
 * adds test (via variable)
  CALL METHOD end->add_text
    EXPORTING
      text         = ls_text
      sap_emphasis = 'strong'.
 * adds new line (start new line)
  CALL METHOD end->new_line.
 * display text(bold)
  CALL METHOD end->add_text
    EXPORTING
      text         = 'Bold text'
      sap_emphasis = 'strong'.
 * adds new line (start new line)
  CALL METHOD end->new_line.
 * display text(normal)
  CALL METHOD end->add_text
    EXPORTING
      text         = 'Normal text'.
 * adds new line (start new line)
  CALL METHOD end->new_line.
 * display text(bold)
  CALL METHOD end->add_text
    EXPORTING
      text         = 'Yellow triangle'
      sap_emphasis = 'strong'.
 * adds and icon (yellow triangle)
  CALL METHOD end->add_icon
    EXPORTING
      sap_icon = 'ICON_LED_YELLOW'.
 * display text(normal)
  CALL METHOD end->add_text
    EXPORTING
      text         = 'More text'.
 *set height of this section
  CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
      e_grid = l_grid.
   CALL METHOD l_grid->parent->parent->(f)
    EXPORTING
      id     = 3
      height = 14.
 ENDFORM. "end_of_list_html.

3 comments:

Unknown said...

Tableau Data Visualization Software
SQIAR (http://www.sqiar.com/solutions/technology/tableau) is a leading Business Intelligence company and provides Tableau Software consultancy across United Kingdom and USA.

yektek training said...

thanks for sharing this post swathi

Unknown said...

After reading this post I got an idea about on this note.Really something grate in this article ,Thanks for sharing this. We are providing SAP courses training online. After reading this slightly am changed my way of introduction about my training to people. To know more Visit Us SAP PM Online Training Course