<?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: ALV in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2488986#M561616</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001
       no standard page heading.

* Global ALV Data Declarations
type-pools slis.

data: begin of i_alv occurs 0,
      matnr type mara-matnr,
      end of i_alv.

* Miscellanous Data Declarations
data: fieldcat type slis_t_fieldcat_alv,
      events   type slis_t_event,
      list_top_of_page type slis_t_listheader,
      top_of_page  type slis_formname value 'TOP_OF_PAGE'.


start-of-selection.

  perform initialization.
  perform get_data.
  perform call_alv.

end-of-selection.

************************************************************************
*  Form  Initialization
************************************************************************
form initialization.

  clear i_alv.       refresh i_alv.

  perform eventtab_build using events[].

endform.

************************************************************************
*  Form  Get_Data
************************************************************************
form  get_data.

  select matnr into table i_alv
              from mara up to 100 rows.

endform.

************************************************************************
*  CALL_ALV
************************************************************************
form call_alv.

  data: variant type  disvariant.
  data: repid type sy-repid.

  repid = sy-repid.
  variant-report = sy-repid.
  variant-username = sy-uname.

  perform build_field_catalog.

  perform comment_build using list_top_of_page[].

* Call ABAP List Viewer (ALV)
  call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
            it_fieldcat        = fieldcat
            i_callback_program = repid
            is_variant         = variant
            it_events          = events[]
            i_save             = 'U'
       tables
            t_outtab           = i_alv.

endform.

************************************************************************
* EVENTTAB_BUILD
************************************************************************
form eventtab_build using events type slis_t_event.

* Registration of events to happen during list display
  data: tmp_event type slis_alv_event.

  call function 'REUSE_ALV_EVENTS_GET'
       exporting
            i_list_type = 0
       importing
            et_events   = events.
  read table events with key name = slis_ev_top_of_page
                           into tmp_event.
  if sy-subrc = 0.
    move top_of_page to tmp_event-form.
    append tmp_event to events.
  endif.

endform.

************************************************************************
* BUILD_FIELD_CATALOG
************************************************************************
form build_field_catalog.

  clear: fieldcat. refresh: fieldcat.

  data: tmp_fc type slis_fieldcat_alv.

  tmp_fc-reptext_ddic = 'Material'.
  tmp_fc-fieldname    = 'MATNR'.
  tmp_fc-tabname      = 'I_ALV'.
  tmp_fc-outputlen    = 18.
  append tmp_fc to fieldcat.

endform.

************************************************************************
* COMMENT_BUILD
************************************************************************
form comment_build using list_top_of_page type
                                        slis_t_listheader.
  data: tmp_line type slis_listheader.

  clear tmp_line.
  tmp_line-typ  = 'H'.
  tmp_line-info = 'Your Report'.
  append tmp_line to list_top_of_page.

  clear tmp_line.
  tmp_line-typ  = 'S'.
  tmp_line-key  = 'Date'.
  write sy-datum to tmp_line-info.
  append tmp_line to list_top_of_page.

  clear tmp_line.
  tmp_line-typ  = 'S'.
  tmp_line-key  = 'Time'.
  write sy-uzeit to tmp_line-info.
  append tmp_line to list_top_of_page.

endform.


************************************************************************
* TOP_OF_PAGE
************************************************************************
form top_of_page.

  call function 'REUSE_ALV_COMMENTARY_WRITE'
       exporting
            i_logo             = 'ENJOYSAP_LOGO'
            it_list_commentary = list_top_of_page.

endform.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Jul 2007 17:15:01 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2007-07-11T17:15:01Z</dc:date>
    <item>
      <title>ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2488984#M561614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HOW TO PRINT CURRENT DATE AND TIME IN ALV GRID DISPLAY WITH COMPANY LOGO&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jul 2007 17:07:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2488984#M561614</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-11T17:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2488985#M561615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt; using the function module 'REUSE_ALV_COMMENTARY_WRITE'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jul 2007 17:13:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2488985#M561615</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-11T17:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2488986#M561616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001
       no standard page heading.

* Global ALV Data Declarations
type-pools slis.

data: begin of i_alv occurs 0,
      matnr type mara-matnr,
      end of i_alv.

* Miscellanous Data Declarations
data: fieldcat type slis_t_fieldcat_alv,
      events   type slis_t_event,
      list_top_of_page type slis_t_listheader,
      top_of_page  type slis_formname value 'TOP_OF_PAGE'.


start-of-selection.

  perform initialization.
  perform get_data.
  perform call_alv.

end-of-selection.

************************************************************************
*  Form  Initialization
************************************************************************
form initialization.

  clear i_alv.       refresh i_alv.

  perform eventtab_build using events[].

endform.

************************************************************************
*  Form  Get_Data
************************************************************************
form  get_data.

  select matnr into table i_alv
              from mara up to 100 rows.

endform.

************************************************************************
*  CALL_ALV
************************************************************************
form call_alv.

  data: variant type  disvariant.
  data: repid type sy-repid.

  repid = sy-repid.
  variant-report = sy-repid.
  variant-username = sy-uname.

  perform build_field_catalog.

  perform comment_build using list_top_of_page[].

* Call ABAP List Viewer (ALV)
  call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
            it_fieldcat        = fieldcat
            i_callback_program = repid
            is_variant         = variant
            it_events          = events[]
            i_save             = 'U'
       tables
            t_outtab           = i_alv.

endform.

************************************************************************
* EVENTTAB_BUILD
************************************************************************
form eventtab_build using events type slis_t_event.

* Registration of events to happen during list display
  data: tmp_event type slis_alv_event.

  call function 'REUSE_ALV_EVENTS_GET'
       exporting
            i_list_type = 0
       importing
            et_events   = events.
  read table events with key name = slis_ev_top_of_page
                           into tmp_event.
  if sy-subrc = 0.
    move top_of_page to tmp_event-form.
    append tmp_event to events.
  endif.

endform.

************************************************************************
* BUILD_FIELD_CATALOG
************************************************************************
form build_field_catalog.

  clear: fieldcat. refresh: fieldcat.

  data: tmp_fc type slis_fieldcat_alv.

  tmp_fc-reptext_ddic = 'Material'.
  tmp_fc-fieldname    = 'MATNR'.
  tmp_fc-tabname      = 'I_ALV'.
  tmp_fc-outputlen    = 18.
  append tmp_fc to fieldcat.

endform.

************************************************************************
* COMMENT_BUILD
************************************************************************
form comment_build using list_top_of_page type
                                        slis_t_listheader.
  data: tmp_line type slis_listheader.

  clear tmp_line.
  tmp_line-typ  = 'H'.
  tmp_line-info = 'Your Report'.
  append tmp_line to list_top_of_page.

  clear tmp_line.
  tmp_line-typ  = 'S'.
  tmp_line-key  = 'Date'.
  write sy-datum to tmp_line-info.
  append tmp_line to list_top_of_page.

  clear tmp_line.
  tmp_line-typ  = 'S'.
  tmp_line-key  = 'Time'.
  write sy-uzeit to tmp_line-info.
  append tmp_line to list_top_of_page.

endform.


************************************************************************
* TOP_OF_PAGE
************************************************************************
form top_of_page.

  call function 'REUSE_ALV_COMMENTARY_WRITE'
       exporting
            i_logo             = 'ENJOYSAP_LOGO'
            it_list_commentary = list_top_of_page.

endform.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jul 2007 17:15:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2488986#M561616</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-07-11T17:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2488987#M561617</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 to the following code:&lt;/P&gt;&lt;P&gt;V_DATE = 'Run Date:'.&lt;/P&gt;&lt;P&gt;  CONCATENATE  V_DATE SY-DATUM&lt;EM&gt;6(2) '.' SY-DATUM&lt;/EM&gt;4(2) '.' SY-DATUM(4)&lt;/P&gt;&lt;P&gt;  INTO V_DATE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR SHED.&lt;/P&gt;&lt;P&gt;  SHED-TYP  = 'A'.&lt;/P&gt;&lt;P&gt;  SHED-INFO =  V_DATE.&lt;/P&gt;&lt;P&gt;  APPEND SHED TO ITHED.&lt;/P&gt;&lt;P&gt;  CLEAR SHED.&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 = ITHED.&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;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sipra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jul 2007 11:54:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2488987#M561617</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-12T11:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2488988#M561618</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check the following link: &lt;/P&gt;&lt;P&gt;[Removed by the moderator]&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhaskar&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2007 12:14:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2488988#M561618</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-12T12:14:42Z</dc:date>
    </item>
  </channel>
</rss>

