0

I'm using cl_salv_table ALV for sflight table data. I want to get the value of the field thats double-clicked and then display it in pop up window. I defined lcl_handle_events class with appropriate method. Double click works, for example when I double clicked on any row I can display message, but I don't know how to display the double clicked value. How to display double clicked cell in pop up window?

DATA schedule TYPE STANDARD TABLE OF sflight.

CLASS lcl_handle_events DEFINITION.

  PUBLIC SECTION.
    METHODS:
     on_double_click FOR EVENT double_click OF cl_salv_events_table
      IMPORTING row column.

ENDCLASS.

CLASS lcl_handle_events IMPLEMENTATION.

  METHOD on_double_click.

    DATA value TYPE sflight.
    READ TABLE schedule INTO value INDEX row.
    
*    MESSAGE 'Row clicked.' TYPE 'I'.

  ENDMETHOD.
ENDCLASS.
Suncatcher
  • 10,355
  • 10
  • 52
  • 90
Taurine
  • 13
  • 1
  • 6
  • Is your question about how to know which exact cell is clicked, or how to display something? Only one question per question please. – Sandra Rossi Jul 14 '21 at 12:41

2 Answers2

0

you can use with this function: 'POPUP_TO_INFORM' for example: CALL FUNCTION 'POPUP_TO_INFORM' EXPORTING titel = 'XXXXX ' txt1 = Row clicked txt2 = 'XXXXXXXX'.

sharon
  • 1
0

You have the "column" parameter for the double_click event. It contains the field name, so you can access the value with a field symbol:

FIELD-SYMBOLS: <clicked_field> TYPE any.
READ TABLE schedule INTO value INDEX row.
IF sy-subrc = 0.
  ASSIGN COMPONENT lv_column of STRUCTURE value to <clicked_field>.
  MESSAGE |Value of clicked field { <clicked_field> }| TYPE 'I'.
ENDIF.
RaTiO
  • 979
  • 2
  • 17
  • 33