on 01-23-2012 8:21 PM
Hello
Can someone help me with the next issue.
I want to make an automated task, but i'm blocked at saving (overwriting) the result generate from SAP to an existing excel file.
When i lunch the .vbs script he auto complete the data i had recorded & generate the info. I use right mouse to spreadsheet & overwrite the excel file.
The script don't execute the last part. Choosing the location were the excel file is & overwriting him.
Sorry my english. Any ideas?
which tcode are you recording??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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]").maximize
session.findById("wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell").expandNode "F00006"
session.findById("wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell").selectedNode = "F00022"
session.findById("wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell").topNode = "Favo"
session.findById("wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell").doubleClickNode "F00022"
session.findById("wnd[0]/usr/ctxtP_TPLST").text = "9100"
session.findById("wnd[0]/usr/btn%_S_VSTEL_%_APP_%-VALU_PUSH").press
session.findById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL-SLOW_I[1,0]").text = "9121"
session.findById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL-SLOW_I[1,1]").text = "9123"
session.findById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL-SLOW_I[1,1]").setFocus
session.findById("wnd[1]/usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL-SLOW_I[1,1]").caretPosition = 4
session.findById("wnd[1]").sendVKey 8
session.findById("wnd[0]/usr/ctxtS_DPLBG-LOW").text = DatePart("d", Now)+1 & "." & DatePart("m", Now) & "." & DatePart("yyyy", Now)
session.findById("wnd[0]/usr/ctxtS_DPLBG-LOW").setFocus
session.findById("wnd[0]/usr/ctxtS_DPLBG-LOW").caretPosition = 10
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]/shellcont/shell").contextMenu
session.findById("wnd[0]/shellcont/shell").selectContextMenuItem "&XXL"
session.findById("wnd[1]/usr/radRB_OTHERS").setFocus
session.findById("wnd[1]/usr/radRB_OTHERS").select
session.findById("wnd[1]/usr/cmbG_LISTBOX").key = "04"
session.findById("wnd[1]/tbar[0]/btn[0]").press
Edited by: Leonardo Teleanu on Jan 25, 2012 8:16 PM
i found a solution, but is not so beautiful like the normal spreadsheet over the info.
I'v used Local File -> Spreadsheet & that helped me. and recored from start with Replace the file. Now i have the location & the replace for the excel file. All i must do is to set in excel macro something to eliminate some blank cells. for that i will talk with a excel expert.
if you know other methods, please share. when i will finish all the process i will share the full method & steps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.