Académique Documents
Professionnel Documents
Culture Documents
* Some constants
CONSTANTS:
qs_sysfail LIKE trfcqin-qstate VALUE 'SYSFAIL',
qs_cpicerr LIKE trfcqin-qstate VALUE 'CPICERR',
qs_stop LIKE qrfctrace-qstate VALUE 'STOP',
qs_noexec LIKE trfcqin-qstate VALUE 'NOEXEC',
qs_saved LIKE trfcqins-qstate VALUE 'SAVED'.
* Data type declaration
DATA:
lt_qview TYPE TABLE OF trfcqview,
ls_qview TYPE trfcqview,
lv_state TYPE qrfcstate,
nfill TYPE i.
* Input screen
SELECTION-SCREEN BEGIN OF BLOCK start
WITH FRAME
TITLE text-001.
PARAMETERS qname LIKE trfcqin-qname
DEFAULT 'CF*'.
SELECT-OPTIONS status FOR lv_state
NO INTERVALS
OBLIGATORY
DEFAULT qs_noexec.
PARAMETERS all_luws LIKE sy-input
AS CHECKBOX
DEFAULT SPACE.
SELECTION-SCREEN END OF BLOCK start.
START-OF-SELECTION.
* Delete duplicates queue states
SORT status.
DELETE ADJACENT DUPLICATES FROM status.
* Get queues
CALL FUNCTION '/SAPAPO/CIF_QIN_GET_QUEUES'
EXPORTING
qname = qname
TABLES
qview = lt_qview[].
DESCRIBE TABLE lt_qview[] LINES nfill.
IF nfill = 0.
WRITE: / 'Such queue is not available'(002).
EXIT.
ENDIF.
* Reset queue states
nfill = 0.
LOOP AT lt_qview
INTO ls_qview.
IF ls_qview-qstate IN status[].
CALL FUNCTION 'TRFC_QIN_RESET_LUW'
EXPORTING
qname = ls_qview-qname
all_luws = all_luws.
IF sy-subrc = 0.
IF all_luws <> space.
nfill = nfill + ls_qview-qdeep.
ELSE.
nfill = nfill + 1.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
* Activate scheduler
CALL FUNCTION 'QIWK_SCHEDULER_ACTIVATE'.
* Result
WRITE: /(25) 'Number of reset entries:'(003), (4) nfill.
*&--------------------------------------------------------------------*
*& Form status_f4_help
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM status_f4_help.
****** DATA DEF ********************************************************
DATA: BEGIN OF l_full_table OCCURS 0,
status LIKE trfcqin-qstate,
END OF l_full_table.
DATA: l_selectfield LIKE help_info-fieldname.
DATA: l_ind LIKE sy-tabix.
DATA: BEGIN OF l_fields OCCURS 0.
INCLUDE STRUCTURE help_value.
DATA: END OF l_fields.
DATA: BEGIN OF l_user_sel_fields OCCURS 0.
INCLUDE STRUCTURE dynpread.
DATA: END OF l_user_sel_fields.
DATA: l_rc LIKE sy-subrc.
DATA cursorfield(30). " for name of current dynprofield
DATA: ls_user_selfields LIKE l_user_sel_fields.