cancel
Showing results for 
Search instead for 
Did you mean: 

SAPGui Script to Export Spool Once Complete

0 Kudos

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.

former_member763929
Participant
0 Kudos

Thank you for visiting SAP Community to get answers to your questions. Since this is your first question, I recommend that you familiarize yourself with Community Q&A , as the overview provides tips for preparing questions that draw responses from our members.

Should you wish, you can revise your question by selecting Actions, then Edit.

By adding a picture to your Profile you encourage readers to respond.

Accepted Solutions (0)

Answers (1)

Answers (1)

mbov
Explorer
0 Kudos

To check for the spool, maybe something like that would do:

Do 
{ Sleep for a while
session.StartTransaction["SP02"]
} while (spool not available condition)
Get spool

c# example:

do
{
Thread.Sleep(5000);
session.StartTransaction["SP02"];
} while (session.FindById["wnd[0]/somethingsomething"].Text != thisSpool)
string createdSpool = session.FindById["wnd[0]/somethingsomething"].Text;