How to….Automate “Reset Interrupt” in Process Chain
The purpose of this document is to replace the manual activity by automating “Reset Interrupt” in Process Chain
INTRO:
In Release SAP NetWeaver 7.0, several functions have been added to the process chain maintenance, one of them is “Interrupt” process type, replacing Event collector.
Using Interrupt process type, we can make the process chain step to wait until the desired condition is satisfied. These conditions will be same as start variant conditions in process chain.
Requirement:
We have a situation wherein Process chain step has to wait until an external/Internal event finishes.
Below case is one of them –
Suppose we have Interrupt in the middle of process chain which has been scheduled based on the event. The process chain has to wait at Interrupt step until the event triggers the Interrupt and then the next steps of process chain should proceed.
What happens if the event is triggered before the Interrupt step in process chain is hit?
The answer is Interrupt step will not wait for the event. As the event is already completed, process chain Interrupt step will be green and goes to the next step of the process chain without waiting.
This case does not fulfill the desired condition to stop at the interrupt step.
Solution:
To solve this, in the planning view of the process chain, in context menu of Interrupt process we have to use “Reset Interrupt”.
With reset Interrupt, process chain Interrupt step will wait for event to trigger despite of event in unusual times.
How this works? Let us look at the background.
Interrupts in process chain will be logged in RSPCINTERRUPTLOG table.Whenever interrupt is triggered, an entry is created in RSPCINTERRUPTLOG table.
If an Interrupt is triggered before Interrupt step in process chain is run then it creates an entry as in below screen with BLANK “Log-ID of a process chain” and “Instance ID”.
Since the event is already triggered, the process chain assumes the Interrupt step is Green, because of the entry in the table process chain proceeds to the next Chain step.
When we use Reset Interrupt as in below screen,
We can see the status as “Interrupt was successfully reset”.
That is, Reset Interrupt will delete the record from table RSPCINTERRUPTLOG with blank log_id. (Below screen)
Conclusion is Every time when the event is triggered multiple times, we have to manually run “Reset Interrupt”.
Automating:
To overcome the manual activity of “Reset Interrupt”, a small code to be incorporated in process chain before the Interrupt step.
In SE38, create a program
CODE:
CALL METHOD cl_rspc_interrupt=>reset
EXPORTING
i_variant = VARIANT
i_chain = CHAIN
.
Include the Program in process chain before Interrupt step as in below screen.
Once we include the above steps in process chain, we can see the log showing the successful reset
If no open run found then the program runs without issues.
http://help.sap.com/saphelp_nw70/helpdata/en/58/9c6c4251e4c153e10000000a1550b0/frameset.htm
Hello Chandra,
Thanks for above guide, it has been helpful.
One question I am asked is "how does one skip an active interrupt", as there have been times that the interrupt condition has not been met, but the need to continue the chain is desired.
Thanks again for the guide.
Richard
Hi Richard,
Thank you for reading my document.
Coming to your question - I had the same situation when developing this chain. In this case, I had used XOR condition in process chain with another Interrupt(Timely Interrupt) if the interrupt doesn't trigger(Chain step "Wait for xxx to complete").
or else you can trigger the Interrput(if it is Event based). Please refer this document regarding the event based trigger.
Self-loop of Process chain
Hope this helps.
Regards
Chandra
Hi Chandra,
Thanks for your article, it is very helpful.
To echo others, thanks for taking the time to post this.
I was going to spend today working out a way around the multiple event triggers before a single interrupt run each morning which didn't wait.
Saved me a job!