Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Automating WEINBQUEUE

Former Member
0 Kudos

Transaction WEINBQUEUE will process/reactivate/restart an IDOC queue one at a time, one clicks on the queue name and then click the activate button to restart the queue.

We have the scenario where there can be many queues (eg. one queue per unique Purchase Requistion Number), does anyone know if there is a transaction which will mass process/reactivate/restart idocs in multiple queues ?

1 REPLY 1

SF_1
Explorer
0 Kudos

HI Michelle,

I've also had the same need to restart/reprocess/ in multiple queues on HR module, but the only solution was to crate a custom report and then you can schedule it.

If you can help, could you check this code:

REPORT zhrg_restart_inbqueue.

TABLES: ediqi,

edidc.

DATA: lt_ediqi TYPE STANDARD TABLE OF ediqi,

ls_ediqi LIKE LINE OF lt_ediqi.

DATA: anzahl TYPE i.

DATA: l_counter TYPE i.

DATA: l_syn_activ(1).

DATA: BEGIN OF control OCCURS 0,

counter LIKE ediqi-counter,

docnum LIKE edidc-docnum,

queuename LIKE ediqi-queuename,

sender LIKE ediqi-absender,

END OF control.

DATA: ls_control LIKE LINE OF control.

DATA: BEGIN OF status_control OCCURS 0,

docnum LIKE edidc-docnum,

status LIKE edidc-status,

END OF status_control.

DATA: BEGIN OF spool OCCURS 0,

counter TYPE ediqi-counter,

docnum TYPE edidc-docnum,

queuename TYPE ediqi-queuename,

sender TYPE ediqi-absender,

akn_status TYPE char10,

END OF spool.

DATA: ls_spool LIKE LINE OF spool.

SELECT-OPTIONS: nqueue FOR ediqi-queuename,

sender FOR ediqi-absender,

docnum FOR ediqi-docnum.

START-OF-SELECTION.

SELECT * FROM ediqi INTO CORRESPONDING FIELDS OF TABLE lt_ediqi

WHERE queuename IN nqueue AND

absender IN sender.

IF sy-subrc EQ 0.

LOOP AT lt_ediqi INTO ls_ediqi.

control-counter = ls_ediqi-counter.

control-docnum = ls_ediqi-docnum.

control-queuename = ls_ediqi-queuename.

control-sender = ls_ediqi-absender.

APPEND control.

ENDLOOP.

ENDIF.

SORT control BY counter.

l_counter = 0.

LOOP AT control INTO ls_control.

l_syn_activ = ' '.

SELECT docnum status FROM edidc APPENDING

CORRESPONDING FIELDS OF TABLE status_control

WHERE docnum = ls_control-docnum.

IF sy-subrc EQ 0.

READ TABLE status_control WITH KEY status = '60'.

IF sy-subrc EQ 0.

l_syn_activ = 'X'.

ENDIF.

IF l_syn_activ = ' '. " dann anstarten

DESCRIBE TABLE control LINES anzahl.

SUBMIT rseinbqueue WITH p_queue = ls_control-queuename

WITH p_sender = ls_control-sender

AND RETURN.

SELECT SINGLE * FROM edidc WHERE docnum EQ ls_control-docnum.

IF edidc-status EQ '53'.

ADD 1 TO spool-counter.

spool-docnum = ls_control-docnum.

spool-queuename = ls_control-queuename.

spool-sender = ls_control-sender.

spool-akn_status = 'SUCCESS'.

APPEND spool.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

DATA: numqueue TYPE i.

DESCRIBE TABLE spool LINES numqueue.

END-OF-SELECTION.

FORMAT COLOR 4 INTENSIFIED ON.

WRITE: /2 'Restart Queue Result:'.

SKIP.

WRITE: /4 'Queue restarted', 22 numqueue.

SKIP.

FORMAT COLOR OFF.

LOOP AT spool INTO ls_spool.

SKIP 2.

WRITE: /4 'DOCNUM:', 22 ls_spool-docnum.

WRITE: /4 'QUEUE NAME:', 22 ls_spool-queuename.

WRITE: /4 'SENDER:', 22 ls_spool-sender.

WRITE: /4 'STATUS_AKN:', 22 ls_spool-akn_status.

ENDLOOP.

Regards

Luca Messinese

HR Programming