2007 Apr 17 11:42 AM
Hi friends,
How can we print the header in abap Objects using class ??
thanks,
Prashant patil
2007 Apr 17 11:48 AM
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.
2007 Apr 17 12:52 PM
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
2007 Apr 17 1:07 PM
2007 Apr 17 3:55 PM
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.