Code: Alles auswählen.
DATA:
r_cc TYPE REF TO cl_gui_custom_container,
r_tb TYPE REF TO cl_gui_toolbar,
r_te TYPE REF TO cl_gui_textedit.
CREATE OBJECT r_cc
EXPORTING
container_name = 'CC_TOOLBAR'.
IF sy-subrc <> 0.
MESSAGE 'Container nicht erzeugt.' TYPE 'E'.
ENDIF.
CREATE OBJECT r_tb
EXPORTING
parent = r_cc.
IF sy-subrc <> 0.
MESSAGE 'Toolbar nicht erzeugt.' TYPE 'E'.
ENDIF.
CALL METHOD r_tb->add_button
EXPORTING
fcode = 'FC_BTN_1'
text = 'Btn1'
icon = icon_incomplete
butn_type = cntb_btype_button.
CALL METHOD r_tb->add_button
EXPORTING
fcode = 'FC_BTN_2'
text = 'Btn2'
icon = icon_incomplete
butn_type = cntb_btype_button.
CREATE OBJECT r_te
EXPORTING
parent = r_cc
name = 'EDIT_TPLNR'
max_number_chars = 14
wordwrap_mode = cl_gui_textedit=>wordwrap_off
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE 'Edit-TPLNR nicht erzeugt.' TYPE 'E'.
ELSE.
CALL METHOD r_te->set_position
EXPORTING
left = 20
top = 20
width = 80
height = 20
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE 'Edit-TPLNR nicht positioniert.' TYPE 'E'.
ENDIF.
ENDIF.