Friday, December 17, 2010
Here is the procedure to handle TOP_OF_PAGE event in ALV GRID display.

  • declare events table like this.
  • data : i_events  type slis_t_event, w_events  like line of i_events.
  • Build events table .
  • w_events-name = 'TOP_OF_PAGE' . w_events-form   = 'TOP_OF_PAGE' . append w_events to i_events. clear w_events.
  • pass this events table through REUSE_ALV_GRID_DISPLAY.
  • TOP_OF_PAGE call back should be like this in your case.
  • *&---------------------------------------------------------------------*
    *&      Form  top_of_page
    *&---------------------------------------------------------------------*
    FORM  top_of_page.
     
      DATA :
       li_header TYPE slis_t_listheader,
       w_header  LIKE LINE OF li_header.
     
      w_header-typ  = 'S'.
      w_header-info = g_var1.
      APPEND w_header TO li_header.
      CLEAR w_header.
     
      w_header-typ  = 'H'.
      w_header-info = g_var2.
      APPEND w_header TO li_header.
      CLEAR w_header.
     
      w_header-typ  = 'A'.
      w_header-info = g_var3.
      APPEND w_header TO li_header.
      CLEAR w_header.
     
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary =  li_header.
     
    ENDFORM.                    " top_of_page
    
  • Instead of all 1and 2 steps you can just pass TOP_OF_PAGE the above subroutine theough REUSE_ALV_GRID_DISPLAY in the exporting parameters.

0 comments:

Post a Comment

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.