Skip to Content
author's profile photo Former Member
Former Member

How can I execute 6 sessions in parallel?

Hi

I've been working on this for a couple of weeks. I've searched the internet (including scn.sap.com 😊), asked people and have come up empty.

this site/discussion area has been a great help, but I can't find a way to execute multiple sessions at once.

here's the scenario.

I have 6 custom reports that I run daily that take 30 minutes to run serially. If I run multiple sessions in parallel, It takes 5 to 10 minutes.

Using excel/VBA, I have connected to SAP, started 6 sessions (session.createsession), each session navigates to its custom report screen, set variant and now want to run them at the same time/in parallel/asynchronous/concurrently...

I've tried "SendVKey 8" and .Press (execute button), but they execute one at a time instead of all at once.

Here's a test with 2 sessions. control isn't returned each step is complete.

With SAPConnObj

.Children(0).FindById("wnd[0]").Restore 'make active

.Children(0).FindById("wnd[0]").SendVKey 8

'.Children(0).FindById("wnd[0]/tbar[1]/btn[8]").Press

.Children(3).FindById("wnd[0]").Restore 'make active

.Children(3).FindById("wnd[0]").SendVKey 8

'.Children(3).FindById("wnd[0]/tbar[1]/btn[8]").Press

End With

I can't believe I'm the only one that wants to do this.

If I can't run them in parallel, can I run them in the background?

that may accomplish the same thing.

Any help/code would be appreciated.

Regards,

Steve

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jul 14, 2013 at 07:16 AM

    Hello Steve,

    as far as I know is VBA single threaded and it is not possible to run multiple threads or processes.

    I think one way is to code six different VBScript files with your code. Start each from Excel with the VBA command Shell, here an example:

    Shell "wscript.exe MyScript1.vbs"

    Shell "wscript.exe MyScript2.vbs"

    etc. etc. etc.

    Let us know if it works.

    Cheers

    Stefan

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.