Warning: This article contains a very advanced topic that is a workaround to executing Universal Functions in certain special events that the SAP SDK can't normally handle. As this is a workaround, there is no guarantee this will work in all situations (especially if you try to apply it on a line-level event).
What is an out-of-process execution?
Normally when you execute a Universal Function it is done as part of the event and is being executed as part of the event:
- Normal Event Execution
- Event Start
- Execution of UF
- Event End
In an "out of process" (or "out of event" you could also call it) execution, we instead let the event end and in certain rare cases this resolves issues at the expense of the risk of perhaps introducing others
- Out-of-Process Execution
- Event Start
- Run a Dynamic code that causes the execution of another UF to run out of the process
- Event End
- Execution of UF entered in [Technically happing on another process thread so happen at the same time as event end]
The Dynamic Code UF that allows this to happen
In order to do out-of-process execution, you need a special Dynamic Code UF to force it out of process
You do not need to understand everything this does, but on the first line, you need to enter the UF-Code that you wish to run (aka the one that has issues).
(The UF is attached to this article for import)
So what you need to do is find the place that you normally call the trouble UF and instead let it call the UF-OUT-OF-PROCESS UF...
For example, if it is a Function Button calling you UF called UF-001
- Before
- Function Button > Called UF-001 Directly
- After
- Function Button > Called UF-OUT-OF-PROCESS > UF-001 (Out of process)
The "dangers" of out-of-process execution
As mentioned, while this might be able to solve some special scenarios, it is not a sure-fire workaround as the method have the following drawbacks
- Since it is out of process/event the GUI is not locked while the UF is executing so if the user does something they might "mess up" the execution, especially if it is a UF taking a long time
- Since we are out of process Block Event can't be executed this way (aka you can't example use this to validate something and then example block the Add of a Document)
- Current Row information is lost in the process, so might not work on line level events
Comments
0 comments
Please sign in to leave a comment.