<?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: adding header to ALV in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-alv/m-p/1604715#M271427</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;U have to use the following function module&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 = 'Z_LOGO'.&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;See this link also:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_enhanced.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_enhanced.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U have to uplaod the logo into the server&lt;/P&gt;&lt;P&gt;Upload Logo for REUSE_ALV_COMMENTARY_WRITE &lt;/P&gt;&lt;P&gt;For those who wish to upload and use a picture in your ALV abap reports. &lt;/P&gt;&lt;P&gt;Steps for uploading Logo :-: &lt;/P&gt;&lt;P&gt;1. Goto the transaction OAER &lt;/P&gt;&lt;P&gt;2. Enter the class name as 'PICTURES' &lt;/P&gt;&lt;P&gt;3. Enter the class type as 'OT' &lt;/P&gt;&lt;P&gt;4. Enter the object key as the name of the logo you wish to give &lt;/P&gt;&lt;P&gt;5. Execute &lt;/P&gt;&lt;P&gt;6. Then in the new screen select Standard doc. types in bottom window &lt;/P&gt;&lt;P&gt;Click on the Screen icon &lt;/P&gt;&lt;P&gt;Now, it will ask for the file path where you have to upload the logo &lt;/P&gt;&lt;P&gt;7. Now you can use this logo in REUSE_ALV_COMMENTARY_WRITE &lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;Import Logo and Background Picture for Reporting &lt;/P&gt;&lt;P&gt;In this step, you can import a customer-specific logo and a background picture into the R/3 System. These will be displayed in the header area of reports in HR Funds and Position Management. &lt;/P&gt;&lt;P&gt;From the SPRO: &lt;/P&gt;&lt;P&gt;HR Funds and Position Management --&amp;gt; Dialog Control --&amp;gt; Customize Reporting Interface --&amp;gt; Import Logo and Background Picture for Reporting. &lt;/P&gt;&lt;P&gt;Activities &lt;/P&gt;&lt;P&gt;1. Enter the Name of your logo/background picture as an object key in the initial screen. &lt;/P&gt;&lt;P&gt;2. Make sure that the class name is PICTURES, and the class type is OT. &lt;/P&gt;&lt;P&gt;3. Choose Execute. &lt;/P&gt;&lt;P&gt;4. Double-click the document type Picture on the Create tab page. A dialog box will appear in which you can enter the path in which the logo/background picture can be found. &lt;/P&gt;&lt;P&gt;5. Enter the path and choose Open. The logo will be uploaded into the current R/3 System. If the logo/background picture is to be transported into other systems as well, choose Transport. &lt;/P&gt;&lt;P&gt;6. Return to the initial screen and repeat the procedure after having entered the Name of your background picture as an object key. &lt;/P&gt;&lt;P&gt;Please note that the logo/background picture can only be displayed in ALV-based reports with an HTML header. Manually programmed reports such as business distribution plans are not based on the ALV. &lt;/P&gt;&lt;P&gt;If you have selected several initial objects, ALV-based reports in HR Funds and Position Management will automatically use a hiearchical-sequential display. A logo is not displayed here either. Note also that the logo cannot be printed (see print preview in program). &lt;/P&gt;&lt;P&gt;Make sure that the logo does not exceed a height of 100 pixels because it would mean that the header of the report will be scrollable. &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>Tue, 10 Oct 2006 09:40:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-10-10T09:40:12Z</dc:date>
    <item>
      <title>adding header to ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-alv/m-p/1604713#M271425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to add header to ALV grid, pls tell me how to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Venu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Oct 2006 09:37:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-alv/m-p/1604713#M271425</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-10T09:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: adding header to ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-alv/m-p/1604714#M271426</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;check the following program doing the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ZWA_ALV_EDITABLE_FM .

type-pools: slis.

data it_fieldcat type slis_fieldcat_alv occurs 0 with header line.

data: gs_layout type slis_layout_alv.

data v_repid like sy-repid.


DATA: BEGIN OF itab OCCURS 0.
        INCLUDE STRUCTURE CSKT.
DATA: end of itab.


START-OF-SELECTION.

  v_repid = sy-repid.

*--- selection form cost center master table

  SELECT * FROM CSKT
  INTO TABLE itab.

  PERFORM field_catalog.



   call function 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
            i_callback_program     = v_repid
            it_fieldcat            = it_fieldcat[]
            is_layout              = gs_layout
            i_callback_top_of_page = 'TOP-OF-PAGE1'
            i_grid_title           = 'xyz'
            i_default              = 'X'
            i_save                 = 'U'
       TABLES
            t_outtab               = itab.


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  field_catalog
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM field_catalog.

  call function 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
            i_program_name     = v_repid
            i_internal_tabname = 'ITAB'
            i_inclname         = v_repid
       CHANGING
            ct_fieldcat        = it_fieldcat[].


ENDFORM.                    


*---------------------------------------------------------------------*
*       FORM top-of-page1                                             *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
&amp;lt;b&amp;gt;form top-of-page1.
  data: header type slis_t_listheader,
  wa type slis_listheader. 

  wa-typ = 'S'.
  wa-info = 'dd'.
  append wa to header.

  wa-typ = 'S'.
  write sy-datum to wa-info mm/dd/yyyy.
  concatenate 'abc' wa-info into wa-info separated by space.
  append wa to header.

  wa-typ = 'S'.
  concatenate 'cd' sy-uname into wa-info separated by space.
  append wa to header.

  wa-typ = 'S'.
  concatenate 'ee' sy-repid into wa-info separated by space.
  append wa to header.

  call function 'REUSE_ALV_COMMENTARY_WRITE'
       EXPORTING
            it_list_commentary = header.&amp;lt;/b&amp;gt;



ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&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>Tue, 10 Oct 2006 09:39:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-alv/m-p/1604714#M271426</guid>
      <dc:creator>dani_mn</dc:creator>
      <dc:date>2006-10-10T09:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: adding header to ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-alv/m-p/1604715#M271427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;U have to use the following function module&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 = 'Z_LOGO'.&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;See this link also:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_enhanced.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_enhanced.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U have to uplaod the logo into the server&lt;/P&gt;&lt;P&gt;Upload Logo for REUSE_ALV_COMMENTARY_WRITE &lt;/P&gt;&lt;P&gt;For those who wish to upload and use a picture in your ALV abap reports. &lt;/P&gt;&lt;P&gt;Steps for uploading Logo :-: &lt;/P&gt;&lt;P&gt;1. Goto the transaction OAER &lt;/P&gt;&lt;P&gt;2. Enter the class name as 'PICTURES' &lt;/P&gt;&lt;P&gt;3. Enter the class type as 'OT' &lt;/P&gt;&lt;P&gt;4. Enter the object key as the name of the logo you wish to give &lt;/P&gt;&lt;P&gt;5. Execute &lt;/P&gt;&lt;P&gt;6. Then in the new screen select Standard doc. types in bottom window &lt;/P&gt;&lt;P&gt;Click on the Screen icon &lt;/P&gt;&lt;P&gt;Now, it will ask for the file path where you have to upload the logo &lt;/P&gt;&lt;P&gt;7. Now you can use this logo in REUSE_ALV_COMMENTARY_WRITE &lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;Import Logo and Background Picture for Reporting &lt;/P&gt;&lt;P&gt;In this step, you can import a customer-specific logo and a background picture into the R/3 System. These will be displayed in the header area of reports in HR Funds and Position Management. &lt;/P&gt;&lt;P&gt;From the SPRO: &lt;/P&gt;&lt;P&gt;HR Funds and Position Management --&amp;gt; Dialog Control --&amp;gt; Customize Reporting Interface --&amp;gt; Import Logo and Background Picture for Reporting. &lt;/P&gt;&lt;P&gt;Activities &lt;/P&gt;&lt;P&gt;1. Enter the Name of your logo/background picture as an object key in the initial screen. &lt;/P&gt;&lt;P&gt;2. Make sure that the class name is PICTURES, and the class type is OT. &lt;/P&gt;&lt;P&gt;3. Choose Execute. &lt;/P&gt;&lt;P&gt;4. Double-click the document type Picture on the Create tab page. A dialog box will appear in which you can enter the path in which the logo/background picture can be found. &lt;/P&gt;&lt;P&gt;5. Enter the path and choose Open. The logo will be uploaded into the current R/3 System. If the logo/background picture is to be transported into other systems as well, choose Transport. &lt;/P&gt;&lt;P&gt;6. Return to the initial screen and repeat the procedure after having entered the Name of your background picture as an object key. &lt;/P&gt;&lt;P&gt;Please note that the logo/background picture can only be displayed in ALV-based reports with an HTML header. Manually programmed reports such as business distribution plans are not based on the ALV. &lt;/P&gt;&lt;P&gt;If you have selected several initial objects, ALV-based reports in HR Funds and Position Management will automatically use a hiearchical-sequential display. A logo is not displayed here either. Note also that the logo cannot be printed (see print preview in program). &lt;/P&gt;&lt;P&gt;Make sure that the logo does not exceed a height of 100 pixels because it would mean that the header of the report will be scrollable. &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>Tue, 10 Oct 2006 09:40:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-alv/m-p/1604715#M271427</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-10T09:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: adding header to ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-alv/m-p/1604716#M271428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;function &amp;lt;b&amp;gt;REUSE_ALV_COMMENTARY_WRITE&amp;lt;/b&amp;gt;, for writing the header.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Oct 2006 09:40:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-alv/m-p/1604716#M271428</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-10T09:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: adding header to ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-alv/m-p/1604717#M271429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;*&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) 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>Tue, 10 Oct 2006 09:44:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/adding-header-to-alv/m-p/1604717#M271429</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-10T09:44:26Z</dc:date>
    </item>
  </channel>
</rss>

