Skip to Content
Dec 10, 2021 at 06:04 PM

SAPGui Script to Export Spool Once Complete

139 Views Last edit Jan 04 at 09:02 PM 2 rev

I have an SAPGui script that executes a job in the background, and I want it to then go to SM37 and export the spool once the job is finished.

Is there a way to have the script WAIT until the status is 'Finished' and then export the spool? I have the first 3 steps complete, but I am struggling to figure out how to track the status and export it once the job's completed. Any suggestions? I could also use SP02 to get the spool, but it doesn't show up there until the job is finished either.

1. Run TCode

2. Execute in Background

3. Go to SM37

4. Refresh until status of specified job is FINISHED

5. Once finished, export spool.