首先创建1000屏幕,后面附屏幕相关代码和效果图示
*&---------------------------------------------------------------------*
*& Report ZQEVAC40 UD檢驗批迴轉REL狀態
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zqevac40.
*----------------------------------------------------------------------*
* Datendefinitionen
*----------------------------------------------------------------------*
* Tabellen
*----------------------------------------------------------------------*
TABLES sscrfields.
TABLES qals.
TABLES qave.
CONSTANTS:
c_rc_0 LIKE sy-subrc VALUE 0,
c_rc_4 LIKE sy-subrc VALUE 4,
c_rc_20 LIKE sy-subrc VALUE 20,
*
c_kreuz LIKE qm00-qkz VALUE 'X'.
*
*----------------------------------------------------------------------*
* Eingabebildschirm
SELECTION-SCREEN SKIP 2.
PARAMETERS prueflos LIKE qals-prueflos MATCHCODE OBJECT qals
MEMORY ID qls .
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF BLOCK search WITH FRAME.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 3(20) text-s01 USER-COMMAND sear.
SELECTION-SCREEN PUSHBUTTON 40(20) text-s02 USER-COMMAND show.
*--- text-s01 “Find insp .lot” text-s02 “Show insp .lot” prueflos “Inspection Lot “
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK search.
*----------------------------------------------------------------------*
AT SELECTION-SCREEN.
IF sscrfields-ucomm EQ 'SEAR'
OR prueflos IS INITIAL.
CALL FUNCTION 'QELA_START_SELECTION_OF_LOTS'
EXPORTING
i_selid = ' '
i_stat_aenderung = 'X'
i_stat_ero = 'X'
i_stat_frei = 'X'
i_stat_ve = ' '
IMPORTING
e_prueflos = prueflos
EXCEPTIONS
no_entry = 1
no_selected = 2
OTHERS = 3.
ENDIF.
IF sscrfields-ucomm EQ 'SHOW'.
CALL FUNCTION 'QSS1_LOT_SHOW'
EXPORTING
i_prueflos = prueflos.
ENDIF.
CHECK sscrfields-ucomm EQ 'ONLI'.
* ab hier mu# Pr#losnummer gef#lt sein.
IF prueflos IS INITIAL.
MESSAGE e164(qa).
ENDIF.
* Lesen Los
CALL FUNCTION 'ENQUEUE_EQQALS1'
EXPORTING
prueflos = prueflos.
CALL FUNCTION 'QPSE_LOT_READ'
EXPORTING
i_prueflos = prueflos
IMPORTING
e_qals = qals
EXCEPTIONS
no_lot = 1.
IF NOT sy-subrc IS INITIAL.
MESSAGE e102(qa).
ENDIF.
*-----------------
* Pr#en Status
CALL FUNCTION 'QAST_STATUS_CHECK'
EXPORTING
i_objnr = qals-objnr
i_status = 'I0218' "Status VE getroffen
EXCEPTIONS
status_not_activ = 1.
IF NOT sy-subrc IS INITIAL.
MESSAGE e102(qv) WITH qals-prueflos.
ENDIF.
*
CALL FUNCTION 'QEVA_UD_READ'
EXPORTING
i_prueflos = qals-prueflos
IMPORTING
e_qave = qave.