Skip to Content
author's profile photo Former Member
Former Member

Excel to SAP R/3

Hi All,

I need to create automation for uploading Excel data onto SAP R/3 using VBA.Have never done this before.Hence a few questions.

1.Once SAP is installed what references do i need to put in the VB Editor under Tools->references in order to connect to SAP and use its objects?

2.Can i achieve uploading of data from Excel using ODCBC.

3.I searched the net for excel to SAP links and found a term called RFC functions.What is RFC.

4.Do we need ABAP coding as well to achieve the same?

If someone can help me with the code for uploading data from excel to SAP,it would be great.Any reply in this regard will be highly appreciated.


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2006 at 09:54 AM


    this <a href="/people/kathirvel.balakrishnan2/blog/2006/05/08/data-upload-into-sap-from-microsoft-excel-150-abap-part might help you get a start with RFC and excel.

    if you use MS Office 2003 and SAP WAS ABAP Rel >= 6.40 you can download and install the Webservice Developer Kit 2.1 for VBA from microsoft and communicate very easily between excel and sap using webservices on ABAP and consume them from any MS Office application.



    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member


      I'm also trying to use SAP seb services in Excel.

      I'm well able to generate my proxy function (with the toolkit from Microsoft) in VBA.

      My issue is with credentials, in excel i'm not able to fix my user and password when i am using the web service with an error message "No matching authorization schema enable on connector".

      In VB I'm perfectly able to fixe credentials as the toolskit is automatical integrate de properties for user in and password in the the proxy class. excel does not do that. Remarque, In excel you have to enter the user and password in the URL. that not the case in VB, the tollokit ask you for a login.

      Can someone help me about this issue?


  • author's profile photo Former Member
    Former Member
    Posted on Feb 08, 2007 at 03:03 PM

    You don´t need any reference. Please check this code (enjoy it!):

    Public Sub Btncambiardescripcionmaterial()

    Dim conn As New SAPConection

    Dim sesion As Object

    Set sesion = conn.sesion

    j = 1

    i = 1

    Do While Cells(i, j) <> ""

    Cells(i, j + 2) = modificardescripcionmaterial(sesion, Cells(i, j), Cells(i, j + 1))

    i = i + 1



    Set conn = Nothing

    MsgBox ("OK")

    End Sub

    Public Function modificardescripcionmaterial(sesion As Object, material As Variant, descripcionnueva As Variant)

    On Error GoTo ext


    sesion.findById("wnd[0]/tbar[0]/okcd").Text = "/nmm02"

    sesion.findById("wnd[0]").sendVKey 0

    sesion.findById("wnd[0]/usr/ctxtRMMG1-MATNR").Text = material

    sesion.findById("wnd[0]/usr/ctxtRMMG1-MATNR").caretPosition = 6

    sesion.findById("wnd[0]").sendVKey 0

    sesion.findById("wnd[0]/usr/tabsTABSPR1/tabpSP01/ssubTABFRA1:SAPLMGMM:2004/subSUB1:SAPLMGD1:1002/txtMAKT-MAKTX").Text = descripcionnueva

    sesion.findById("wnd[0]/usr/tabsTABSPR1/tabpSP01/ssubTABFRA1:SAPLMGMM:2004/subSUB1:SAPLMGD1:1002/txtMAKT-MAKTX").caretPosition = 25


    modificardescripcionmaterial = ""

    modificardescripcionmaterial = sesion.findById("wnd[0]/sbar").Text

    Exit Function


    modificardescripcionmaterial = ""

    modificardescripcionmaterial = sesion.findById("wnd[0]/sbar").Text

    End Function

    Class module SAPConection:

    Property Get sesion() As Object

    If Not IsObject(App) Then

    Set SapGuiAuto = GetObject("SAPGUI")

    Set App = SapGuiAuto.GetScriptingEngine

    End If

    If Not IsObject(Connection) Then

    Set Connection = App.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 App, "on"

    End If

    Set sesion = session

    Set SapGuiAuto = Nothing

    Set App = Nothing

    Set Connection = Nothing

    Set session = Nothing

    Set WScript = Nothing

    End Property

    Public Sub Borrarsesion()

    Set session = Nothing

    End Sub

    Excel file:

    Material_code | New_description | Here the result!


    Arturo Bernal

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.