Big Game
Big Game

Reputation: 1

Sap gui and scripting

I need help regarding the SAP GUI scripting play back as every time I play the recording it pastes the same values. I want it to copy new value as in order of VL02N and paste it. My code is below:

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.findByIdC"wnd[0]").maximize 
session.findById("wnd[0]/tbar[0]/okcd").text = "vl02n" 
session.findById("wnd[0]").sendvKey 0 

session.findById("wnd[0]").sendvkey 0 

session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\02/ssubSUBSCREEN_BODY:SAPMV50A:1104/tb1SAPMV50ATC_LIPS_PICK/txtLIPSD-PIKMG[6.0]") = text

session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\02/ssubSUBSCREEN_BODY:SAPMV50A:1104/tblSAPMV50ATC_LIPS_PICK/txtLIPSD-PIKMG[6,0]").setFocus
 
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\02/ssubSUBSCREEN_BODY:SAPMV50A:1104/tblSAPMV50ATC_LIPS_PICK/txtLIPSD-PIKMG[6,0]").caretPosition=1

Upvotes: -3

Views: 31

Answers (0)

Related Questions