on 05-13-2011 8:40 AM
Hi all,
I'm new in SAP scripting and I don't know much about SAP script command. I have created this script to run a report and save the report file to a specific folder or drive. Can you help me find the right command to save the file to specific folder or drive? Can I save the report file to excel? Below is the script that I have created using SAP Script Recording and Playback
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]/shellcont/shell/shellcont[0]/shell").selectedNode = "000002"
session.findById("wnd[0]/mbar/menu[6]/menu[5]/menu[2]/menu[2]").select
session.findById("wnd[1]/usr/sub:SAPLSPO5:0101/radSPOPLI-SELFLAG[1,0]").select
session.findById("wnd[1]/usr/sub:SAPLSPO5:0101/radSPOPLI-SELFLAG[1,0]").setFocus
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[1]/usr/ctxtDY_FILENAME").text = "mdc.xls"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").caretPosition = 7
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[1]/tbar[0]/btn[12]").press
session.findById("wnd[0]/shellcont/shell/shellcont[0]/shell").selectedNode = "000003"
session.findById("wnd[0]/mbar/menu[6]/menu[5]/menu[2]/menu[2]").select
session.findById("wnd[1]/usr/sub:SAPLSPO5:0101/radSPOPLI-SELFLAG[1,0]").select
session.findById("wnd[1]/usr/sub:SAPLSPO5:0101/radSPOPLI-SELFLAG[1,0]").setFocus
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[1]/usr/ctxtDY_FILENAME").text = "dstr.xls"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").caretPosition = 8
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[1]/tbar[0]/btn[12]").press
session.findById("wnd[0]/tbar[0]/btn[15]").press
session.findById("wnd[1]/usr/btnBUTTON_YES").press
Thanks,
Louie
Hi Rana,
I am Vietnamese I am new too, but i know how to get your question.
You set the path before session.findById("wnd[1]/usr/ctxtDY_FILENAME").text = "mdc.xls" by this script:
session.findById("wnd[1]/usr/ctxtDY_PATH").text = "C:\Database\SAPDownloads\"
Kind regards,
TanAnh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is the forum for "SAPScript", among others, but your issue is not related to that. Looks like a topic for the Application Server - SAP GUI forum. Please have a look there and close this thread if you find a better home for your issue.
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.