Skip to Content
avatar image
Former Member

How to handle multiple sessions in Script recorder


I have a requirement to update certain records from a program. For that I have to put a breakpoint the program (which I did manually).

Now when I use the scripting tool to record the events, only events related to the original session gets recorded. Any events on the newly opened debugger mode is not recorded !

However, I can record the events in the debugger separately.

So I have 2 scripts which are session dependent. In Session 1 my program runs and in session 2 (which opens the debugger in runtime) my edits need to be done.

How to create a VB script which can handle this session issue?

Went through this blog by Scriptman and since i am new couldnt get it working !!

Please help me with a framework to handle this issue.



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • May 01, 2014 at 05:25 PM

    hi Jaywant,

    First of all:
    Is it really necessary to handle your Operations in 2 Sessions? (2 different Windows?)

    Perhaps you can finish the first action in first session, and then begin the second task in the same session ?

    If possible can you tell a little precisly what you want to do ... (Transactions etc) -
    that would help much more


    Thomas B

    Add comment
    10|10000 characters needed characters exceeded

    • Allright,

      i tried a little yesterday -

      like i found out all you have to do is set the sessions in the makro-

      like this

      If Not IsObject(sapApplication) Then
         Set sapGuiAuto = GetObject("SAPGUI")
         Set sapApplication = sapGuiAuto.GetScriptingEngine()
      End If
      If Not IsObject(SAPConnection) Then
          Set SAPConnection = sapApplication.Children(0)
      End If
      If Not IsObject(sapsession1) Then
         Set sapsession1 = SAPConnection.Children(0)
      End If
      If Not isObject(sapsession2) then
           set sapsession2 = SAPConnection.Children(1)
      end if
      'sapsession1 handles the first Window
      'sapsession2 handles the second Window

      As long as you handle this step by step (you dont have the Abillity for Multi-Threading in VBA)

      you can come along with this