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: 

Regarding Header in ALV Grid display

Former Member
0 Kudos

Hi,

I want to display Multiple headers in ALV Grid Display.

for e.g.

company code A

plant A1

date xx.xx.xxxx to xx.xx.xxxx

a list with all the material related to this company code and plant

company code A

Plant A2

date xx.xx.xxxx to xx.xx.xxxx

a list with all the material related to this company code and plant

and so on untill all the plants related to that particular company code are not displayed.

Kindly reply soon,

Its very Urgent.

Thanks in Advance,

Poonam.

4 REPLIES 4

amit_khare
Active Contributor
0 Kudos

No, its possible to have headings like this in ALV.

In OOALV you can have headings like this by putting up separate containers for everything....but thats not at all a good solution.

Regards,

Amit

Former Member
0 Kudos

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

<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

</b>

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 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 = 'EKKO Table 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.

reward points if it is usefull...

Girish

0 Kudos

Hi Girish,

I know that using top of page i can insert one header i m talking about multiple headers

is it possible ?

U can see the format from the previous post.

BR,

Poonam

Former Member
0 Kudos

i dont think .. u can have two headers ...as per your requirement...

Thanks,

Manjunath MS