点击此处---> 群内免费提供SAP练习系统(在群公告中)
加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)
代码示例:
TCODE:SWO1 创建附件对象(GOS)
REPORT ZGOS."如何使用系统附件.
PARAMETERS R_1 RADIOBUTTON GROUP 1 DEFAULT 'X'.
PARAMETERS R_2 RADIOBUTTON GROUP 1 .
DATA GV_TEXT TYPE CHAR25.
START-OF-SELECTION.
CALL SCREEN 900.
*&---------------------------------------------------------------------*
*& Module STATUS_0900 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_0900 OUTPUT.
DATA: GR_GOS_MANAGER TYPE REF TO CL_GOS_MANAGER,
GS_BORIDENT TYPE BORIDENT.
CASE 'X'.
WHEN R_1.
WRITE '正在点击''选项一''' TO GV_TEXT CENTERED.
IF GR_GOS_MANAGER IS INITIAL.
GS_BORIDENT-OBJTYPE = 'ZTEST'.
GS_BORIDENT-OBJKEY = 'R_1'.
CREATE OBJECT GR_GOS_MANAGER
EXPORTING
IS_OBJECT = GS_BORIDENT
IP_NO_COMMIT = ' '
EXCEPTIONS
OBJECT_INVALID = 1.
ENDIF.
WHEN R_2.
WRITE '正在点击''选项二''' TO GV_TEXT CENTERED.
IF GR_GOS_MANAGER IS INITIAL.
GS_BORIDENT-OBJTYPE = 'ZTEST'.
GS_BORIDENT-OBJKEY = 'R_2'.
CREATE OBJECT GR_GOS_MANAGER
EXPORTING
IS_OBJECT = GS_BORIDENT
IP_NO_COMMIT = ' '
EXCEPTIONS
OBJECT_INVALID = 1.
ENDIF.
WHEN OTHERS.
ENDCASE.
SET PF-STATUS '900'.
ENDMODULE. " STATUS_0900 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0900 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0900 INPUT.
IF SY-UCOMM = 'BACK'.
LEAVE TO SCREEN 0.
ENDIF.
ENDMODULE. " USER_COMMAND_0900 INPUT
运行程序
测试完结。
原创程序,转载请注明出处,谢谢合作!