REPORT  zaddlogo.

TYPE-POOLSslis" SLIS contains all the ALV data types

*&———————————————————————*
*& Data Declaration
*&———————————————————————*

DATAlt_sflight TYPE TABLE OF sflight.
DATAg_repid   TYPE sy-repid.
*ALV Header declarations
DATAlt_header        TYPE slis_t_listheader,
              ls_header       TYPE slis_listheader,
              lt_line             LIKE ls_header-info,
              lv_lines          TYPE i,
              lv_linesc(10TYPE c.

*&———————————————————————*
*& START-OF-SELECTION
*&———————————————————————*
START-OF-SELECTION.

g_repid sy-repid.
*&—– Fetch data from the database —–*
SELECT *
      FROM sflight
      INTO TABLE lt_sflight.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
            i_callback_program g_repid
            i_callback_top_of_page 'TOP-OF-PAGE'
            i_structure_name 'SFLIGHT'
      TABLES
            t_outtab lt_sflight.

*———————————————————–*
* Form TOP-OF-PAGE
* Generating Report Header
*———————————————————–*
FORM top-of-page.

*&—– Alv report header —–*
* Title
ls_header-typ 'H'.
ls_header-info 'SFLIGHT Table Report'.
APPEND ls_header TO lt_header.
CLEAR ls_header.

* Date
ls_header-typ 'S'.
ls_header-key 'Date: '.
CONCATENATE sy-datum+6(2'.'
                               sy-datum+4(2'.'
                              sy-datum(4)

                  INTO ls_header-info"todays date
APPEND ls_header TO lt_header.
CLEARls_header.

* Total No. of Records Selected
DESCRIBE TABLE lt_sflight LINES lv_lines.
lv_linesc lv_lines.
CONCATENATE 'Total No. of Records Selected: ' lv_linesc
            INTO lt_line SEPARATED BY space.
ls_header-typ 'A'.
ls_header-info lt_line.
APPEND ls_header TO lt_header.
CLEARls_headerlt_line.
*&—– Pass data and field catalog to ALV function module —–*

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
            it_list_commentary lt_header

            i_logo                          'TESTLOGO'.

ENDFORM"top-of-page




Serkan AKKAVAK

Computer Engineer

SAP Department Deputy Manager

Contact : serkurumsal@yandex.com