cancel
Showing results for 
Search instead for 
Did you mean: 

How to copy the value in SAP and paste in the empty field

854

Sub Exe_VL01N()
Dim Application, SapGuiAuto, Connection, session, WScript
Dim x As Integer
Dim qtd As String

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

For x = 0 To 1041
qtd = session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\02/ssubSUBSCREEN_BODY:SAPMV50A:1104/tblSAPMV50ATC_LIPS_PICK/ctxtLIPS-LGORT[3," & x & "]").Text
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\02/ssubSUBSCREEN_BODY:SAPMV50A:1104/tblSAPMV50ATC_LIPS_PICK/ctxtLIPS-LGORT[5," & x & "]").Text = qtd
session.findById("wnd[0]").sendVKey 0
Next x

Or maybe

For x = 0 To 1041
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\02/ssubSUBSCREEN_BODY:SAPMV50A:1104/tblSAPMV50ATC_LIPS_PICK/ctxtLIPS-LGORT[5," & x & "]").Text = session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\02/ssubSUBSCREEN_BODY:SAPMV50A:1104/tblSAPMV50ATC_LIPS_PICK/ctxtLIPS-LGORT[3," & x & "]").Text
session.findById("wnd[0]").sendVKey 0
Next x

End Sub


View Entire Topic
0 Kudos

At first you select the expect cell then..

Ctrl + Y for copy

Ctrl + V for paste