'******************* clipboard ********************
DimWshShell,objArgs,Wert,cliptxt
SetWshShell=CreateObject("WScript.Shell")
SetobjArgs=WScript.Arguments
If(objArgs.Count=0)Then
LoadClipboard
WScript.quit
EndIf
Wert=objArgs(0)
'************** SAP Script Recorder ***************
IfNotIsObject(application)Then
SetSapGuiAuto=GetObject("SAPGUI")
Setapplication=SapGuiAuto.GetScriptingEngine
EndIf
IfNotIsObject(connection)Then
Setconnection=application.Children(0)
EndIf
IfNotIsObject(session)Then
Setsession=connection.Children(0)
EndIf
IfIsObject(WScript)Then
WScript.ConnectObjectsession,"on"
WScript.ConnectObjectapplication,"on"
EndIf
session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").text="vkp2"
session.findById("wnd[0]").sendVKey0
session.findById("wnd[0]/usr/ctxtS_MATNR-LOW").text=Wert' <--- Hier die Variabel Wert einsetzten (Artikelnummer)
session.findById("wnd[0]/usr/ctxtS_VKORG-LOW").setFocus
'******************* Sub clipboard ********************
SubLoadClipboard
'**** Text aus dem Clipboard holen ****
WshShell.Run"mshta.exevbscript:(CreateObject(""WScript.Shell"")."_
&"Run("""""""&WScript.ScriptFullName&""""""""""""&chr(38)&"document.parentwindow."_
&"clipboardData.GetData(""text"")"&chr(38)&"""""""""))(Window.close)"
EndSub