文本编辑器程序
测试程序:ZLITEST_006,ZLITEST007.
*&---------------------------------------------------------------------*
*& Report ZLITEST_006
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZLITEST_006.
DATA:OK_CODE TYPE SY-UCOMM.
DATA:SAVE_OK TYPE SY-UCOMM.
DATA:INIT.
DATA:CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
DATA:EDITOR TYPE REF TO CL_GUI_TEXTEDIT.
DATA:M1(256) TYPE C OCCURS0,
LINE(256) TYPE C.
LINE = 'PLEASE INPUT'.
APPEND LINE TO M1.
CALL SCREEN100.
REFRESH M1.
CALL METHOD EDITOR->GET_TEXT_AS_R3TABLE
* EXPORTING
* ONLY_WHEN_MODIFIED = FALSE
IMPORTING
TABLE = M1
* IS_MODIFIED =
* EXCEPTIONS
* ERROR_DP = 1
* ERROR_CNTL_CALL_METHOD = 2
* ERROR_DP_CREATE = 3
* POTENTIAL_DATA_LOSS = 4
* OTHERS = 5
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT M1 INTO LINE.
WRITE / LINE.
ENDLOOP.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK.
WHEN'EXIT'.
LEAVE TO SCREEN0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
IF INIT IS INITIAL.
INIT = 'X'.
CREATE OBJECT CONTAINER
EXPORTING
* PARENT =
CONTAINER_NAME = 'P1'
* STYLE =
* LIFETIME = LIFETIME_DEFAULT
* REPID =
* DYNNR =
* NO_AUTODEF_PROGID_DYNNR =
* EXCEPTIONS
* CNTL_ERROR = 1
* CNTL_SYSTEM_ERROR = 2
* CREATE_ERROR = 3
* LIFETIME_ERROR = 4
* LIFETIME_DYNPRO_DYNPRO_LINK = 5
* OTHERS = 6
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT EDITOR
EXPORTING
* MAX_NUMBER_CHARS =
* STYLE = 0
WORDWRAP_MODE = CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_P OSITION
WORDWRAP_POSITION = 256
WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>TRUE
* FILEDROP_MODE = DROPFILE_EVENT_OFF
PARENT = CONTAINER
* LIFETIME =
* NAME =
* EXCEPTIONS
* ERROR_CNTL_CREATE = 1
* ERROR_CNTL_INIT = 2
* ERROR_CNTL_LINK = 3
* ERROR_DP_CREATE = 4
* GUI_TYPE_NOT_SUPPORTED = 5
* OTHERS = 6
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
CALL METHOD EDITOR->SET_TEXT_AS_R3TABLE
EXPORTING
TABLE = M1
* EXCEPTIONS
* ERROR_DP = 1
* ERROR_DP_CREATE = 2
* OTHERS = 3
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
列表和屏幕相互调用
测试程序:ZLITEST_008, ZLITEST_009.
*&---------------------------------------------------------------------*
*& Report ZLITEST_008
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZLITEST_008.
TABLES: SPFLI.
DATA:OK_CODE TYPE SY-UCOMM.
DATA:SAVE_OK TYPE SY-UCOMM.
DATA:IO1(20) TYPE C.
CALL SCREEN100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'STATUS1'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module CANCEL INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE CANCEL INPUT.
LEAVE PROGRAM.
ENDMODULE. " CANCEL INPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.
SAVE_OK = OK_CODE.
CLEAR:OK_CODE.
CASE SAVE_OK.
WHEN'BI1'.
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN0.
SUPPRESS DIALOG.
SELECT *
INTO SPFLI
FROM SPFLI WHERE CARRID = IO1.
iapp免费源码分享网站WRITE: / SPFLI-CARRID, SPFLI-CONNID,
SPFLI-CITYFROM, SPFLI-CITYTO.
ENDSELECT.
WRITE : / 'DONE'.
WHEN'BI2'.
IO1 = ''.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论