cancel
Showing results for 
Search instead for 
Did you mean: 

SAP run multiple sessions concurrently through Excel

Former Member
0 Kudos

Hello everyone,

I have the code to connect to SAP and run transactions, upload information, and do similar tasks through Excel. But, I am trying to figure out how to run a series of reports through Excel at the same time. I can create multiple sessions, and correctly code the sessions. But, i can't seem to get the sessions to run at the same time. The code, being linear, will not move to the next sessions until the first session is complete. Any ideas on how to solve this?

Accepted Solutions (0)

Answers (1)

Answers (1)

script_man
Active Contributor
0 Kudos

Hi B.Connor,

if the scripts are directly related to the particular session, they can work in parallel with each other. This would for example if the first 10 rows starting as follows:

If Not IsObject(application) Then

   Set SapGuiAuto  = GetObject("SAPGUI")

   Set application = SapGuiAuto.GetScriptingEngine

End If

If Not IsObject(connection) Then

   Set connection = application.Children(0)

End If

If Not IsObject(session) Then

  Set session    = connection.Children(0)

End If

. . .

and

If Not IsObject(application) Then

   Set SapGuiAuto  = GetObject("SAPGUI")

   Set application = SapGuiAuto.GetScriptingEngine

End If

If Not IsObject(connection) Then

   Set connection = application.Children(0)

End If

If Not IsObject(session) Then

  Set session    = connection.Children(1)

End If

. . .

Regards,

ScriptMan