**********************************************************************
* Types
**********************************************************************
TYPES : BEGIN OF ty_s_term,
guid_glos TYPE glossary1-guid_glos,
langu TYPE glossary1-langu,
term TYPE glossary1-term,
termuc TYPE glossary1-termuc,
END OF ty_s_term.
TYPES: ty_it_term TYPE STANDARD TABLE OF ty_s_term WITH DEFAULT KEY.
DATA: it_terms TYPE ty_it_term.
**********************************************************************
* SALV Events
**********************************************************************
CLASS lcl_events DEFINITION.
PUBLIC SECTION.
CLASS-METHODS: on_double_click FOR EVENT double_click OF cl_salv_events_table
IMPORTING
row
column
sender.
ENDCLASS.
CLASS lcl_events IMPLEMENTATION.
METHOD on_double_click.
* geklickte Zeile ermitteln
DATA(lv_row) = it_terms[ row ].
* Übersetzungen zur gleichen GUID holen
SELECT
guid_glos,
langu,
term,
termuc
INTO TABLE @DATA(it_terms2)
FROM glossary1
WHERE guid_glos = @lv_row-guid_glos.
* HTML-Code generieren lassen
DATA(lv_html) = cl_demo_output=>get( it_terms2 ).
* HTML-Code anzeigen
cl_abap_browser=>show_html( html_string = lv_html
size = cl_abap_browser=>large
format = cl_abap_browser=>landscape
context_menu = abap_true
buttons = cl_abap_browser=>navigate_off ).
ENDMETHOD.
ENDCLASS.
**********************************************************************
* Selektionsbild
**********************************************************************
PARAMETERS: p_term TYPE glossary1-term DEFAULT 'Buchung*'.
**********************************************************************
* START-OF-SELECTION
**********************************************************************
START-OF-SELECTION.
* Wildcard ersetzen
DATA(lv_term) = replace( val = p_term sub = '*' with = '%' occ = 0 ).
* Daten aus dem Glossar holen
SELECT
guid_glos,
langu,
term,
termuc
INTO TABLE @it_terms
FROM glossary1
WHERE term LIKE @lv_term.
TRY.
* SALV-Table
DATA: o_salv TYPE REF TO cl_salv_table.
cl_salv_table=>factory( IMPORTING
r_salv_table = o_salv
CHANGING
t_table = it_terms ).
* Grundeinstellungen
o_salv->get_functions( )->set_all( abap_true ).
o_salv->get_columns( )->set_optimize( abap_true ).
o_salv->get_display_settings( )->set_list_header( 'Übersetzungen' ).
o_salv->get_display_settings( )->set_striped_pattern( abap_true ).
o_salv->get_selections( )->set_selection_mode( if_salv_c_selection_mode=>row_column ).
* Spaltenüberschriften: technischer Name und Beschreibungstexte
LOOP AT o_salv->get_columns( )->get( ) ASSIGNING FIELD-SYMBOL(<c>).
DATA(o_col) = <c>-r_column.
o_col->set_short_text( || ).
o_col->set_medium_text( || ).
o_col->set_long_text( |{ o_col->get_columnname( ) } [{ o_col->get_long_text( ) }]| ).
ENDLOOP.
SET HANDLER lcl_events=>on_double_click FOR o_salv->get_event( ).
o_salv->display( ).
CATCH cx_root INTO DATA(e_txt).
WRITE: / e_txt->get_text( ).
ENDTRY.