Created
August 30, 2013 17:38
-
-
Save kubrick06010/6392392 to your computer and use it in GitHub Desktop.
sapscript under vbs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'On Error Resume Next | |
| 'If Not IsObject(Application) Then | |
| Set SapGuiAuto = GetObject("SAPgui") | |
| Set oApplication = SapGuiAuto.GetScriptingEngine | |
| 'End If | |
| If Not IsObject(Connection) Then | |
| Set Connection = oApplication.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 oApplication, "on" | |
| End If | |
| session.findById("wnd[0]").maximize | |
| session.findById("wnd[0]/tbar[0]/okcd").Text = "KO02" | |
| session.findById("wnd[0]").sendVKey 0 | |
| session.findById("wnd[0]/usr/ctxtCOAS-AUFNR").Text = ordenes | |
| session.findById("wnd[0]/usr/ctxtCOAS-AUFNR").caretPosition = 12 | |
| session.findById("wnd[0]/tbar[1]/btn[42]").press | |
| session.findById("wnd[0]/mbar/menu[1]/menu[0]").Select | |
| session.findById("wnd[1]/usr/sub:SAPLBSVA:0201/radJ_STMAINT-ANWS[1,0]").Select | |
| session.findById("wnd[1]/usr/sub:SAPLBSVA:0201/radJ_STMAINT-ANWS[1,0]").SetFocus | |
| session.findById("wnd[1]/tbar[0]/btn[0]").press | |
| session.findById("wnd[0]/mbar/menu[1]/menu[3]").Select | |
| 'session.findById("wnd[1]/tbar[0]/btn[0]").press ' En el caso que deba actualizarse el cebe | |
| ' Bloquear | |
| session.findById("wnd[0]/mbar/menu[1]/menu[6]/menu[0]").Select | |
| 'Salir | |
| session.findById("wnd[0]/tbar[0]/btn[11]").press | |
| session.findById("wnd[1]/tbar[0]/btn[0]").press | |
| session.findById("wnd[0]/tbar[0]/btn[3]").press | |
| 'On Error GoTo 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment