<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: top-of-page in oo ALV in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028565#M83109</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Giri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  To display top-of-page in ALV grid using class.&lt;/P&gt;&lt;P&gt;  I have done in my program like below, it is working &lt;/P&gt;&lt;P&gt;  for me check this.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  1)First we nee to create one loacl class to implemment &lt;/P&gt;&lt;P&gt;    event receiver handler methods. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*----------------------------------------------------------------------*
*             A L V  D E C L A R A T I O N S
*----------------------------------------------------------------------*

DATA : dg_fieldcatalog   TYPE lvc_t_fcat, " Field Catalog
* Reference to custom container
       dg_custom_container  TYPE REF TO cl_gui_custom_container,
* Reference to Grid
       dg_grid1             TYPE REF TO cl_gui_alv_grid,
* Reference to Control container
       dg_mycontainer       TYPE scrfname VALUE 'CONTROL',
* Reference to event receiver
       dg_event_receiver    TYPE REF TO lcl_event_receiver,
* Reference to document
       dg_dyndoc_id       TYPE REF TO cl_dd_document,
* Reference to split container
       dg_splitter          TYPE REF TO cl_gui_splitter_container,
* Reference to grid container
       dg_parent_grid     TYPE REF TO cl_gui_container,
* Reference to html container
       dg_html_cntrl        TYPE REF TO cl_gui_html_viewer,
* Reference to html container
       dg_parent_html     TYPE REF TO cl_gui_container.

  *----------------------------------------------------------------------*
*           C L A S S  D E C L A R A T I O N S

****************************************************************
* LOCAL CLASSES: Definition
****************************************************************
*===============================================================

CLASS lcl_event_receiver DEFINITION.
  PUBLIC SECTION.
* § 2. Define a method for each print event you need.
    METHODS:
    top_of_page FOR EVENT top_of_page
                         OF cl_gui_alv_grid
                         IMPORTING e_dyndoc_id,
    handle_top_of_page
        FOR EVENT print_top_of_page OF cl_gui_alv_grid,

    handle_end_of_list
        FOR EVENT print_end_of_list OF cl_gui_alv_grid.
  PRIVATE SECTION.
ENDCLASS.
*===============================================================
****************************************************************
* LOCAL CLASSES: Implementation
****************************************************************
*===============================================================
* class c_event_receiver (Implementation)
CLASS lcl_event_receiver IMPLEMENTATION.
*§ 3.Implement your event handler methods. Use WRITE to provide output
  METHOD handle_top_of_page.
*  Print Top-of-page
    PERFORM print_top_of_page.
  ENDMETHOD.                           "handle_top_of_page
*-------------------------------------------
  METHOD handle_end_of_list.
* Print End-of-list
    PERFORM print_end_of_list.
  ENDMETHOD.                            "handle_end_of_list
*-------------------------------------------
  METHOD top_of_page.
* Top-of-page event
    PERFORM event_top_of_page USING dg_dyndoc_id.
  ENDMETHOD.                            "top_of_page
*-----------------------------------------------------------------
ENDCLASS.
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  EVENT_TOP_OF_PAGE
*&amp;amp;---------------------------------------------------------------------*
*       Top-of-page event
*----------------------------------------------------------------------*
FORM event_top_of_page USING   dg_dyndoc_id TYPE REF TO cl_dd_document.

 DATA : dl_text(255) TYPE c,  "Text
         dl_background_id TYPE sdydo_key VALUE '/EMN/EASTMAN_LOGO',
         dl_type.
  DATA a_logo TYPE REF TO cl_dd_area.

* Create TOP-Document
  CREATE OBJECT dg_dyndoc_id
                   EXPORTING style = 'ALV_GRID'.
* Populating header to top-of-page
  CALL METHOD dg_dyndoc_id-&amp;gt;add_text
         EXPORTING
            text      = 'Primary Contact Membership Lists'(036)
            sap_style =  cl_dd_area=&amp;gt;heading.
 CALL METHOD dg_dyndoc_id-&amp;gt;new_line.

  CLEAR : dl_text.
* Add 'Primary Contact ID'
  dl_text = text-033.
  PERFORM add_text USING dl_text 'H'.

  CALL METHOD dg_dyndoc_id-&amp;gt;add_gap
         EXPORTING width   = 3.

  CLEAR dl_text.
  CONCATENATE dg_contact dg_ename INTO dl_text
  SEPARATED BY space.

  PERFORM add_text USING dl_text 'S'.
* Add new-line
  CALL METHOD dg_dyndoc_id-&amp;gt;new_line.

  CLEAR : dl_text,dt_protc.
  READ TABLE dt_protc WITH KEY pgroup = dg_protc.


* Add Protocol category
  dl_text = text-034.
  PERFORM add_text USING dl_text 'H'.
  CALL METHOD dg_dyndoc_id-&amp;gt;add_gap
         EXPORTING width   = 4.

  CLEAR dl_text.
  CONCATENATE dg_protc dt_protc-pgroupnam INTO dl_text
  SEPARATED BY space.

  PERFORM add_text USING dl_text 'S'.


* Add new-line
  CALL METHOD dg_dyndoc_id-&amp;gt;new_line.

  CLEAR : dl_text,dt_prot.
  READ TABLE dt_prot WITH KEY pnumber = dg_prot.

* Add Protocol Number
  dl_text = text-035.
  PERFORM add_text USING dl_text 'H'.
  CALL METHOD dg_dyndoc_id-&amp;gt;add_gap
         EXPORTING width   = 5.

  CLEAR dl_text.

  CONCATENATE dg_prot  dt_prot-pname INTO dl_text
  SEPARATED BY space.

  PERFORM add_text USING dl_text 'S'.


  CALL METHOD dg_dyndoc_id-&amp;gt;vertical_split
              EXPORTING split_area =  dg_dyndoc_id
                        split_width = '70%'
                 IMPORTING right_area = a_logo.

  CALL METHOD a_logo-&amp;gt;add_picture
        EXPORTING picture_id = '/EMN/EASTMAN_LOGO'.

  CALL METHOD dg_dyndoc_id-&amp;gt;merge_document.

  CALL METHOD  dg_dyndoc_id-&amp;gt;display_document
      EXPORTING reuse_control = 'X'
                parent =  dg_parent_html
      EXCEPTIONS html_display_error = 1.

ENDFORM.                    " EVENT_TOP_OF_PAGE

  &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) In PBO do below : First you need to split the container to two containers one is to palce top-of-page and other to display grid.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  IF dg_custom_container IS INITIAL.
* Create fieldcatalog for structure dt_final
    PERFORM fieldcat_init  USING dg_fieldcatalog[].
    dt_final[] = dt_members[].
* Create a custom container control for our ALV Control
    CREATE OBJECT dg_custom_container
        EXPORTING
            container_name = dg_mycontainer
        EXCEPTIONS
            cntl_error = 1
            cntl_system_error = 2
            create_error = 3
            lifetime_error = 4
            lifetime_dynpro_dynpro_link = 5.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      dg_repid = sy-repid.
* Add your handling, for example
      CALL FUNCTION 'POPUP_TO_INFORM'
           EXPORTING
                titel = dg_repid
                txt2  = sy-subrc
                txt1  = 'The control could not be created'.
    ENDIF.

* Create TOP-Document
    CREATE OBJECT dg_dyndoc_id
                     EXPORTING style = 'ALV_GRID'.
* Create Splitter for custom_container
    CREATE OBJECT dg_splitter
               EXPORTING parent  = dg_custom_container
                         rows    = 2
                         columns = 1.
* Split the custom_container to two containers and move the reference
* to receiving containers g_parent_html and g_parent_grid

    CALL METHOD dg_splitter-&amp;gt;get_container EXPORTING
                                   row                 = 1
                                   column              = 1
                               RECEIVING container = dg_parent_html.
    CALL METHOD dg_splitter-&amp;gt;get_container EXPORTING
                                  row                 = 2
                                  column              = 1
                              RECEIVING container = dg_parent_grid.


* Set height for g_parent_html
    CALL METHOD dg_splitter-&amp;gt;set_row_height
      EXPORTING
        id     = 1
        height = 25.
* Create an instance of alv control
    CREATE OBJECT dg_grid1
          EXPORTING i_appl_events = c_x
                    i_parent = dg_parent_grid.
* Registering events
    CREATE OBJECT dg_event_receiver.
    SET HANDLER dg_event_receiver-&amp;gt;top_of_page FOR dg_grid1.
    SET HANDLER dg_event_receiver-&amp;gt;handle_top_of_page FOR dg_grid1.
    SET HANDLER dg_event_receiver-&amp;gt;handle_end_of_list FOR dg_grid1.

* Grid display
    CALL METHOD dg_grid1-&amp;gt;set_table_for_first_display
             EXPORTING
               i_structure_name = 'TP_FINAL'
               is_layout        = ds_layout
             CHANGING
                it_fieldcatalog  = dg_fieldcatalog[]
                it_outtab        = dt_final.

* Initializing document
    CALL METHOD dg_dyndoc_id-&amp;gt;initialize_document.

* Processing events
    CALL METHOD dg_grid1-&amp;gt;list_processing_events
                      EXPORTING i_event_name = 'TOP_OF_PAGE'
                                i_dyndoc_id  = dg_dyndoc_id.


  ENDIF.
* Setting focus for created grid control
  CALL METHOD cl_gui_control=&amp;gt;set_focus EXPORTING control = dg_grid1.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you.&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Siri.&lt;/P&gt;&lt;P&gt;Kindly awrd points if it is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Srilatha T&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Dec 2005 09:21:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-12-07T09:21:05Z</dc:date>
    <item>
      <title>top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028539#M83083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to display top of page using ALV class but I could not get it, its not displaying anything.&lt;/P&gt;&lt;P&gt;any one's help is greatly appreciated.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Giri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 05:06:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028539#M83083</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T05:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028540#M83084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In OOPS world u have to use Event handler for class "cl_gui_alv_grid" and event name is "print_top_of_page".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see link&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_bw30b/helpdata/en/ee/c8e06bd52611d2b468006094192fe3/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_bw30b/helpdata/en/ee/c8e06bd52611d2b468006094192fe3/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sample code&lt;/P&gt;&lt;P&gt;BCALV_GRID_01 in se38&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 05:09:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028540#M83084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T05:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028541#M83085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi giri,&lt;/P&gt;&lt;P&gt;U can give ur display text inside ur Top-of-page event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Top-of-page.&lt;/P&gt;&lt;P&gt;write:/ 'hai'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This displays ur text in the top of the page.&lt;/P&gt;&lt;P&gt;Hope tihs helps u,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagarajan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 05:10:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028541#M83085</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T05:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028542#M83086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi IN OO you should use COmentry write fm.&lt;/P&gt;&lt;P&gt;it should work.....&lt;/P&gt;&lt;P&gt;IN top of page event use that FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 05:10:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028542#M83086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T05:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028543#M83087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only when the first write statement is encountered the TOP OF PAGE is triggered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you donot have any write statements the the top of page will never be triggered.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 05:11:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028543#M83087</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T05:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028544#M83088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;I fonud this code somewhee in forum, which shows use f top of page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz reward point if it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you also can visit this links&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="897585"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="799569"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Report  ZDEMO_ALVGRID                                               *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp; Example of a simple ALV Grid Report                                 *&lt;/P&gt;&lt;P&gt;*&amp;amp; ...................................                                 *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp; The basic requirement for this demo is to display a number of       *&lt;/P&gt;&lt;P&gt;*&amp;amp; fields from the EKKO table.                                         *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  zdemo_alvgrid                 .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;TABLES:     ekko.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;type-pools: slis.                                 "ALV Declarations&lt;/P&gt;&lt;P&gt;*Data Declaration&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------" /&gt;&lt;P&gt;TYPES: BEGIN OF t_ekko,&lt;/P&gt;&lt;P&gt;  ebeln TYPE ekpo-ebeln,&lt;/P&gt;&lt;P&gt;  ebelp TYPE ekpo-ebelp,&lt;/P&gt;&lt;P&gt;  statu TYPE ekpo-statu,&lt;/P&gt;&lt;P&gt;  aedat TYPE ekpo-aedat,&lt;/P&gt;&lt;P&gt;  matnr TYPE ekpo-matnr,&lt;/P&gt;&lt;P&gt;  menge TYPE ekpo-menge,&lt;/P&gt;&lt;P&gt;  meins TYPE ekpo-meins,&lt;/P&gt;&lt;P&gt;  netpr TYPE ekpo-netpr,&lt;/P&gt;&lt;P&gt;  peinh TYPE ekpo-peinh,&lt;/P&gt;&lt;P&gt; END OF t_ekko.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,&lt;/P&gt;&lt;P&gt;      wa_ekko TYPE t_ekko.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*ALV data declarations&lt;/P&gt;&lt;P&gt;data: fieldcatalog type slis_t_fieldcat_alv with header line,&lt;/P&gt;&lt;P&gt;      gd_tab_group type slis_t_sp_group_alv,&lt;/P&gt;&lt;P&gt;      gd_layout    type slis_layout_alv,&lt;/P&gt;&lt;P&gt;      gd_repid     like sy-repid,&lt;/P&gt;&lt;P&gt;      gt_events     type slis_t_event,&lt;/P&gt;&lt;P&gt;      gd_prntparams type slis_print_alv.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*Start-of-selection.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;perform data_retrieval.&lt;/P&gt;&lt;P&gt;perform build_fieldcatalog.&lt;/P&gt;&lt;P&gt;perform build_layout.&lt;/P&gt;&lt;P&gt;perform build_events.&lt;/P&gt;&lt;P&gt;perform build_print_params.&lt;/P&gt;&lt;P&gt;perform display_alv_report.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BUILD_FIELDCATALOG&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Build Fieldcatalog for ALV Report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;There are a number of ways to create a fieldcat. &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;For the purpose of this example i will build the fieldcatalog manualy&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;by populating the internal table fields individually and then &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;appending the rows. This method can be the most time consuming but can&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;also allow you  more control of the final product.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Beware though, you need to ensure that all fields required are&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;populated. When using some of functionality available via ALV, such as&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;total. You may need to provide more information than if you were &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;simply displaying the result&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;              I.e. Field type may be required in-order for&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                   the 'TOTAL' function to work.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'EBELN'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Purchase Order'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 0.&lt;/P&gt;&lt;P&gt;  fieldcatalog-outputlen   = 10.&lt;/P&gt;&lt;P&gt;  fieldcatalog-emphasize   = 'X'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-key         = 'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-do_sum      = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; fieldcatalog-no_zero     = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'EBELP'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'PO Item'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 1.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'STATU'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Status'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 2.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'AEDAT'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Item change date'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 3.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'MATNR'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Material Number'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 4.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'MENGE'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'PO quantity'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 5.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'MEINS'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Order Unit'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 6.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'NETPR'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Net Price'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 7.&lt;/P&gt;&lt;P&gt;  fieldcatalog-outputlen   = 15.&lt;/P&gt;&lt;P&gt;  fieldcatalog-datatype     = 'CURR'.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  fieldcatalog-fieldname   = 'PEINH'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-seltext_m   = 'Price Unit'.&lt;/P&gt;&lt;P&gt;  fieldcatalog-col_pos     = 8.&lt;/P&gt;&lt;P&gt;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt;endform.                    " BUILD_FIELDCATALOG&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BUILD_LAYOUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Build layout for ALV grid report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_layout.&lt;/P&gt;&lt;P&gt;  gd_layout-no_input          = 'X'.&lt;/P&gt;&lt;P&gt;  gd_layout-colwidth_optimize = 'X'.&lt;/P&gt;&lt;P&gt;  gd_layout-totals_text       = 'Totals'(201).&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; gd_layout-totals_only        = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; gd_layout-f2code            = 'DISP'.  "Sets fcode for when double&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                                        "click(press f2)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; gd_layout-zebra             = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; gd_layout-group_change_edit = 'X'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; gd_layout-header_text       = 'helllllo'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;endform.                    " BUILD_LAYOUT&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  DISPLAY_ALV_REPORT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Display report using ALV grid&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form display_alv_report.&lt;/P&gt;&lt;P&gt;  gd_repid = sy-repid.&lt;/P&gt;&lt;P&gt;  call function 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;       exporting&lt;/P&gt;&lt;P&gt;            i_callback_program      = gd_repid&lt;/P&gt;&lt;P&gt;            i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM&lt;/P&gt;&lt;P&gt;            i_callback_user_command = 'USER_COMMAND'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           i_grid_title           = outtext&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            is_layout               = gd_layout&lt;/P&gt;&lt;P&gt;            it_fieldcat             = fieldcatalog[]&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           it_special_groups       = gd_tabgroup&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            it_events               = gt_events  &lt;/P&gt;&lt;P&gt;            is_print                = gd_prntparams  &lt;/P&gt;&lt;P&gt;            i_save                  = 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           is_variant              = z_template&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       tables&lt;/P&gt;&lt;P&gt;            t_outtab                = it_ekko&lt;/P&gt;&lt;P&gt;       exceptions&lt;/P&gt;&lt;P&gt;            program_error           = 1&lt;/P&gt;&lt;P&gt;            others                  = 2.&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endform.                    " DISPLAY_ALV_REPORT&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  DATA_RETRIEVAL&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Retrieve data form EKPO table and populate itab it_ekko&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form data_retrieval.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;select ebeln ebelp statu aedat matnr menge meins netpr peinh&lt;/P&gt;&lt;P&gt; up to 10 rows&lt;/P&gt;&lt;P&gt;  from ekpo&lt;/P&gt;&lt;P&gt;  into table it_ekko.&lt;/P&gt;&lt;P&gt;endform.                    " DATA_RETRIEVAL&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Form  TOP-OF-PAGE                                                 *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ALV Report Header                                                 *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Form top-of-page.&lt;/P&gt;&lt;P&gt;*ALV Header declarations&lt;/P&gt;&lt;P&gt;data: t_header type slis_t_listheader,&lt;/P&gt;&lt;P&gt;      wa_header type slis_listheader,&lt;/P&gt;&lt;P&gt;      t_line like wa_header-info,&lt;/P&gt;&lt;P&gt;      ld_lines type i,&lt;/P&gt;&lt;P&gt;      ld_linesc(10) type c.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Title&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  wa_header-typ  = 'H'.&lt;/P&gt;&lt;P&gt;  wa_header-info = 'EKKO Table Report'.&lt;/P&gt;&lt;P&gt;  append wa_header to t_header.&lt;/P&gt;&lt;P&gt;  clear wa_header.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Date&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  wa_header-typ  = 'S'.&lt;/P&gt;&lt;P&gt;  wa_header-key = 'Date: '.&lt;/P&gt;&lt;P&gt;  CONCATENATE  sy-datum+6(2) '.'&lt;/P&gt;&lt;P&gt;               sy-datum+4(2) '.'&lt;/P&gt;&lt;P&gt;               sy-datum(4) INTO wa_header-info.   "todays date&lt;/P&gt;&lt;P&gt;  append wa_header to t_header.&lt;/P&gt;&lt;P&gt;  clear: wa_header.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Total No. of Records Selected&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  describe table it_ekko lines ld_lines.&lt;/P&gt;&lt;P&gt;  ld_linesc = ld_lines.&lt;/P&gt;&lt;P&gt;  concatenate 'Total No. of Records Selected: ' ld_linesc&lt;/P&gt;&lt;P&gt;                    into t_line separated by space.&lt;/P&gt;&lt;P&gt;  wa_header-typ  = 'A'.&lt;/P&gt;&lt;P&gt;  wa_header-info = t_line.&lt;/P&gt;&lt;P&gt;  append wa_header to t_header.&lt;/P&gt;&lt;P&gt;  clear: wa_header, t_line.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  call function 'REUSE_ALV_COMMENTARY_WRITE'&lt;/P&gt;&lt;P&gt;       exporting&lt;/P&gt;&lt;P&gt;            it_list_commentary = t_header.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           i_logo             = 'Z_LOGO'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      FORM USER_COMMAND                                          *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      --&amp;gt; R_UCOMM                                                *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      --&amp;gt; RS_SELFIELD                                            *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM user_command USING r_ucomm LIKE sy-ucomm&lt;/P&gt;&lt;P&gt;                  rs_selfield TYPE slis_selfield.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check function code&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CASE r_ucomm.&lt;/P&gt;&lt;P&gt;    WHEN '&amp;amp;IC1'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Check field clicked on within ALVgrid report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF rs_selfield-fieldname = 'EBELN'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Read data table, using index of row user clicked on&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Set parameter ID for transaction screen field&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Sxecute transaction ME23N, and skip initial data entry screen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BUILD_EVENTS&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Build events table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_events.&lt;/P&gt;&lt;P&gt;  data: ls_event type slis_alv_event.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  call function 'REUSE_ALV_EVENTS_GET'&lt;/P&gt;&lt;P&gt;       exporting&lt;/P&gt;&lt;P&gt;            i_list_type = 0&lt;/P&gt;&lt;P&gt;       importing&lt;/P&gt;&lt;P&gt;            et_events   = gt_events[].&lt;/P&gt;&lt;P&gt;  read table gt_events with key name =  slis_ev_end_of_page&lt;/P&gt;&lt;P&gt;                           into ls_event.&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    move 'END_OF_PAGE' to ls_event-form.&lt;/P&gt;&lt;P&gt;    append ls_event to gt_events.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    read table gt_events with key name =  slis_ev_end_of_list&lt;/P&gt;&lt;P&gt;                           into ls_event.&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    move 'END_OF_LIST' to ls_event-form.&lt;/P&gt;&lt;P&gt;    append ls_event to gt_events.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endform.                    " BUILD_EVENTS&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BUILD_PRINT_PARAMS&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Setup print parameters&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_print_params.&lt;/P&gt;&lt;P&gt;  gd_prntparams-reserve_lines = '3'.   "Lines reserved for footer&lt;/P&gt;&lt;P&gt;  gd_prntparams-no_coverpage = 'X'.&lt;/P&gt;&lt;P&gt;endform.                    " BUILD_PRINT_PARAMS&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  END_OF_PAGE&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form END_OF_PAGE.&lt;/P&gt;&lt;P&gt;  data: listwidth type i,&lt;/P&gt;&lt;P&gt;        ld_pagepos(10) type c,&lt;/P&gt;&lt;P&gt;        ld_page(10)    type c.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  write: sy-uline(50).&lt;/P&gt;&lt;P&gt;  skip.&lt;/P&gt;&lt;P&gt;  write:/40 'Page:', sy-pagno .&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  END_OF_LIST&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form END_OF_LIST.&lt;/P&gt;&lt;P&gt;  data: listwidth type i,&lt;/P&gt;&lt;P&gt;        ld_pagepos(10) type c,&lt;/P&gt;&lt;P&gt;        ld_page(10)    type c.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  skip.&lt;/P&gt;&lt;P&gt;  write:/40 'Page:', sy-pagno .&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 05:12:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028544#M83088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T05:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028545#M83089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Giri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Write Statements will not work, Use &lt;/P&gt;&lt;P&gt;REUSE_ALV_COMMENTARY_WRITE in top of page..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 05:18:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028545#M83089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T05:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028546#M83090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There is an event &amp;lt;b&amp;gt;TOP_OF_PAGE&amp;lt;/b&amp;gt; in cl_gui_alv_grid class . You need define and implement in local class and set the handler for the grid , then it trigger ..&lt;/P&gt;&lt;P&gt;But in that no write statements possible. you need to use reuse_alv_comnetry_write for that...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check it once..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 05:22:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028546#M83090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T05:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028547#M83091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your response but I tried something what vijay said.. see the code below but still doesn't show up top of page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_event_receiver DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;    handle_top_of_page&lt;/P&gt;&lt;P&gt;        FOR EVENT top_of_page OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;           IMPORTING e_dyndoc_id,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_event_receiver IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD handle_top_of_page.&lt;/P&gt;&lt;P&gt;    PERFORM alv_topof_page.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt; CREATE OBJECT g_event_receiver.&lt;/P&gt;&lt;P&gt;  SET HANDLER g_event_receiver-&amp;gt;handle_top_of_page FOR grid.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 05:29:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028547#M83091</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T05:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028548#M83092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Giri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What are you doing in that top of page ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you tell me..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 05:36:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028548#M83092</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T05:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028549#M83093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Try to PASS these parameters&lt;/P&gt;&lt;P&gt;handle_top_of_page&lt;/P&gt;&lt;P&gt;FOR EVENT top_of_page OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;importing &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;E_DYNDOC_ID&lt;/P&gt;&lt;P&gt;TABLE_INDEX&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 05:39:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028549#M83093</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T05:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028550#M83094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you can paa the info to E_DYNDOC_ID parameter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then it will be done..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 05:40:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028550#M83094</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T05:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028551#M83095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I got a solution For you..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you check the Program &amp;lt;b&amp;gt;BCALV_TEST_GRID_EVENTS&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;properly there they Implemented all the events..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There they Mentioned the same...&lt;/P&gt;&lt;P&gt;check it for your implementation&lt;/P&gt;&lt;P&gt;check the Program , if you are unable to find the program..&lt;/P&gt;&lt;P&gt;please let me know..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 05:49:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028551#M83095</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T05:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028552#M83096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Giri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Reward if my suggestion really helps you...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 05:51:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028552#M83096</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T05:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028553#M83097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just trying to display this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: t_header TYPE slis_t_listheader,&lt;/P&gt;&lt;P&gt;        wa_header TYPE slis_listheader.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Title&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  wa_header-typ = 'H'.&lt;/P&gt;&lt;P&gt;  wa_header-info = 'EE Lien Report'.&lt;/P&gt;&lt;P&gt;  APPEND wa_header TO t_header.&lt;/P&gt;&lt;P&gt;  CLEAR wa_header.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            it_list_commentary = t_header.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  I_LOGO                   =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  I_END_OF_LIST_GRID       =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 05:52:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028553#M83097</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T05:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028554#M83098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Use the logic which is mentioned in &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;BCALV_TEST_GRID_EVENTS&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it will work...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 06:00:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028554#M83098</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T06:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028555#M83099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi If your Problem solves&lt;/P&gt;&lt;P&gt;please close the thread, and reward points for helful answers...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 06:32:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028555#M83099</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T06:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028556#M83100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;after trying these still does not work.please help me on this&lt;/P&gt;&lt;P&gt;thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 07:15:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028556#M83100</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T07:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028557#M83101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what exactly you need to show..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried it is not triggering that event.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 08:09:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028557#M83101</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T08:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: top-of-page in oo ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028558#M83102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All I wanted to dispaly like &lt;/P&gt;&lt;P&gt;partner no:&lt;/P&gt;&lt;P&gt;name:&lt;/P&gt;&lt;P&gt;company:&lt;/P&gt;&lt;P&gt;date:     &lt;/P&gt;&lt;P&gt;based on some condition i wanted to show/hide.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reply me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2005 08:26:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/top-of-page-in-oo-alv/m-p/1028558#M83102</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-07T08:26:10Z</dc:date>
    </item>
  </channel>
</rss>

