Hi,
The only way I know involves creating a nested LUW - opening a new internal session by calling ABAP program using SUBMIT ... AND RETURN or a CALL transaction code.
Meaning, you'd have to code your logic in a report program/transaction, use the function module to merely call that report/transaction and, if necessary, use EXPORT/IMPORT or SHARED MEMORY to exchange data between the sessions. It's quite "ugly" solution IMO, and it involves session handling overhead, which can make it unsuitable for time-critical mass processing.
Cheers,
Janis