<?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 Header in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-header/m-p/1728402#M317348</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;u can try like this

* Date
  wa_header-typ  = 'S'.
  wa_header-key = 'Date: '.
  CONCATENATE  sy-datum+6(2) '.'
               sy-datum+4(2) '.'
               sy-datum(4) '  to  '
               sy-datum+6(2) '.'
               sy-datum+4(2) '.'
               sy-datum(4) 
INTO wa_header-info.   "todays date
  APPEND wa_header TO t_header.
  CLEAR: wa_header.



Execute the report and checkout

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  Y_TOP_PAGE                                                  *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;                                                                     *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*

REPORT  y_top_page                              .

TABLES : mara.
TYPE-POOLS: slis.

DATA : w_repid LIKE sy-repid.
  w_repid = sy-repid.

DATA : BEGIN OF it_mara OCCURS 0,
       matnr LIKE mara-matnr,
       END OF it_mara.

*layout
DATA: wa_layout           TYPE SLIS_LAYOUT_ALV.
*field catalog
DATA: it_fieldcat_wrt_off TYPE slis_t_fieldcat_alv,
      wa_fieldcat_wrt_off TYPE slis_fieldcat_alv.

START-OF-SELECTION.

  SELECT matnr FROM mara INTO CORRESPONDING FIELDS OF TABLE it_mara.

END-OF-SELECTION.


  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
   EXPORTING
     i_program_name               = w_repid
   I_INTERNAL_TABNAME           = 'IT_MARA'
*     i_structure_name             = 'IT_MARA'
*   I_CLIENT_NEVER_DISPLAY       = 'X'
   I_INCLNAME                   = w_repid
*   I_BYPASSING_BUFFER           =
*   I_BUFFER_ACTIVE              =
    CHANGING
      ct_fieldcat                  = it_fieldcat_wrt_off[]
   EXCEPTIONS
     inconsistent_interface       = 1
     program_error                = 2
     OTHERS                       = 3
            .
  IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program     = w_repid
      i_callback_top_of_page = 'TOP-OF-PAGE'
      is_layout              = wa_layout
      it_fieldcat            = it_fieldcat_wrt_off
    TABLES
      t_outtab               = it_mara
    EXCEPTIONS
      program_error          = 1
      OTHERS                 = 2.
  IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.



*-------------------------------------------------------------------*
* Form  TOP-OF-PAGE                                                 *
*-------------------------------------------------------------------*
* ALV Report Header                                                 *
*-------------------------------------------------------------------*
FORM top-of-page.
*ALV Header declarations
  DATA: t_header TYPE slis_t_listheader,
        wa_header TYPE slis_listheader,
        t_line LIKE wa_header-info,
        ld_lines TYPE i,
        ld_linesc(10) TYPE c.

* Title
  wa_header-typ  = 'H'.
  wa_header-info = 'CHANDU REPORT'.
  APPEND wa_header TO t_header.
  CLEAR wa_header.

* Date
  wa_header-typ  = 'S'.
  wa_header-key = 'Date: '.
  CONCATENATE  sy-datum+6(2) '.'
               sy-datum+4(2) '.'
               sy-datum(4) '  to  '
               sy-datum+6(2) '.'
               sy-datum+4(2) '.'
               sy-datum(4) 
INTO wa_header-info.   "todays date
  APPEND wa_header TO t_header.
  CLEAR: wa_header.

* Total No. of Records Selected
*  describe table it_ekko lines ld_lines.
*  ld_linesc = ld_lines.
*  concatenate 'Total No. of Records Selected: ' ld_linesc
*                    into t_line separated by space.
*  wa_header-typ  = 'A'.
*  wa_header-info = t_line.
*  append wa_header to t_header.
*  clear: wa_header, t_line.

  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary = t_header.
*            i_logo             = 'Z_LOGO'.
ENDFORM.                    "top-of-page&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Dec 2006 13:51:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-29T13:51:21Z</dc:date>
    <item>
      <title>ALV Header</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-header/m-p/1728401#M317347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;i want to display the range of values given in the selection screen (eg: s_date)&lt;/P&gt;&lt;P&gt;in the alv header while diplaying output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i know how to display single values in the alv header.&lt;/P&gt;&lt;P&gt;(eg:  &lt;/P&gt;&lt;P&gt; CLEAR w_line.&lt;/P&gt;&lt;P&gt;  REFRESH : t_top_of_page.&lt;/P&gt;&lt;P&gt;  w_line-typ  = 'S'.&lt;/P&gt;&lt;P&gt;  w_line-key = text-t26.     "Sales organization&lt;/P&gt;&lt;P&gt;  w_line-info = p_vkorg.&lt;/P&gt;&lt;P&gt;  APPEND w_line TO t_top_of_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; and we call the function REUSE_ALV_EVENTS_GET)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please tell me how to display a range of values in alv header.&lt;/P&gt;&lt;P&gt;like &lt;/P&gt;&lt;P&gt;   &amp;lt;b&amp;gt;date&amp;lt;/b&amp;gt;   22.12.2006   to  28.12.2006&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Dec 2006 13:43:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-header/m-p/1728401#M317347</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-29T13:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Header</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-header/m-p/1728402#M317348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;u can try like this

* Date
  wa_header-typ  = 'S'.
  wa_header-key = 'Date: '.
  CONCATENATE  sy-datum+6(2) '.'
               sy-datum+4(2) '.'
               sy-datum(4) '  to  '
               sy-datum+6(2) '.'
               sy-datum+4(2) '.'
               sy-datum(4) 
INTO wa_header-info.   "todays date
  APPEND wa_header TO t_header.
  CLEAR: wa_header.



Execute the report and checkout

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  Y_TOP_PAGE                                                  *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;                                                                     *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*

REPORT  y_top_page                              .

TABLES : mara.
TYPE-POOLS: slis.

DATA : w_repid LIKE sy-repid.
  w_repid = sy-repid.

DATA : BEGIN OF it_mara OCCURS 0,
       matnr LIKE mara-matnr,
       END OF it_mara.

*layout
DATA: wa_layout           TYPE SLIS_LAYOUT_ALV.
*field catalog
DATA: it_fieldcat_wrt_off TYPE slis_t_fieldcat_alv,
      wa_fieldcat_wrt_off TYPE slis_fieldcat_alv.

START-OF-SELECTION.

  SELECT matnr FROM mara INTO CORRESPONDING FIELDS OF TABLE it_mara.

END-OF-SELECTION.


  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
   EXPORTING
     i_program_name               = w_repid
   I_INTERNAL_TABNAME           = 'IT_MARA'
*     i_structure_name             = 'IT_MARA'
*   I_CLIENT_NEVER_DISPLAY       = 'X'
   I_INCLNAME                   = w_repid
*   I_BYPASSING_BUFFER           =
*   I_BUFFER_ACTIVE              =
    CHANGING
      ct_fieldcat                  = it_fieldcat_wrt_off[]
   EXCEPTIONS
     inconsistent_interface       = 1
     program_error                = 2
     OTHERS                       = 3
            .
  IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program     = w_repid
      i_callback_top_of_page = 'TOP-OF-PAGE'
      is_layout              = wa_layout
      it_fieldcat            = it_fieldcat_wrt_off
    TABLES
      t_outtab               = it_mara
    EXCEPTIONS
      program_error          = 1
      OTHERS                 = 2.
  IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.



*-------------------------------------------------------------------*
* Form  TOP-OF-PAGE                                                 *
*-------------------------------------------------------------------*
* ALV Report Header                                                 *
*-------------------------------------------------------------------*
FORM top-of-page.
*ALV Header declarations
  DATA: t_header TYPE slis_t_listheader,
        wa_header TYPE slis_listheader,
        t_line LIKE wa_header-info,
        ld_lines TYPE i,
        ld_linesc(10) TYPE c.

* Title
  wa_header-typ  = 'H'.
  wa_header-info = 'CHANDU REPORT'.
  APPEND wa_header TO t_header.
  CLEAR wa_header.

* Date
  wa_header-typ  = 'S'.
  wa_header-key = 'Date: '.
  CONCATENATE  sy-datum+6(2) '.'
               sy-datum+4(2) '.'
               sy-datum(4) '  to  '
               sy-datum+6(2) '.'
               sy-datum+4(2) '.'
               sy-datum(4) 
INTO wa_header-info.   "todays date
  APPEND wa_header TO t_header.
  CLEAR: wa_header.

* Total No. of Records Selected
*  describe table it_ekko lines ld_lines.
*  ld_linesc = ld_lines.
*  concatenate 'Total No. of Records Selected: ' ld_linesc
*                    into t_line separated by space.
*  wa_header-typ  = 'A'.
*  wa_header-info = t_line.
*  append wa_header to t_header.
*  clear: wa_header, t_line.

  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary = t_header.
*            i_logo             = 'Z_LOGO'.
ENDFORM.                    "top-of-page&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Dec 2006 13:51:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-header/m-p/1728402#M317348</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-29T13:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Header</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-header/m-p/1728403#M317349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLEAR w_line.
REFRESH : t_top_of_page.
w_line-typ = 'S'.
w_line-key = 'Date'.
concatenate s_date-low '-to-' s_date-low into w_line-info.
APPEND w_line TO t_top_of_page.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Kathirvel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Dec 2006 13:52:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-header/m-p/1728403#M317349</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-29T13:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Header</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-header/m-p/1728404#M317350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks to all&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Dec 2006 14:17:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-header/m-p/1728404#M317350</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-29T14:17:32Z</dc:date>
    </item>
  </channel>
</rss>

