Deleting Orders on SAP is one of my Daily Tasks, I Have about 300 Orders to be Deleted everyday so each time i Go to the Transaction (VAO2) then Paste the order number from the excel then Choose options and Delete it, i wanted to script the whole process but each time to paste the new number i Copy from excel, so i created the below script but it goes with the same exact order "2268979048", I need to write the part of the code that let the script paste the number in the clipboard the time i run the Script (Note that i am not authorized to Use MASS deletion transaction)
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 = "va02"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/ctxtVBAK-VBELN").text = "2268979048"
session.findById("wnd[0]/usr/ctxtVBAK-VBELN").caretPosition = 10
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[1]/tbar[0]/btn[0]").press