Skip to Content
0
Former Member
Sep 04, 2013 at 07:11 PM

Script to view change in orders

94 Views

Hi Experts,

I'm new here and I need your help.
I've created an script to save a file with changes in order.
The script works fine, but i need to know, if it´s possible get this information from a list of orders (Excel or access)?
I also need to know if it´s possible to save on the same file the informations from diferent orders.

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]/tbar[0]/okcd").text = "va03"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/ctxtVBAK-VBELN").text = "1009023776"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/mbar/menu[4]/menu[3]").select
session.findById("wnd[0]/usr/radSDATE").select
session.findById("wnd[0]/usr/radSDATE").setFocus
Scsession.findById("wnd[0]/tbar[1]/btn[8]").press
session.findById("wnd[0]/mbar/menu[3]/menu[5]/menu[2]/menu[2]").select
session.findById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[1,0]").select
session.findById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[1,0]").setFocus
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[1]/usr/ctxtDY_FILENAME").text = "testemodificacao.xls"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").caretPosition = 20
session.findById("wnd[1]/tbar[0]/btn[11]").press
session.findById("wnd[0]/tbar[0]/btn[15]").press
session.findById("wnd[0]/tbar[0]/btn[15]").press
session.findById("wnd[0]/tbar[0]/btn[15]").press

Tks.