<?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 ALV in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3097469#M734889</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to display a text heading in Top of Page in ALV..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to work in top of page in ALV...Cananyone tell me how to proceed..Plz give code reference&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Nov 2007 05:48:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-23T05:48:39Z</dc:date>
    <item>
      <title>ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3097469#M734889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to display a text heading in Top of Page in ALV..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to work in top of page in ALV...Cananyone tell me how to proceed..Plz give code reference&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2007 05:48:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3097469#M734889</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-23T05:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3097470#M734890</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;Refer this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data :   it_fieldcat  TYPE slis_t_fieldcat_alv WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;              it_events TYPE slis_t_event,&lt;/P&gt;&lt;P&gt;               it_header TYPE slis_t_listheader.&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  sub_create_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; This form will display the ALV Events                               *&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 sub_create_events .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Local Work Area&lt;/P&gt;&lt;P&gt;  DATA: lwa_event TYPE slis_alv_event.    "Work area for Events&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Call Function to display the events for the ALV&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 = 1&lt;/P&gt;&lt;P&gt;       IMPORTING&lt;/P&gt;&lt;P&gt;            et_events   = it_events.&lt;/P&gt;&lt;P&gt;*--Sort by Name&lt;/P&gt;&lt;P&gt;  SORT it_events BY name.&lt;/P&gt;&lt;P&gt;*--Clear&lt;/P&gt;&lt;P&gt;  CLEAR lwa_event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE it_events INTO lwa_event WITH KEY name =&lt;/P&gt;&lt;P&gt;slis_ev_top_of_page&lt;/P&gt;&lt;P&gt;                                               BINARY SEARCH.&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    MOVE c_top_of_page TO lwa_event-form.&lt;/P&gt;&lt;P&gt;    MODIFY it_events FROM lwa_event TRANSPORTING form WHERE&lt;/P&gt;&lt;P&gt;     name = slis_ev_top_of_page.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;*--Clear&lt;/P&gt;&lt;P&gt;  CLEAR : lwa_event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                                  "sub_create_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  sub_top_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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; This form is to build the Page 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 sub_top_of_page .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Local Variable&lt;/P&gt;&lt;P&gt;  DATA : lv_title(120) TYPE c,                  " Title&lt;/P&gt;&lt;P&gt;         lv_month(30)  TYPE c,&lt;/P&gt;&lt;P&gt;         lv_mont(30)   TYPE c,&lt;/P&gt;&lt;P&gt;         lv_bud(16)    TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Local Work Area&lt;/P&gt;&lt;P&gt;  DATA : lwa_line TYPE slis_listheader.  " Hold list header&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; CONCATENATE p_month 'to' s_hmonth INTO lv_month SEPARATED BY space.&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; IF NOT s_hmonth IS INITIAL.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   lv_mont = lv_month.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; ELSE.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  lv_mont = p_month.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Title  Display&lt;/P&gt;&lt;P&gt;  lwa_line-typ = 'H'.               " header&lt;/P&gt;&lt;P&gt;  lv_title = sy-title.&lt;/P&gt;&lt;P&gt;  lwa_line-info = lv_title.&lt;/P&gt;&lt;P&gt;  APPEND lwa_line TO it_header.&lt;/P&gt;&lt;P&gt;  CLEAR lwa_line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Month Display&lt;/P&gt;&lt;P&gt;  lwa_line-typ  = 'S'.                " Item&lt;/P&gt;&lt;P&gt;  WRITE: lv_mont TO lv_month.&lt;/P&gt;&lt;P&gt;  lwa_line-key = text-024.&lt;/P&gt;&lt;P&gt;  lwa_line-info = lv_month.&lt;/P&gt;&lt;P&gt;  APPEND lwa_line TO it_header.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Budget Display&lt;/P&gt;&lt;P&gt;  lwa_line-typ  = 'S'.                " Item&lt;/P&gt;&lt;P&gt;  WRITE: p_bud TO lv_bud.&lt;/P&gt;&lt;P&gt;  lwa_line-key = text-025.&lt;/P&gt;&lt;P&gt;  lwa_line-info = lv_bud.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND lwa_line TO it_header.&lt;/P&gt;&lt;P&gt;  CLEAR: lwa_line,&lt;/P&gt;&lt;P&gt;         lv_mont.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--This funcation module will display the top of the page&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 = it_header.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Free&lt;/P&gt;&lt;P&gt;  FREE : it_header.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    "sub_top_of_page&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2007 05:50:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3097470#M734890</guid>
      <dc:creator>former_member386202</dc:creator>
      <dc:date>2007-11-23T05:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3097471#M734891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sample ALV: Heading in ALV &lt;/P&gt;&lt;P&gt;With Compliments by: Ulhas Sonawane &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report zus_alv_demo_grid .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables:     ekko.&lt;/P&gt;&lt;P&gt;type-pools: slis.&lt;/P&gt;&lt;P&gt;&lt;/P&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;line_color(4) type c, "Used to store row color&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;&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;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Data declaration for EVENT and PRINT PARAMETER.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data: 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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;data declaration for sorting.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data : it_sortcat   type slis_sortinfo_alv occurs 1,&lt;/P&gt;&lt;P&gt;       wa_sort like line of it_sortcat.&lt;/P&gt;&lt;P&gt;data :  i_list_comments type slis_t_listheader.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;  perform data_retrieval.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; perform user_command.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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 build_sortcat.&lt;/P&gt;&lt;P&gt;  perform display_alv_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*TOP-OF-PAGE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; PERFORM top-of-page.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end-of-page.&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------" /&gt;&lt;P&gt;*&amp;amp;      Form  build_fieldcatalog&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------" /&gt;&lt;P&gt;form build_fieldcatalog.&lt;/P&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;  append fieldcatalog to fieldcatalog.&lt;/P&gt;&lt;P&gt;  clear  fieldcatalog.&lt;/P&gt;&lt;P&gt;&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;&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;  fieldcatalog-do_sum = 'X'.&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;&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;&lt;/P&gt;&lt;P&gt;endform.                    " build_fieldcatalog&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------" /&gt;&lt;P&gt;*&amp;amp;      Form  build_layout&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------" /&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;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Set layout field for row attributes(i.e. color)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  gd_layout-info_fieldname =      'LINE_COLOR'.&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&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*when double&lt;/P&gt;&lt;UL&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-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;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------" /&gt;&lt;P&gt;*&amp;amp;      Form  data_retrieval&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------" /&gt;&lt;P&gt;form data_retrieval.&lt;/P&gt;&lt;P&gt;  data: ld_color(1) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select ebeln ebelp statu aedat matnr menge meins netpr&lt;/P&gt;&lt;P&gt;peinh from ekpo  into table it_ekko.&lt;/P&gt;&lt;P&gt;*Populate field with color attributes&lt;/P&gt;&lt;P&gt;  loop at it_ekko into wa_ekko.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Populate color variable with colour properties&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Char 1 = C (This is a color property)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Char 2 = 3 (Color codes: 1 - 7)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Char 3 = Intensified on/off ( 1 or 0 )&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Char 4 = Inverse display on/off ( 1 or 0 )&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          i.e. wa_ekko-line_color = 'C410'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ld_color = ld_color + 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Only 7 colours so need to reset color value&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    if ld_color = 8.&lt;/P&gt;&lt;P&gt;      ld_color = 1.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    concatenate 'C' ld_color '10' into wa_ekko-line_color.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;wa_ekko-line_color = 'C410'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    modify it_ekko from wa_ekko.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " data_retrieval&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------" /&gt;&lt;P&gt;*&amp;amp;      Form  display_alv_report&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------" /&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;            is_layout                = gd_layout&lt;/P&gt;&lt;P&gt;            i_callback_top_of_page   = 'TOP-OF-PAGE'&lt;/P&gt;&lt;P&gt;            i_callback_user_command  = 'USER_COMMAND'&lt;/P&gt;&lt;P&gt;            i_callback_pf_status_set = 'SET_PF_STATUS'&lt;/P&gt;&lt;P&gt;            it_event                 = gt_events&lt;/P&gt;&lt;P&gt;            is_print                 = gd_prntparams&lt;/P&gt;&lt;P&gt;            it_fieldcat              = fieldcatalog[]&lt;/P&gt;&lt;P&gt;            it_sort                 = it_sortcat&lt;/P&gt;&lt;P&gt;            i_save                   = 'X'&lt;/P&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;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------" /&gt;&lt;P&gt;*&amp;amp;      Form  user_command&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------" /&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------" /&gt;&lt;P&gt;*&amp;amp;      Form  top-of-page&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------------" /&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;&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;&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;P&gt;       i_logo             = 'GANESH_LOGO'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " top-of-page&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;      ........                                                      *&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;  case r_ucomm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    when '&amp;amp;IC1'.&lt;/P&gt;&lt;P&gt;      if rs_selfield-fieldname = 'EBELN'.&lt;/P&gt;&lt;P&gt;        read table it_ekko into wa_ekko index rs_selfield-tabindex.&lt;/P&gt;&lt;P&gt;        set parameter id 'BES' field wa_ekko-ebeln.&lt;/P&gt;&lt;P&gt;        call transaction 'ME23N' and skip first screen.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    when 'ULHAS'.&lt;/P&gt;&lt;P&gt;      if rs_selfield-fieldname = 'EBELN'.&lt;/P&gt;&lt;P&gt;        read table it_ekko into wa_ekko index rs_selfield-tabindex.&lt;/P&gt;&lt;P&gt;        set parameter id 'BES' field wa_ekko-ebeln.&lt;/P&gt;&lt;P&gt;        call transaction 'ME23N' and skip first screen.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&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 set_pf_status                                            *&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;      ........                                                      *&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;  RT_EXTAB                                                      *&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 set_pf_status using rt_extab type slis_t_extab.&lt;/P&gt;&lt;P&gt;  set pf-status 'ZNEWSTATUS'.&lt;/P&gt;&lt;P&gt;endform.&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;      text&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;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&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;  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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  LIST_TYPE_WRONG       = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OTHERS                = 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            .&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;  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;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;      text&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;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&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;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 END_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;      ........                                                      *&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 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;  write: sy-uline(50).&lt;/P&gt;&lt;P&gt;  skip.  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;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 END_OF_LIST                                              *&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;      ........                                                      *&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 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;  skip.  write:/40 'Page:', sy-pagno .&lt;/P&gt;&lt;P&gt;endform.&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_sortcat&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;      text&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;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&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_sortcat.&lt;/P&gt;&lt;P&gt;wa_sort-spos      = 1.&lt;/P&gt;&lt;P&gt;wa_sort-fieldname = 'EBELN'.&lt;/P&gt;&lt;P&gt;append wa_sort to it_sortcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_sort-spos      = 2.&lt;/P&gt;&lt;P&gt;wa_sort-fieldname = 'EBELP'.&lt;/P&gt;&lt;P&gt;append wa_sort to it_sortcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " build_sortcat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2007 05:52:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3097471#M734891</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-23T05:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3097472#M734892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mahesh,&lt;/P&gt;&lt;P&gt;Go thru this BLOG&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/people/community.user/blog/2007/05/07/alignment-of-data-in-top-of-page-in-alv-grid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2007 05:52:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3097472#M734892</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-23T05:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3097473#M734893</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;see this sample program where you can understand very easily how  we can handle TOP-OF-pAGE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOGO inserting and text &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  ztest_alv_logo.

TYPE-POOLS : slis.

*ALV Formatting tables /structures
DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.
DATA: gt_events   TYPE slis_t_event.
DATA: gs_layout   TYPE slis_layout_alv.
DATA: gt_page     TYPE slis_t_listheader.
DATA: gs_page     TYPE slis_listheader.
DATA: v_repid     LIKE sy-repid.

*ALV Formatting work area
DATA: w_fieldcat TYPE slis_fieldcat_alv.
DATA: w_events   TYPE slis_alv_event.

DATA: gt_bsid TYPE TABLE OF bsid WITH HEADER LINE.

INITIALIZATION.

  PERFORM build_events.
  PERFORM build_page_header.

START-OF-SELECTION.
*perform build_comment.     "top_of_page - in initialization at present

  SELECT * FROM bsid INTO TABLE gt_bsid UP TO 10 ROWS.

*perform populate_for_fm using '1' '3' 'BUKRS' '8' 'GT_BSID' 'Whee'.
*USING = Row, Column, Field name, display length, table name, heading

*OR
  PERFORM build_fieldcat.
  gs_layout-zebra = 'X'.


*top of page event does not work without I_callback_program
  v_repid = sy-repid.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program                = v_repid
      i_structure_name                  = 'BSID'
*    i_background_id                   = 'ALV_BACKGROUND'
      i_grid_title                      = 'This is the grid title'
*   I_GRID_SETTINGS                   =
      is_layout                         = gs_layout
      it_fieldcat                       = gt_fieldcat[]
      it_events                         = gt_events[]
    TABLES
      t_outtab                          = gt_bsid.

************************************************************************

* Form..............:  populate_for_fm
* Description.......:  Populates fields for function module used in ALV
************************************************************************

FORM populate_for_fm USING p_row
                           p_col
                           p_fieldname
                           p_len
                           p_table
                           p_desc.

  w_fieldcat-row_pos      = p_row.          "Row Position
  w_fieldcat-col_pos      = p_col.          "Column Position
  w_fieldcat-fieldname    = p_fieldname.    "Field name
  w_fieldcat-outputlen    = p_len.          "Column Lenth
  w_fieldcat-tabname      = p_table.        "Table name
  w_fieldcat-reptext_ddic = p_desc.         "Field Description
  w_fieldcat-input        = '1'.
  APPEND w_fieldcat TO gt_fieldcat.
  CLEAR w_fieldcat.

ENDFORM.                    " populate_for_fm
*&amp;amp;---------------------------------------------------------------------*

*&amp;amp;      Form  build_events
*&amp;amp;---------------------------------------------------------------------*

FORM build_events.
  DATA: ls_event TYPE slis_alv_event.

  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      i_list_type = 0
    IMPORTING
      et_events   = gt_events.

  READ TABLE gt_events
             WITH KEY name =  slis_ev_user_command
             INTO ls_event.
  IF sy-subrc = 0.
    MOVE slis_ev_user_command TO ls_event-form.
    APPEND ls_event TO gt_events.
  ENDIF.
  READ TABLE gt_events
             WITH KEY name =  slis_ev_top_of_page
             INTO ls_event.
  IF sy-subrc = 0.
    MOVE slis_ev_top_of_page TO ls_event-form.
    APPEND ls_event TO gt_events.
  ENDIF.

ENDFORM.                    " build_events
*&amp;amp;---------------------------------------------------------------------*

*&amp;amp;      Form  USER_COMMAND
*&amp;amp;---------------------------------------------------------------------*

* When user command is called it uses 2 parameters. The itab
* passed to the ALV is in whatever order it currently is on screen.
* Therefore, you can read table itab index rs_selfield-tabindex to get
* all data from the table. You can also check r_ucomm and code
* accordingly.
*&amp;amp;---------------------------------------------------------------------*

FORM user_command USING  r_ucomm     LIKE sy-ucomm
                         rs_selfield TYPE slis_selfield.

  READ TABLE gt_bsid INDEX rs_selfield-tabindex.
* error checking etc.
  SET PARAMETER ID 'KUN' FIELD gt_bsid-kunnr.
  CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
ENDFORM.                    "user_command
*&amp;amp;---------------------------------------------------------------------*

*&amp;amp;      Form  top_of_page
*&amp;amp;---------------------------------------------------------------------*

* Your own company logo can go here if it has been saved (OAOR)
* If the logo is larger than the size of the headings in gt_page,
* the window will not show full logo and will have a scroll bar. Thus,
* it is a good idea to have a standard ALV header if you are going to
* use logos in your top of page.
*&amp;amp;---------------------------------------------------------------------*

FORM top_of_page.

  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary = gt_page
      i_logo             = 'ENJOYSAP_LOGO'.
ENDFORM.                    "top_of_page
*&amp;amp;---------------------------------------------------------------------*

*&amp;amp;      Form  build_fieldcat
*&amp;amp;---------------------------------------------------------------------*

*Many and varied fields are available here. Have a look at documentation

*for FM REUSE_ALV_LIST_DISPLAY and REUSE_ALV_FIELDCATALOG_MERGE
*----------------------------------------------------------------------*

FORM build_fieldcat.
  w_fieldcat-fieldname  = 'BUDAT'.
  w_fieldcat-seltext_m  = 'Dte pst'.
  w_fieldcat-ddictxt(1) = 'M'.
  w_fieldcat-edit = 'x'.
* Can change the position of fields if you do not want them in order
* of the DDIC or itab

*  w_fieldcat-row_pos = '1'.
*  w_fieldcat-col_pos = '10'.
  APPEND w_fieldcat TO gt_fieldcat.
  CLEAR w_fieldcat.

ENDFORM.                    " build_fieldcat
*&amp;amp;---------------------------------------------------------------------*

*&amp;amp;      Form  build_page_header
*&amp;amp;---------------------------------------------------------------------*

*       gt_page is used in top of page (ALV subroutine - NOT event)
*       *H = Header, S = Selection, A = Action
*----------------------------------------------------------------------*

FORM build_page_header.
* For Headers, Key is not printed and is irrelevant. Will not cause
* a syntax error, but is not used.
  gs_page-typ  = 'H'.
  gs_page-info = 'Header 1'.
  APPEND gs_page TO gt_page.

  gs_page-typ  = 'H'.
  gs_page-info = 'Header 2'.
  APPEND gs_page TO gt_page.

* For Selections, the Key is printed (bold). It can be anything up to 20

* bytes. It gets printed in order of code here, not by key value.
  gs_page-typ  = 'S'.
  gs_page-key  = 'And the winner is:'.
  gs_page-info = 'Selection 1'.
  APPEND gs_page TO gt_page.

  gs_page-typ  = 'S'.
  gs_page-key  = 'Runner up:'.
  gs_page-info = 'Selection 2'.
  APPEND gs_page TO gt_page.

* For Action, Key is also irrelevant.
  gs_page-typ  = 'A'.
  gs_page-info = 'Action goes here'.
  APPEND gs_page TO gt_page.

ENDFORM.                    " build_page_header&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Nov 2007 05:52:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3097473#M734893</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-23T05:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3097474#M734894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for ur efforts&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Nov 2007 12:50:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3097474#M734894</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-26T12:50:26Z</dc:date>
    </item>
  </channel>
</rss>

