Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

CL_GUI_ALV_GRID event TOP_OF_PAGE

Hi there,

I found when searching older threads about the same problem but no solution. I have also an ALV program and have registered the event TOP_OF_PAGE (NOT PRINT_TOP_OF_PAGE). The event ist not fired and not processed. As other peoples programs also mine can use print_top_of_page or e.g. hotspot_click without problems.

This is the relevant part of my code. Program does not reach the break-point.

DATA: gfd_title_doc_1 TYPE REF TO cl_dd_document.

CLASS lcl_event_handler_1 DEFINITION DEFERRED.

DATA: gfd_event_receiver_1 TYPE REF TO lcl_event_handler_1.

*----


  • CLASS DEFINITION

*----


*Event Handler

CLASS lcl_event_handler_1 DEFINITION.

PUBLIC SECTION.

CLASS-METHODS:

on_top_of_page_1 FOR EVENT top_of_page OF cl_gui_alv_grid

IMPORTING e_dyndoc_id,

ENDCLASS. "lcl_event_handler DEFINITION

*----


  • CLASS IMPLEMENTATION

*----


  • Event Handler

CLASS lcl_event_handler_1 IMPLEMENTATION.

METHOD on_top_of_page_1.

break z00238pw.

PERFORM top_of_page_1 USING e_dyndoc_id.

ENDMETHOD. "on_print_top_of_page

ENDCLASS. "lcl_event_handler IMPLEMENTATION

...

IF gfd_custom_container_1 IS INITIAL.

CREATE OBJECT gfd_custom_container_1

EXPORTING

container_name = gfd_container_1.

CREATE OBJECT gfd_grid_1

EXPORTING

i_parent = gfd_custom_container_1.

  • Create ALV

CALL METHOD gfd_grid_1->set_table_for_first_display

EXPORTING

i_structure_name = gc_structure_1

is_variant = gwa_variant_1

is_layout = gwa_layout_1

i_save = gc_save_all

  • it_toolbar_excluding = i_excl_alv

CHANGING

it_outtab = git_list_1

it_fieldcatalog = git_fieldcat_1

it_sort = git_sort_1

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CREATE OBJECT gfd_title_doc_1.

CALL METHOD gfd_title_doc_1->initialize_document.

CALL METHOD gfd_grid_1->list_processing_events

EXPORTING

i_event_name = 'TOP_OF_PAGE'

i_dyndoc_id = gfd_title_doc_1.

CREATE OBJECT gfd_event_receiver_1.

ENDIF.

SET HANDLER:

gfd_event_receiver_1->on_top_of_page_1 FOR gfd_grid_1.

Thank you in advance for your help

Axel

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question