之前说过一个Main Menu的架构,虽然实现难度不是很大,但是却可以省去用户很多麻烦。所有的T-code都集中在一个屏幕上,再也不用记那么多繁杂的T-code了。
主要是在Menu Bar里加上相应的T-code和描述,下面是代码的实现。很简单吧!但很实用!
*----------------------------------------------------------------------*
* Program Name: ZARCH_MAINMENU
* Project : N/A
* Author : Kevin.Zhang
* Date : 2007.1.1
* Module : N/A
* Description : Template of Program
*
*
*
* Special features: N/A
*
*
*----------------------------------------------------------------------*
* Modifications:
* Author Date Commented as Description
*----------- -------- ----------- ----------------------------------*
*
*----------------------------------------------------------------------*
REPORT ZARCH_MAINMENU.
*$*$----------------------------------------------------------------$*$*
*$*$ Global Types, Data Statements, Ranges, Constants $*$*
*$*$----------------------------------------------------------------$*$*
*-----------------------------------------------------------------------
* Variables
*-----------------------------------------------------------------------
DATA: GV_TCODE LIKE SY-TCODE.
*$*$----------------------------------------------------------------$*$*
*$*$ Main Program $*$*
*$*$----------------------------------------------------------------$*$*
*--------- START-OF-SELECTION ----------
START-OF-SELECTION.
* Empty screen used just to display the GUI status.
CALL SCREEN 001.
*--------- END-OF-SELECTION ----------
END-OF-SELECTION.
*&---------------------------------------------------------------------*
*& Module STATUS_0001 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_0001 OUTPUT.
* Archiving Area Menu
SET TITLEBAR '001'.
SET PF-STATUS 'ARCHMENU'.
ENDMODULE. " STATUS_0001 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0001 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0001 INPUT.
IF ( SY-UCOMM = 'BACK' ) OR ( SY-UCOMM = 'EXIT' ) OR
( SY-UCOMM = 'CANCEL' ) OR ( SY-UCOMM = 'SE38' ).
LEAVE PROGRAM.
ELSEIF ( SY-UCOMM = SPACE ).
EXIT.
ELSE.
GV_TCODE = SY-UCOMM.
CALL TRANSACTION GV_TCODE.
ENDIF.
ENDMODULE. " USER_COMMAND_0001 INPUT
阅读(1703) | 评论(0) | 转发(0) |