Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Header in ALV Report

Former Member
0 Kudos

Hi All,

I want to print a report in the following manner:

DATE:

CLASS GROUP :

MATNR CLASS ADSIZE

123 c col1

124 c col2

156 c col2

DATE:

CLASS GROUP :

MATNR CLASS ADSIZE

125 a col3

128 a col4

150 a col5

How do i do it...I am planning to do it with REUSE_ALV_LIST _DISPLAY...but i dont know how to print the header..plz help

3 REPLIES 3

Former Member
0 Kudos

Hi,

Check the following link:

http://www.sap-img.com/abap/sample-alv-heading-in-alv.htm

Regards,

Bhaskar

0 Kudos

My doubt is how do i print the header conditionally like

cust : 123 " is the header for the first page

cust : 234 " is the header for the second.

regards,

Santosh

Former Member
0 Kudos

<b>Note : In the below i am passing my purchase order Ebeln with internal table to the Form header so that all purchase order are passed to Header by this way you can also pass it .</b>

<b>Add Title(heading) to ALV Grid</b>

In order to insert a report heading in to the ALV grid you need to perform the following steps:

1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include 'top-of-page' FORM

2. Create 'top-of-page' FORM

call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
            i_callback_program      = gd_repid
            i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
            is_layout               = gd_layout
            it_fieldcat             = fieldcatalog[]
            i_save                  = 'X'
       tables
            t_outtab                = it_ekko
       exceptions
            program_error           = 1
            others                  = 2.

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 = EKKO-ebeln.
  append wa_header to t_header.
  clear wa_header.
endform.

reward points if it is usefull .....

Girish