螢幕控制示例程式

mmccking發表於2009-06-15
轉來的,全面的程式控制內容,很不錯。[@more@]

*&---------------------------------------------------------------------*
*& Report ZTEST_RAY *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*

REPORT ZTEST_RAY .
*REPORT dynamic_selscreen.

**DECLARATIONS FOR SELECTION SCREEN STATUS
DATA IT_UCOMM TYPE TABLE OF SY-UCOMM.

SELECTION-SCREEN BEGIN OF BLOCK B01 WITH FRAME.
PARAMETERS : PA RADIOBUTTON GROUP RAD USER-COMMAND COM,
PB RADIOBUTTON GROUP RAD.

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (10) TEXT001 MODIF ID R01.
SELECTION-SCREEN POSITION 15.
PARAMETERS P_UP(10) TYPE C MODIF ID R01.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (10) TEXT002 MODIF ID R02.
SELECTION-SCREEN POSITION 15.
PARAMETERS P_DOWN(10) TYPE C MODIF ID R02.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (10) TEXT003 MODIF ID R02.
SELECTION-SCREEN POSITION 15.
PARAMETERS P_CHE AS CHECKBOX MODIF ID R02.
SELECTION-SCREEN END OF LINE.


SELECTION-SCREEN END OF BLOCK B01.

INITIALIZATION.
TEXT001 = '??????'.
TEXT002 = '??????'.
TEXT003 = '?????'.


LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'R01'.
SCREEN-INTENSIFIED = '1'.
SCREEN-ACTIVE = 1.
SCREEN-DISPLAY_3D = '1'.
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 = 'R02'.
SCREEN-INTENSIFIED = '0'.
SCREEN-ACTIVE = 0.
SCREEN-DISPLAY_3D = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.

AT SELECTION-SCREEN OUTPUT.
IF PA = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'R01'.
SCREEN-INTENSIFIED = '1'.
SCREEN-ACTIVE = 1.
SCREEN-DISPLAY_3D = '1'.
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 = 'R02'.
SCREEN-INTENSIFIED = '0'.
SCREEN-ACTIVE = 0.
SCREEN-DISPLAY_3D = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.

ELSEIF PB = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'R02'.
SCREEN-INTENSIFIED = '1'.
SCREEN-ACTIVE = 1.
SCREEN-DISPLAY_3D = '1'.
MODIFY SCREEN.
ENDIF.
IF SCREEN-GROUP1 = 'R01'.
SCREEN-INTENSIFIED = '0'.
SCREEN-ACTIVE = 0.
SCREEN-DISPLAY_3D = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

**CUSTOMISING THE TOOLBARS OF THE SELECTION SCREEN
**WITH F8 BUTTON DISABLED
APPEND : 'PRIN' TO IT_UCOMM,
'SPOS' TO IT_UCOMM,
'ONLI' TO IT_UCOMM.
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
P_STATUS = SY-PFKEY
TABLES
P_EXCLUDE = IT_UCOMM.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8356764/viewspace-1023155/,如需轉載,請註明出處,否則將追究法律責任。

相關文章