on 04-30-2014 12:20 PM
Hi,
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.
Thanks,
Jaywant
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
greetings
Thomas B
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
Yes I have to handle both the session simultaneously. Let me illustrate further.
I have to update some (10k- 15k) products from a z table in CRM. We have a custom program for this.
So, i use se38 and insert a breakpoint in the program (to make the updates to a field) and then execute it. Now I start my script recorder. Provide inputs to the program and hit execute.
At this point my script recorder is running on the se38 window and not on the debugger window !
I change the values and press F8. These manual updates do not get captured by script recorder.
But, if I start my recorder once the debugger window was opened already, I can capture all these changes.
So we have things like this...
Script1.vbs --> Events captured in se38
Script2.vbs --> Events captured in the debugger
If I merge them and run, the recorder is not handling the new debugger session and the execution halts to get the "excel is waiting for another ole action"
Thanks,
Jaywant
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
msgbox sapsession1.info.Transaction
'sapsession2 handles the second Window
msgbox sapsession2.info.Transaction
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
Greetings
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.