• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Update Data from Excel to SAP using Macro

Aswinraj

Member
Hi Guys Please help,

I have an excel where in Column A it will have all Data (almost 500) - When User click Macro Button it needs to copy each cell and past in SAP Transaction.

I have a SAP Script but when i run this script its not fetching all Data from Excel. Kindly help..,

Code:
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 = "MMAM"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/ctxtRM03Z-MATNR").text = "JC69-01216X"
session.findById("wnd[0]/usr/cmbRM03Z-NMTAR").key = "HALB"
session.findById("wnd[0]/usr/cmbRM03Z-NMTAR").setFocus
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/tbar[1]/btn[8]").press
 
Back
Top