Folgende Benutzer bedankten sich beim Autor a-dead-trousers für den Beitrag:
Gokar
Code: Alles auswählen.
FORM test_get_custom_container_name.
DATA: ir_gui_control TYPE REF TO cl_gui_control.
DATA: ir_gui_custom_container TYPE REF TO cl_gui_custom_container.
DATA: iv_name TYPE string.
DATA: iv_string TYPE string.
**********************************************************************
CALL METHOD cl_gui_control=>get_focus
IMPORTING
control = ir_gui_control
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
RETURN.
ENDIF.
*--------------------------------------------------------------------*
IF ir_gui_control->parent IS NOT INITIAL.
ir_gui_custom_container ?= ir_gui_control->parent.
ENDIF.
IF ir_gui_custom_container IS INITIAL.
RETURN.
ENDIF.
*--------------------------------------------------------------------*
iv_name = ir_gui_custom_container->get_name( ).
IF iv_name IS INITIAL.
RETURN.
ENDIF.
*--------------------------------------------------------------------*
CONCATENATE 'Name des aktiven Custom-Containers:' iv_name INTO iv_string SEPARATED BY space.
MESSAGE iv_string TYPE 'S'.
ENDFORM.