02/08/2010

Create a Text Field


*-----------------------------------------------------------------------
* This program creates a text field which you can use as an editor.
* Create a screen 0100 and on it draw a container named 'TEXTEDIT' as
* big as you wish.
*-----------------------------------------------------------------------
REPORT ztest NO STANDARD PAGE HEADING.

DATA: init,
okcode LIKE sy-ucomm,
container TYPE REF TO cl_gui_custom_container,
editor TYPE REF TO cl_gui_textedit.

START-OF-SELECTION.
CALL SCREEN 0100.

*-----------------------------------------------------------------------
* Module STATUS_0100 OUTPUT
*-----------------------------------------------------------------------
MODULE status_0100 OUTPUT.

SET PF-STATUS 'STATUS-100'.
SET TITLEBAR '100'.

IF init IS INITIAL.
init = 'X'.
CREATE OBJECT: container EXPORTING container_name = 'TEXTEDIT',
editor EXPORTING parent = container.

ENDIF.
ENDMODULE.



*-----------------------------------------------------------------------
* Module USER_COMMAND_0100 INPUT
*-----------------------------------------------------------------------
MODULE user_command_0100 INPUT.

CASE okcode.
WHEN 'CANC' OR 'BACK'.
SET SCREEN 0.
WHEN OTHERS.
LEAVE PROGRAM.
ENDCASE.

ENDMODULE.

Nenhum comentário:

Postar um comentário