Skip to Content
Former Member
Sep 28, 2009 at 12:27 PM

Script recording doesn't record save of file


Hi All,

I'm new with script recording. I made a recording of the generation of an HTML file of an SQ02 info set.

I want to save the HTML file automatically. At the moment the last step is the opening of the "Save As" screen in the sripting. A dynamically name must be given and the file must be saved. Because the recording doesn't record the actual saving of the file I'm stuck. I hope some one can help me with the scripting code, or has an example code. Thanks in advance. The code is listed below:

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]/tbar[0]/okcd").text = "/nse38"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/ctxtRS38M-PROGRAMM").text = "RSAQSHSG"
session.findById("wnd[0]/usr/ctxtRS38M-PROGRAMM").caretPosition = 8
session.findById("wnd[0]").sendVKey 8
session.findById("wnd[0]/usr/txtPA_SG").text = "ZTARIFFS"
session.findById("wnd[0]/usr/txtPA_MODE").text = "G"
session.findById("wnd[0]/usr/txtPA_MODE").caretPosition = 1
session.findById("wnd[0]").sendVKey 8