Application Development and Automation 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: 
Read only

Header In ALV with abap objects

former_member386202
Active Contributor
0 Likes
757

Hi friends,

How can we print the header in abap Objects using class ??

thanks,

Prashant patil

Hi friends,

How can we print the header in abap Objects using class ??

thanks,

Prashant patil

4 REPLIES 4
Read only

amit_khare
Active Contributor
0 Likes
673

Check this - BCALV_DND_04

Or juat add another container at the top and display ur header contents there.

Regards,

Amit

reward all helpful replies.

Read only

Former Member
0 Likes
673

Hi,

Using class if u are displaying ur ALV, then it is not possible to print or download the header.

only by using REUSE_ALV_GRID_DISPLAY, u can print the header.

If u using factory method using class for ALV diaplay,then u can print the header.

if u want the code snippet for factory method,let me know.

****reward points if useful.

All the best

Read only

0 Likes
673

hi

yaa i need the code for factory method

thanx,

prashant

Read only

0 Likes
673

Create a local class:


CLASS lcl_event_receiver DEFINITION.

  PUBLIC SECTION.
    METHODS: handle_top_of_page FOR EVENT print_top_of_page
                               OF cl_gui_alv_grid.

  PRIVATE SECTION.

ENDCLASS.

*---------------------------------------------------------------------*
*       CLASS lcl_event_receiver IMPLEMENTATION
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
CLASS lcl_event_receiver IMPLEMENTATION.
  METHOD handle_top_of_page.

  WRITE: / 'Header info'.   
    

  ENDMETHOD.
ENDCLASS.

Then in your main program before you <i>set_table_for_first_display</i>, make sure you register your event handler:


DATA:  grid                   TYPE REF TO  cl_gui_alv_grid,
         event_receiver    TYPE REF TO  lcl_event_receiver.


    CREATE OBJECT grid EXPORTING i_parent = container.

    CREATE OBJECT event_receiver.
    SET HANDLER event_receiver->handle_top_of_page FOR grid.