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

Accessing BAPI structures in Excel

I am currently developing an Excel tool that calls BAPI_USER_GET_DETAIL to determine the user's firstname and lastname from the Export structure ADDRESS (BAPIADDR3). I am having trouble in how I should declare a variable to contain the contents of this structure and how to access the FIRSTNAME and LASTNAME fields of the structure. It seems that when I try to access ADDRESS as a string it returns a value of "Error 0". Any help here would help.

Thanks,

John

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jan 10, 2007 at 08:30 PM

    Hi,

    I assume tha you are using Visual Basic...

    You can find small example below. Generally structures similar to tables are managed as objects so you should define it as Object... In example I used PartnerList variable to get fields values of returned table.

    Dim MyFunc, PartnerList, Row As Object

    Dim Result As Boolean

    Set MyFunc = Funct.Add("BAPI_FUNCTION_NAME")

    Set PartnerList = MyFunc.Tables("PARTNER_LIST")

    Result = MyFunc.Call

    If Result = True Then

    Set PartnerList = MyFunc.Tables("PARTNER_LIST")

    For Each Row In PartnerList.Rows

    Text = Row("PARTNER_NO") + " " + Row("BPTYPE") + " " + Row("NAME1")

    MsgBox Text

    Next Row

    Else

    MsgBox MyFunc.Exception

    Funct.Connection.Logoff

    End If

    regards

    Krzys

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 09:25 PM

    I figured it out....seems I was doing it right all along, just didn't have the right VB to print the fields that I wanted form ADDRESS.

    Thanks for the reply, it helped me see my VB mistake.

    Regards,

    John

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 10:30 AM

    Hello John,

    I am currently developing a Leave Application in VB that calls BAPI_USER_GET_DETAIL. I am facing same problem as u faced it earlier, to determine the user's FullName from the Export structure ADDRESS (BAPIADDR3). I am having trouble in how I should declare a variable to contain the contents of this structure and how to access the FullName fields of the structure. I hope that u overcame this problem.if so please give some details code

    Thanks in advance,

    Minaxi Shah

    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.