cancel
Showing results for 
Search instead for 
Did you mean: 

Script Recording and Playback help

Former Member
0 Kudos

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?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

which tcode are you recording??

Former Member
0 Kudos

i don't understand you question, but i'm trying to record something in ERP (Enterprise Resource Planning)

script_man
Active Contributor
0 Kudos

Hi Leonardo,

how about if you present to us the last part of the script? TCODE means the code of a transaction.

Regards,

ScriptMan

Former Member
0 Kudos
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

Former Member
0 Kudos

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.

script_man
Active Contributor
0 Kudos

Hi Leonardo,

How then is the transaction that you start with the script?

To do this in the SAP menu to the right place. Press the right mouse button and there see you the name of the transaction.

Regards,

ScriptMan