on 05-16-2016 7:19 AM
Hi,
Im quite new with SAP and i tried to record a script to download some reports, the script is working well in my laptop, but doesnt in the other, the problem as i know is about the SAP Window session size, its not the same with the one i have recorded in my Laptop.
And yes, the report does not have any T-Code to access to.
Is there any way to fix it?
I Tried both maximize, resizeWorkingPane false or true. And as i know its clicking to the node
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
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
End If
session.findById("wnd[0]").resizeWorkingPaneEx 1131,1092,false
Session.FindById("wnd[0]/tbar[0]/okcd").Text = "/nSRET"
Session.FindById("wnd[0]").SendVKey 0
Session.FindById("wnd[0]/usr/lbl[5,11]").SetFocus 'First Node
Session.FindById("wnd[0]").SendVKey 2
Session.FindById("wnd[0]/usr/lbl[9,20]").SetFocus 'Second Node'
Session.FindById("wnd[0]").SendVKey 2
Session.FindById("wnd[0]/usr/lbl[13,34]").SetFocus 'Third Node
Session.FindById("wnd[0]").SendVKey 2
Session.FindById("wnd[0]/usr/lbl[20,37]").SetFocus 'This node has failed coz wrong node i need
Session.FindById("wnd[0]").SendVKey 2
Hello.
replace this Code line
session.findById("wnd[0]").resizeWorkingPaneEx 1131,1092,false
with
session.findById("wnd[0]").Maximize
This should work.
best regards
Holger
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Holger,
Thanks for your reply, and sorry coz my question is unclear, i want to work with other Computer, not only in my Laptop.
The issue here seem come from the windows's resolution, my Laptop is in 1920*1080 but other computer is 1366*768.
Is there any way to fix it work in other resolution? I want to share the scrip for my Operators also
Hello,
I Tried as you Suggested but still getting error.
As i understand, the script is runing by clicking to node by positions, it does not search the label, if scroll till the label visible then how to get the node's position (in this line i need to replace the bold number i have makred),
Session.FindById("wnd[0]/usr/lbl[20,37]").SetFocus 'This node has failed coz wrong node i need
Session.FindById("wnd[0]").SendVKey 2
Hi Binh,
If the nodes are moving, you can loop through them and search the ones you want based on string.
Eg.
for i = 0 to 100
if Session.findById("wnd[0]/usr/lbl[" & i & ",3]").Text = "This or That" then
Session.findById("wnd[0]/usr/lbl[" & i & ",3]").setfocus
session.findById("wnd[0]").sendVKey 2
end if
next i
João Paulo da Rosa wrote:
Hi Holger, I'm with other problem. Can you help me? The error is on the line "Set Session = Connection.Children(1)"
Simple and Easy -
The Enumeration always begins in 0 ....
unless you have no second Window in SAP opened this error occurs
Set it to 0 and everything will work - or open up a second Window
Greetings -.-..-
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.