2007 Dec 11 5:14 PM
Hi All!!
I have created a report ALV using OO on a Module Pool. by the moment, I have only a screen.
I have set a button to see the detail of a row of the report, but I don´t know how to handle the event generated when I push the button, and manage tje content of the row selected.
Somebody could guide me on this report.
Helpful answers will be rewarded.
Thanks and regards.
Manuel.
Hi All!!
I have created a report ALV using OO on a Module Pool. by the moment, I have only a screen.
I have set a button to see the detail of a row of the report, but I don´t know how to handle the event generated when I push the button, and manage tje content of the row selected.
Somebody could guide me on this report.
Helpful answers will be rewarded.
Thanks and regards.
Manuel.
2007 Dec 11 5:19 PM
CLASS lcl_event_receiver DEFINITION DEFERRED. "for screen 100
DATA: event_receiver TYPE REF TO lcl_event_receiver.
----
CLASS lcl_event_receiver DEFINITION
----
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_hotspot_click
FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING e_row_id e_column_id es_row_no.
ENDCLASS. "
----
CLASS lcl_event_receiver IMPLEMENTATION
----
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_hotspot_click.
IF e_column_id-fieldname = 'VBELN'.
IF e_row_id CO c_int.
READ TABLE it_final INTO wa_final INDEX e_row_id.
IF sy-subrc = 0.
SET PARAMETER ID 'AUN' FIELD wa_final-vbeln.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
ENDIF.
ENDMETHOD. "handle_double_click
ENDCLASS. "lcl_event_receiver IMPLEMENTATION
You need to do that along with the following code
CALL METHOD gc_grid->set_table_for_first_display
EXPORTING
i_structure_name = str_report
i_save = 'U'
is_layout = es_layout
is_variant = es_variant
i_default = c_on
CHANGING
it_outtab = it_final
it_fieldcatalog = it_fieldcat
it_sort = it_sort
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 event_receiver.
SET HANDLER
event_receiver->handle_hotspot_click FOR gc_grid.
gc_grid TYPE REF TO cl_gui_alv_grid,
2007 Dec 12 9:48 AM
I have set two event handlers, one to the event button_click and other to the event hotspot_click.
I have fixed two breakpoints on the implementation of the classes, but when I press the button, I don´t get the process stop at the breakpoints.
I guess I have not linked the buttons with the container of the ALV.
Thanks and regards,
Manuel.
2007 Dec 11 5:21 PM
I am sorry. I misunderstood i sent it for hotspot. you have to write code under PAI.
Please check the class CL_GUI_ALV_GRID events. take the above example and write the same for double click or menu_button or for user command.
2007 Dec 11 6:11 PM
FORM handle_double_click USING i_row TYPE lvc_s_row
i_column TYPE lvc_s_col
is_row_no TYPE lvc_s_roid.
READ TABLE gt_list INDEX is_row_no-row_id .
IF sy-subrc = 0 AND i_column-fieldname = 'MATNR' .
CALL SCREEN 200 . "Details Secondary List
ENDIF .
ENDFORM .
Reward Points if helpful
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |