Code: Alles auswählen.
REPORT LINE-SIZE 1000.
DATA: gt_tab TYPE STANDARD TABLE OF REF TO cl_gui_textedit.
FIELD-SYMBOLS: <tab> LIKE LINE OF gt_tab.
DATA: cl_container TYPE REF TO cl_gui_docking_container.
END-OF-SELECTION.
CREATE OBJECT cl_container
EXPORTING
ratio = 50
no_autodef_progid_dynnr = 'X'
EXCEPTIONS
OTHERS = 6.
DO 6 TIMES.
WRITE:/ sy-index HOTSPOT ON COLOR = sy-index.
HIDE sy-index.
PERFORM get_text USING sy-index.
ENDDO.
CLEAR sy-index.
AT LINE-SELECTION.
CHECK sy-index > 0.
PERFORM umhaengen USING sy-index.
CLEAR sy-index.
*&---------------------------------------------------------------------*
*& Form get_text
*&---------------------------------------------------------------------*
FORM get_text CHANGING p_index TYPE syindex.
DATA: cl_text TYPE REF TO cl_gui_textedit.
DATA: t_text TYPE STANDARD TABLE OF text40,
wa_text LIKE LINE OF t_text.
wa_text = p_index.
DO p_index TIMES.
APPEND wa_text TO t_text.
ENDDO.
CREATE OBJECT cl_text
EXPORTING
parent = cl_container
EXCEPTIONS
OTHERS = 6.
CALL METHOD cl_text->set_text_as_r3table
EXPORTING
table = t_text
EXCEPTIONS
OTHERS = 3.
APPEND cl_text TO gt_tab.
ENDFORM. " get_text
*&---------------------------------------------------------------------*
*& Form umhaengen
*&---------------------------------------------------------------------*
FORM umhaengen USING p_index TYPE syindex.
DATA: cl_text TYPE REF TO cl_gui_textedit.
LOOP AT gt_tab INTO cl_text.
IF sy-tabix <> p_index.
CALL METHOD cl_text->set_visible
EXPORTING
visible = ''
EXCEPTIONS
OTHERS = 3.
ELSE.
CALL METHOD cl_text->set_visible
EXPORTING
visible = 'X'
EXCEPTIONS
OTHERS = 3.
ENDIF.
ENDLOOP.
ENDFORM. " umhaengen