Event top_of_page im OO-ALV

Die Objektorientierung mit ABAP®: Vererbung, Dynamische Programmierung, GUI Controls (u.a. ALV im OO).

Event top_of_page im OO-ALV

Postby Anakin3132 » Thu May 05, 2011 10:44 am

Hallo,
hat jemand schon mal den event top_of_page im OO-ALV ausprobiert?
Ich kriege den Event trotz Set Handler ... nicht geraist.
Der Aufruf über Create Object der Klasse CL_DD_DOCUMENT und Methoden ADD_TEXT bzw. DISPLAY_DOCUMENT funktioniert, aber nicht der SET HANDLER.
mfg Michael
Anakin3132
..
..
 
Posts: 11
Joined: Fri Jul 18, 2008 5:29 pm

Re: Event top_of_page im OO-ALV

Postby Joeline5261 » Thu May 05, 2011 3:06 pm

Hallo Michael,
beim OO-Alv kann man eine Überschriftszeile über dem Grid anzeigen lassen durch Übergabe einer Layout-Struktur (TYPE lvc_s_layo). In dieser Struktur gibt es das Feld GRID_TITLE, in das man die Überschrift eintragen kann.

DATA: gs_layout TYPE lvc_s_layo. " Layoutstruktur für ALV
...
gs_layout-grid_title = 'Überschift'.
...
CALL METHOD my_alv_grid->set_table_for_first_display
EXPORTING
is_layout = gs_layout
...
Gruß
Wolfgang
Joeline5261
...
...
 
Posts: 387
Joined: Thu Aug 18, 2005 2:42 pm

Re: Event top_of_page im OO-ALV

Postby Anakin3132 » Tue May 10, 2011 1:27 pm

Hallo Wolfgang,
das ist mir bekannt, aber da kann ich nur eine Überschriftszeile eingeben. Ich will aber mehrere Zeilen darstellen können - so wie beim i_callback_html_top_of_page des FuBa REUSE_ALV....
mfg Michael
Anakin3132
..
..
 
Posts: 11
Joined: Fri Jul 18, 2008 5:29 pm

Re: Event top_of_page im OO-ALV

Postby Joeline5261 » Tue May 10, 2011 2:46 pm

Hallo Michael,

dann passt das bestimmt besser:

http://help-abap.blogspot.com/2008/09/s ... -page.html

Gruß
Wolfgang
Joeline5261
...
...
 
Posts: 387
Joined: Thu Aug 18, 2005 2:42 pm

Re: Event top_of_page im OO-ALV

Postby Anakin3132 » Thu May 12, 2011 7:09 pm

Hallo Wolfgang,
danke für den interessanten Link. Nur diese Funktionalität habe ich auch schon über die Klasse CL_DD_DOCUMENT.
Ich wollte eigentlich den EVENT top_of_page ausprobieren. Aber dies funktioniert auch nicht im SAP-Testprogramm BCALV_TEST_GRID_EVENTS.

mfg Michael
Anakin3132
..
..
 
Posts: 11
Joined: Fri Jul 18, 2008 5:29 pm

Re: Event top_of_page im OO-ALV

Postby Tron » Fri May 13, 2011 8:07 am

Moin,
diese Events werden im Zusammenhang mit Drucken benutzt
About Printing
There are some events that you can utilize about printing.
You simply write what is to be output in methods handling these events.

Here is the list of events in this context.
print_end_of_list Define output text to be printed at the end of the entire list
print_top_of_list Define output text to be printed at the beginning of the entire list
print_end_of_page Define output text to be printed at the end of each page
print_top_of_page Define output text to be printed at the beginning of each page


das top_of_page event wird verwendet um z. B ein "Dokument" in den oberen Teil eines Splitter Containers zu bringen.

Beispiel:
Code: [Select all] [Expand/Collapse] [Download] (Untitled.txt)
  1. *       MAIN                                                          *
  2. *---------------------------------------------------------------------*
  3. *---------------------------------------------------------------------*
  4. *       CLASS lcl_event_handler DEFINITION
  5. *---------------------------------------------------------------------*
  6. *
  7. *---------------------------------------------------------------------*
  8. CLASS lcl_event_handler DEFINITION .
  9.   PUBLIC SECTION .
  10.     METHODS:
  11. *--To add new functional buttons to the ALV toolbar
  12.     handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
  13.     IMPORTING e_object e_interactive ,
  14.  
  15. *--To implement user commands
  16.     handle_user_command
  17.     FOR EVENT user_command OF cl_gui_alv_grid
  18.     IMPORTING e_ucomm ,
  19.  
  20.     top_of_page FOR EVENT top_of_page              "event handler
  21.                          OF cl_gui_alv_grid
  22.                          IMPORTING e_dyndoc_id.
  23.  
  24.  
  25. *---------------------------------------------------------------------*
  26. *       CLASS lcl_event_handler IMPLEMENTATION
  27. *---------------------------------------------------------------------*
  28. *
  29. *---------------------------------------------------------------------*
  30. CLASS lcl_event_handler IMPLEMENTATION .
  31.  
  32. *--Handle Toolbar
  33.   METHOD handle_toolbar.
  34.     PERFORM handle_toolbar USING e_object e_interactive .
  35.   ENDMETHOD .                    "handle_toolbar
  36.  
  37. *--Handle User Command
  38.   METHOD handle_user_command .
  39.     PERFORM handle_user_command USING e_ucomm .
  40.   ENDMETHOD.                    "handle_user_command
  41.  
  42.   PRIVATE SECTION.
  43. ENDCLASS.                    "lcl_event_handler DEFINITION
  44.  
  45.  
  46. *--Handle Before User Command JG
  47. *  METHOD handle_before_user_command .
  48. *    PERFORM handle_before_user_command USING e_ucomm .
  49. *  ENDMETHOD .                    "handle_before_user_command
  50.  
  51.   METHOD top_of_page.                   "implementation
  52. * Top-of-page event
  53.     PERFORM event_top_of_page USING g_dyndoc_id.
  54.   ENDMETHOD.                            "top_of_page
  55.  
  56. ENDCLASS.                    "lcl_event_handler IMPLEMENTATION
  57.  
  58.  :
  59.  :
  60.  
  61. *--Creating an instance for the event handler
  62.     CREATE OBJECT gr_event_handler .
  63.  
  64.     CALL METHOD grid1->set_table_for_first_display
  65.       EXPORTING
  66.         is_variant           = is_variant
  67.         i_save               = lv_layperm
  68. *        i_save               = ' '
  69.         is_layout            = gs_layout
  70.         it_toolbar_excluding = lt_exclude
  71.       CHANGING
  72.         it_outtab            = it_data[]
  73.         it_fieldcatalog      = gt_fieldcat[].
  74.  
  75.  
  76. *--Registering handler methods to handle ALV Grid events JG
  77.  
  78.     SET HANDLER gr_event_handler->handle_toolbar FOR grid1.
  79.     SET HANDLER gr_event_handler->handle_user_command FOR grid1.
  80.     SET HANDLER gr_event_handler->top_of_page FOR grid1.
  81.  
  82. * Initializing document
  83.     CALL METHOD g_dyndoc_id->initialize_document.
  84.  
  85. * Processing events
  86.     CALL METHOD grid1->list_processing_events
  87.       EXPORTING
  88.         i_event_name = 'TOP_OF_PAGE'
  89.         i_dyndoc_id  = g_dyndoc_id.
  90.  
  91.  
  92.  
  93. *&---------------------------------------------------------------------*
  94. *&      Form  EVENT_TOP_OF_PAGE
  95. *&---------------------------------------------------------------------*
  96. *       text
  97. *----------------------------------------------------------------------*
  98. *      -->DG_DYNDOC_ID  text
  99. *----------------------------------------------------------------------*
  100. FORM event_top_of_page USING r_top TYPE REF TO cl_dd_document.
  101.  :
  102.  :
  103.  
GeSHi ©


gruß TRon
Tron
.....
.....
 
Posts: 1112
Joined: Sat Aug 04, 2007 10:21 pm


Return to ABAP Objects®

Who is online

Users browsing this forum: No registered users and 13 guests