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

Button on my Interactive ALV

Former Member
0 Likes
918

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.

4 REPLIES 4
Read only

former_member191735
Active Contributor
0 Likes
898

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,

Read only

0 Likes
898

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.

Read only

former_member191735
Active Contributor
0 Likes
898

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.

Read only

Former Member
0 Likes
898

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