Update SAP BAPI already imported in XI Repository

Hello all.
I'm a XI beginner.
I use a specific R3 bapi in one of my namespaces. So this RFC is already imported in XI repository and the process is today implemented in my customer's production environnement.
Following a new need, I must add an importing field to this bapi.
So I do the following :
- in R3 (Developpment environnement), I added my new param to my bapi,
In XI, I want to update the rfc structure in order to be able to do the mapping update.
Must I import again the rfc ? (because I don't manage to change the structure manually)
What are the actions I must exactly do in both Integration Repository and directory ?
Thanks very much.

hi Sylvian,
yes you must reimport the bapi again
and it will be: Updated this time
but first do: where-used on the old bapi
to see all the mapping programs etc. with which this bapi
was used - so you can update it after the BAPI structure update
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

Similar Messages

  • How to retrieve the data from SAP-BAPI by using VB Code

    Hi ,
    I am new to BAPI.
    V have created an application in Visual Basic with the following fields
    EmpNo , EmpName, Addr1, Addr2, City and Phone (Only for Test)
    We have written the code for SAVING the data into SAP. Already we have
    constructed a table with the respective fields in SAP.
    For that we ourself created our own BAPI Structure / Function Group /
    Function Module/ Business Object - RELEASED related elements.
    1)Established the connection successfully.
    2)Stored the data into SAP Successfully and v r in need of
    3)HOW TO RETRIEVE THE DATA FROM SAP (USING GETLIST.....GETDETAIL....)
    Following is the code :
    'BAPI Structure  : ZBAPIEMP
    'Function Group  : ZBAPIEMP
    'Function Module : ZBAPI_EMP_CREATEFROMDATA
    'Business Object : ZBAPIEMP
    'Function Module : ZBAPI_EMP_GETLIST
    Dim bapictrl As Object
    Dim oconnection As Object
    Dim boEmp As Object
    Dim oZEmp_Header As Object
    Dim oImpStruct As Object
    Dim oExpStruct As Object
    Dim oreturn As Object
    Dim x As String
    Private Sub Form_Load()
    Set bapictrl = CreateObject("SAP.BAPI.1")
    Set oconnection = bapictrl.Connection
    oconnection.logon
    Set boEmp = bapictrl.GetSAPObject("ZBAPIEMP")
    Set oZEmp_Header = bapictrl.DimAs(boEmp, "CreateFromData", "EmployeeHeader")
    Set oImpStruct = bapictrl.DimAs(boEmp, "GetList", "EmployeeDispStruct")
    End Sub
    Private Sub cmdSave_Click()
        oZEmp_Header.Value("EMPNO") = txtEmpNo.Text
        oZEmp_Header.Value("EMPNAME") = txtEmpName.Text
        oZEmp_Header.Value("ADDR1") = txtAddr1.Text
        oZEmp_Header.Value("ADDR2") = txtAddr2.Text
        oZEmp_Header.Value("CITY") = txtCity.Text
        oZEmp_Header.Value("PHONE") = txtPhone.Text
        boEmp.CreateFromData EmployeeHeader:=oZEmp_Header, Return:=oreturn
        x = oreturn.Value("Message")
        If x = "" Then
            MsgBox "Transaction Completed!..."
        Else
            MsgBox x
        End If
    End Sub
    Private Sub cmdView_Click()
    End Sub
    COULD ANYBODY GUIDE ME, HOW TO RETRIEVE THE DATA FROM BAPI, FOR THE WRITTEN CODE.

    I didn't seen any other answers but here's how it's been done previously in our organization for a custom BAPI. In this example, we give material and language to return the part description. It's not specific to your project but may give you ideas..
    -Tim
    Option Compare Database
    Dim SAPLOGIN As Boolean
    Dim FunctionCtrl As Object
    Dim SapConnection As Object
    Sub SAPLOGOUT()
    On Error GoTo LogoutFehler
        SapConnection.logoff
        SAPLOGIN = False
    Exit Sub
    LogoutFehler:
        If Err.Number = 91 Then
            Exit Sub
        Else
            MsgBox Err.Description, vbCritical, "Fehler-Nr." & CStr(Err.Number) & " bei SAP-Logout"
        End If
    End Sub
    Function SAPLOG() As Boolean
    'Verbindungsobjekt setzen (Property von FunctionCtrl)
       Set FunctionCtrl = CreateObject("SAP.Functions")
       Set SapConnection = FunctionCtrl.Connection
    'Logon mit Initialwerten
       SapConnection.Client = "010"
       SapConnection.Language = "EN"
       SapConnection.System = "PR1"
       SapConnection.SystemNumber = "00"
       'SapConnection.Password = ""
       SapConnection.GroupName = "PR1"
       SapConnection.HostName = "168.9.25.120"
       SapConnection.MessageServer = "168.9.25.120"
         If SapConnection.Logon(0, False) <> True Then  'Logon mit Dialog
             Set SapConnection = Nothing
             DoCmd.Hourglass False
             MsgBox "No connection to SAP R/3 !"
             SAPLOGIN = False
             SAPLOG = False
             Exit Function
          End If
        SAPLOG = True
    End Function
    Function MatDescr(MatNr As String)
    Dim func1 As Object
    Dim row As Object, X As Integer, ErsteNr As String
    Dim DatensatzZähler As Long
    Dim RowField(1 To 50, 0 To 1) As String, RowLine As Long
        If Not SAPLOGIN Then
            If Not SAPLOG() Then
                MsgBox "No connection  to SAP !", 16
                SAPLOGOUT
                Exit Function
            End If
        End If
    ' Instanziieren des Function-Objektes
    Set func1 = FunctionCtrl.Add("Z_BAPI_READ_MAKT")
    ' Export-Paramter definieren
    func1.exports("MATNR") = MatNr
    func1.exports("SPRAS") = "EN"
    DoEvents
    If Not func1.call Then
        If func1.exception <> "" Then
            MsgBox "Communication Error with RFC " & func1.exception
        End If
        DoCmd.Hourglass False
        SAPLOGOUT
        Exit Function
    Else
      MatDescr = func1.imports("MAKTX")
    End If
    If MatDescr = "" Then
        MatDescr = "PART NO. NOT FOUND"
    End If
    End Function

  • How to get SAP to use SSL for Content repository?

    I have defined a content repository in OAC0.  I would like SAP and the end user to use SSL when talking to the repository.  I have obtained a certificate for the repository, so that I can manually trference the repository via https... but in OAC0 when I press the Test Connection button I get "Connection Error:No SSLsupport available".  Do I have to import the content repository certificate into STRUST or something?

    Hi Ken,
    please have a look at the SAP note [712330|https://service.sap.com/sap/support/notes/712330].
    Best regards,
    Klaus

  • No Connection btw JCAPS 5.1.2 and SAP ECC 6.0 whle creatining SAP/Bapi OTD

    Hello.
    We have the following problem trying to build SAP BAPI/RFC OTD.
    1) JCAPS 5.1.2. SAP ECC 6.0. Jco version 2.1.7 (also tried 2.1.8, 2.0.12 with the same result). All steps were done according to SAP BAPI/ALE eWays user guides and readmes
    2) SAP client already installed and worked ok on the same host as the JCAPS
    3) It looks like the problem is in JCo. It seems like doesn't react when we trying to connect to SAP during creation of BAPI/RFC OTDs at design time.
    Error message: partner not reached
    ERRNO 10060
    All ports are open and no restrictions imposed on JCAPS server. There are no connection log entries on SAP router host.
    4)We tried to run sample Project which goes with eway, and the following entries in logical host log file were found:
    [#|2007-06-12T11:35:13.171+0600|WARNING|IS5.1.2|STC.eWay.SAP.BAPI.com.stc.connector.sapbapiadapter.sapbapi.SAPConnector|_ThreadID=17; ThreadName=Worker: 5;|SAPConnector.isConnect(): JCO Client is null|#]
    [#|2007-06-12T11:35:13.296+0600|INFO|IS5.1.2|STC.eWay.framework.management.com.stc.connector.management.util.Alerter|_ThreadID=17; ThreadName=Worker: 5;|sendAlert(), connection info: ConnectionInfo [ collaboration: cmBAPIOutbound_jcdFlightGetList, project: prjBAPIOutbound, component: eaSAPBAPI, deployment: dpBAPIOutbound, environment: envTest, logicalhost: LogicalHost1, integration server: IntegrationSvr1 ], monitor: ObjectReference [ name: SeeBeyond:GUID={70010000-D247521E130100-AC14015A-01},Name=prjBAPIOutbounddpBAPIOutbound|prjBAPIOutbound|dpBAPIOutbound|cmBAPIOutbound_jcdFlightGetList_eaSAPBAPI ], alert message: No connection established to SAP R/3 for user $$$$$$ on host $$$$$.|#]
    [#|2007-06-12T11:35:13.312+0600|WARNING|IS5.1.2|STC.eWay.SAP.BAPI.com.stc.connector.sapbapiadapter.sapbapi.SAPConnector|_ThreadID=17; ThreadName=Worker: 5;|SAPConnector.isConnect(): JCO Client is not connected.|#]
    [#|2007-06-12T11:35:34.781+0600|INFO|IS5.1.2|STC.eWay.framework.management.com.stc.connector.management.util.Alerter|_ThreadID=17; ThreadName=Worker: 5;|sendAlert(), connection info: ConnectionInfo [ collaboration: cmBAPIOutbound_jcdFlightGetList, project: prjBAPIOutbound, component: eaSAPBAPI, deployment: dpBAPIOutbound, environment: envTest, logicalhost: LogicalHost1, integration server: IntegrationSvr1 ], monitor: ObjectReference [ name: SeeBeyond:GUID={70010000-D247521E130100-AC14015A-01},Name=prjBAPIOutbounddpBAPIOutbound|prjBAPIOutbound|dpBAPIOutbound|cmBAPIOutbound_jcdFlightGetList_eaSAPBAPI ], alert message: Connection to SAP R/3 failed for user $$$$$$ on host $$$$$$.|#]
    [#|2007-06-12T11:35:34.781+0600|SEVERE|IS5.1.2|STC.eWay.SAP.BAPI.com.stc.connector.sapbapiadapter.sapbapi.SAPConnector|_ThreadID=17; ThreadName=Worker: 5;|Unable to initialize SAP R/3 Client Connection|#]
    Any help is appreciated

    Hi Yermek.
    I guess you are placed and set all jars relates to bapi/rfc.
    You need to pass atleast one parameter from jcd which will initiates the BAPI connection.
    i.e atleast from jcd you need to send a request.
    Hope it will work...
    Thanks,
    M.P.Rao.

  • How do i see video clips already imported in to an event?

    How do i see video clips already imported in to an event?
    I have already created and shared one movie project from the clips and from photos but now want to make another. However, when i go to the library it only shows me the content of the first project, including the photos, not all of the video clips i originally imported. I can't believe that I need to import them all again.

    It seems to me that you must have imported your clips using iMovie 9, (that's why they are all in the Events folder which belongs to iMovie 9).  Then you must have upgraded your current project to iMovie 10 which will have put the clips used in that project (but not all the others) into your iMovie 10 library.  iMovie 10 has a totally different storage arrangement for media.  You should be able to update your other iMovie 9 projects by choosing File > Update Projects  and Events in iMovie 10.  See: http://help.apple.com/imovie/mac/10.0.8/#/mov902ad0c31
    This does not stop you from continuing to use the projects in iMovie 9 though any further editing you do will not be transferred to the other version of iMovie.
    Geoff.

  • Why is iPhoto 11 not recognizing already imported photos from 4S?

    I just plugged my 4S into my iMac i3, which is running OSX 10.8.2 and iPhoto 11' all products are up to date on software updates. I wanted to removed some videos off my 4S to free of some space on the phone.  I normall use icloud for all photo syncing and what not so plugging my 4S into the imac is not a common thing for me. 
    After opening iPhoto I noticed that the photos that were selected as "New Photos" were most duplicates of older photos that were already in my iPhoto library, some dating back a couple of years ago.  I keep copies of them on my iphone to show people when I'm away from my imac.  What I don't understand is why is iPhoto thinking these are "New Photos" and not "Already Imported" photos?  What is even stranger is that when I look in the "Already Imported" photos, those same photos (the ones that iPhoto wants to now import again) are showing up there too. 
    So my dilema is, that iPhoto is saying that out of 1,289 photos on my 4S, 354 are "New Photos" to be imported but about 250-300 of those are NOT new, they already exist in my iPhoto library. Why is iPhoto not reconizing already imported photos? 
    Also, if I am using Photo Stream to sync my photos across everything.. why do I even have any new photos to import??  Shouldn't everything already be there when I open up iPhoto, why would I need to import any photos from my 4S if icloud and Photo Stream work correctly with iPhoto 11' ?  I have checked and made sure numberous times that I have Photo Stream and icloud turned on in all the correct places and devices.  
    What I'm currently using:  iPhone 4S iOS 6.0.1 and iMac i3 OSX 10.8.2 and iPhoto 11' version 9.4.2

    You'll need to create a new, temporary library and import into that with the option to delete from your iPhone. Then delete the library and go back to your current library.
    OT

  • Importer does not recognize already imported photos

    Hello,
    I have a really annoying problem with Aperture 3.0.3. The importer does not recognize already imported photos and wants to import them again and again. This is true for photos from my iPhoneand also for photos from my Nikon. If I enable "Do not import duplicates" then some photos vanish from the importer, when I the iPhone view is open. In the Nikon view not even one photo is recognized as already imported.
    Also very strange is that when I have the iPhone (iOS 4.1 installed) attached to the Mac, Aperture opens the importer automatically and shows all photos correctly - but strangely, both iMac CPUs are at 100% until I click either "Cancel" or "Start import" or I disconnect the iPhone.
    I tried the following without success:
    - Correct permissions on media library
    - Repair media library
    - Rebuild media library
    Imports from my iPhone last very long and seem to hang most of the time. I have to kill Aperture to make it work again all the time.
    To me, it looks like there is something really messed up at the base of this program.
    I have about 20000 files in my library - face recognition is not turned off - most of the preferences are at their default, I think. Did not play around very much.
    Does anybody know what to do? I don't want to lose all my Projects (sorted all pictures into their own projects). But I want to work with Aperture again. When its working, it's a great tool.
    Regards
    Alex

    I've had the same problem. For some things, like videos and photos on my iPhone, I've found as many as 5 copies of the images despite keeping the 'do not import duplicates' checked.
    I've also found a bug with the import function, where if I'm importing from folders on my hard drive, sometimes it finds no images at all (even if they don't exist in my library). Simply cancelling and going back into import and the miraculously appear (including images that have already been imported despite having 'do not import duplicates' checked.).
    I've been going through my library deleting all the duplicates, and managed to free about 10GB of space.
    Having moved from Lightroom the 'technical side' of Aperture seems very antiquated. For example, if I remove a duplicate video - then try clicking on that video in Aperture, it literally takes about 10-15 minutes of spinning disc before Aperture becomes responsive. It also often hangs up on the 'updating previews' when I quit.
    Such a shame aperture is so bad. I really like the functionality - eg. having my photos automatically sync with my Apple TV, but it seems to be absolutely full of bugs.

  • I want to update SAP standard tables

    Hi,
    I want to update SAP tables using BAPI. can you please suggest me how can i do this and which BAPI i should use for that purpose. I want to update KNVV , FKKMAKO , FKKVKP table.

    Hello Sourabh
    I am not sure if there is a BAPI around for updating KNVV customer data. The appropriate function module would be SD_CUSTOMER_MAINTAIN_ALL.
    Regards,
      Uwe

  • Importing BAPI with Import parameter Type Structure

    Hi All,
    I am importing BAPI as shown below:
    FUNCTION ZTEST_BAPIOC.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(A1) TYPE  ZLEVEL1 OPTIONAL
    *"  EXPORTING
    *"     VALUE(M1) TYPE  CHAR10
    Where ZLEVEL1 is Structure which contains many appended structures.
    ZLEVEL1  (SAP SE11 Structure)
    -ZLEVEL2A
    -ZLEVEL2B
    ZLEVEL2A   (SAP SE11 Structure)
    -ZLEVEL3A
    ZLEVEL2B   (SAP SE11 Structure)
    -FIELD1
    -FIELD2
    ZLEVEL3A   (SAP SE11 Structure)
    -FIELD3
    -FIELD4
    But after importing BAPI in XI I can see only A1 as follows :
    Structure--Category---Type
    ZTEST_BAPIOC------Element   
    A1--Element----ZLEVEL1
    For mapping to target I need whole structure on BAPI & ZLEVEL1.
    <b>Please help how to Import Or Design Strucure of BAPI with Import parameters Type as Structures?</b>
    Thanks & Regards

    Hi,
    Thanks for Reply.
    Actually User ID  I used for importing BAPI having some missing authorization.
    After getting Authorization I can see full structure of BAPI in XI.
    Thanks & Regards

  • IPhoto 9.2: already imported video not recognized

    Hello,
    I've recently updated to iPhoto 9.2, with the previous versions I usually import photos and videos from my iPhone.
    I usually connected it with the cable and importing photos and videos when prompted by iPhoto.
    Previous versions of iPhoto correctly recognized already imported photos and videos and had them hidden.
    After the upgrade to 9.2 it only recognizes imported photos but shows all the video in the iPhone as to be imported.
    I thought about reimporting all the videos in a new event but I have a LOT of videos and I woudl prefer not to waste time and space doing so.
    Did anyone experienced this? any hints on how to let iphoto recognize these videos?

    Unfortunately not:(
    But I have some news:
    I tried to re-import ALL the videos into a new event. Then the video disappeared from the import screen.
    But then I had duplicate videos: i tried deleting the newly imported videos and they showed up again in the import screen.
    It seems like iPhoto cannot flag the videos as "already imported" if it doesn't find the videos in the library. But the very same videos ARE in the library: I can even search for them in the integrated search engine and they do show up.
    jhgruber2 any success in sorting out this mess?

  • SAP BAPI ActiveX Interface

    Hello,
    This is a cross post from LAVA forum...
    I'm trying to integrate our test stations to SAP ERP. SAP stores data in busines objects in busines object repository. The objects are exposed over BAPI interface. There is a lot of different busines objects in the repository. SAP developers can also build new objects if they want. The objective is to read inspection characeristics from quality management module of SAP. I haven't done much ActiveX stuff, neither know much about SAP, so I started with a simple example that I found searching for BAPI examples. The example works fine in Excel. The example just reads some data from a sales order object.
    Sub BAPI1()Dim
    oBook As Workbook
    Dim oSheet As Worksheet
    Dim oBAPICtrl As Object
    Dim oBAPILogon As Object
    Dim oSalesOrder As Object
    Dim oItem As Object
    Dim iIndex As Integer
    Set oBook = Application.ActiveWorkbook
    Set oSheet = oBook.Worksheets(1)
    ' Initialize SAP ActiveX Control.
    Set oBAPICtrl = CreateObject("sap.bapi.1")
    ' Initialize SAP ActiveX Logon.
    Set oBAPILogon = CreateObject("sap.logoncontrol.1")
    ' Initialize the connection object.
    Set oBAPICtrl.Connection = oBAPILogon.newconnection
    ' Logon with prompt.
    oBAPICtrl.Connection.System = "Q02"
    oBAPICtrl.Connection.Client = 101
    oBAPICtrl.Connection.Logon
    ' Retrieve a sales order.
    Set oSalesOrder = oBAPICtrl.GetSAPObject("SalesOrder","0010732181")
    ' Display Sales Order header data.
    oSheet.Cells(2, 1).Value = oSalesOrder.salesdocument
    oSheet.Cells(2, 2).Value = oSalesOrder.netvalue
    oSheet.Cells(2, 3).Value = oSalesOrder.orderingparty.customerno
    oSheet.Cells(2, 4).Value = oSalesOrder.documentdate
    oSheet.Cells(2, 5).Value = oSalesOrder.items.Count
    ' Logoff SAP and close the control.
    oBAPICtrl.Connection.logoff
    Set oBAPILogon = Nothing
    Set oBAPICtrl = Nothing
    End Sub
     I tried to implement that in LabVIEW. The logon and logout part works, I can also obtain SalesOrder object with GetSAPObject method. There is no error and probing the Object output from GetSAPObject methods gives an integer value - probably a reference to the SalesOrder object.
    Now I can't figure out how do I read the object properties. It's very simple in VBA. I also don't know how do I call object methods. This is apicture from SAP BAPI documentatios showing available properties and methods.
    I would appreciate any hints...
    bye, Mirko

    No, there isn't any reference type that matches BAPI Object. In fact, there can't be a fixed type reference, since BAPI object are actually function modules that SAP programmers write themselves using language called ABAP. I concluded that we can't call the object methods or read/write properties in LabVIEW, if we don't know the right type at development time. So, I gave up on BAPI API.
    There are also other methods of SAP integration. O step down on abstraction scale is Remote Function Call (RFC) API. The API is much more involved, but it allows us to call functions that are behind BAPI objects. In a few test that I did it worked fine. The interface is exposed over three ActiveX controls - SAP Remote Function Call Control, SAP Table Factory Control and SAP Logon Control.
    There is also .NET assembly and web services which I didn't tried.
    Regards, Mirko

  • UPDATE SAP USER EMAIL

    Hi,
    I'm trying to update sap user email by using BAPI_USER_CHANGE BAPI. This is the code:
          CLEAR it_return.
          v_address-e_mail = ls_salida-smtp_addr.
          v_addressx-e_mail = 'X'.
          CALL FUNCTION 'BAPI_USER_CHANGE'
            EXPORTING
              username = lv_bname
              address  = v_address
              addressx = v_addressx
            TABLES
              return   = it_return.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    When the execution finish everything seems OK but when I check in SAP user master data, email address is not updated.
    Can you tell me how can i do to make it works? or there is another way to update sap user email address?
    Thanks
    Andres

    example
      DATA: lv_addcomx    TYPE bapiadcomx,
            lt_bapiadsmtp TYPE TABLE OF bapiadsmtp,
            ls_bapiadsmtp LIKE LINE OF lt_bapiadsmtp,
        MOVE: 'X'               TO lv_addcomx-adsmtp,        "Update Flag
              ls_list-smtp_addr TO ls_bapiadsmtp-e_mail,
              ls_list-smtp_addr TO ls_bapiadsmtp-email_srch,
              001               TO ls_bapiadsmtp-consnumber.
        APPEND ls_bapiadsmtp TO lt_bapiadsmtp.
        CALL FUNCTION 'BAPI_USER_CHANGE'
          EXPORTING
            username = lv_name
            addcomx  = lv_addcomx
          TABLES
            return   = lt_return
            addsmtp  = lt_bapiadsmtp.
    You can change.. and check the su01

  • Updating SAP  Table using JCO

    Dear All
                      How to update SAP Table (Any single or multiple tables) through Java code using JCO. Can any body provide sample code regarding this...
    Thanks&Regards
    mgreddy

    Hi,
    I think for that anyway you will have to use JCO as the middleware to connect to SAP R/3.
    So what you can to do is to write three RFCs and call them through JCO from your JAVA application.
    1. First BAPI for reading the dictionary information about an SAP table.
    2. Second to read data from the table.
    3. And, third to write data to that table.
    But if you want to edit any table (and not a specific table) then your program will become even more complex since then you will have to pass the table name and information dynamically to the BAPIs.
    Best regards,
    Guru.

  • Updating SAP table field directly?

    Hi all,
    The client is using SAP for 2-3 years and this will be replaced by new SAP system ( same version - 4.6c) in few months.
    So as to get data from old system we are doiong conversion right now. In this client, PO creator name is very important and it drives so many things. When we will do conversion and convert old PO into the PO in the new system, the username ( created by) will be "batch user".
    Client somehow want to retain the username, the original username of old POs.
    For this, they are asking to update the EKKO-ERNAM field directly once the new POs are created ( we will have old PO - new PO mapping and user name).
    In my view, it is not advisable to update the SAP standard table directly. But i want the opinion from you guys that what are the implications of updating field directly. Is it advisable? Is there any other way to meet this requirement?
    Thanks,
    Pratik

    Hi palaniappan,
    1. Good question and good concern !
    2. Your concern is absolytely correct.
    3. Sap does not advise to
       update SAP standard tables directly
       thru any z program
      (It may stop support in future)
    4. But for your requirement,
       it the po user will be "batch user",
       then
       thru some Z program,
       u may do so.
    5. BUT
       Please take care that
       a) u have signed specifications of this logic
          and concern from the FUNCTIONAL CONSULTANT !
         (only after that one should do)
    regards,
    amit m.

  • BAPI-VB, Unable to call method GetDetail of USER Object using SAP.BAPI.1

    Hi,
    I am trying to call SAP Methods using Excel VBA.
    In the below example, I am trying to get the user details.
    I can solve this, if I use SAP.Functions object, but not when I use SAP.BAPI.1 object.
    The Procedure GetUserDetails() works fine, but the 2nd one GetUserDetails2() fails?
    Can you tell what is the difference in calling SAP method with SAP.Functions and SAP.BAPI.1 ?
    Also how can I run the program GetDetails2() using SAP.BAPI.1
    Const CNT_STR_USR As String = "XXXXX"
    Const CNT_STR_PWD As String = "XXXXX"
    Const CNT_STR_APPLN_SRVR As String = "ides47"
    Const CNT_STR_SYSTEM As String = "IDS"
    Const CNT_STR_SYS_NUM As String = "00"
    Const CNT_STR_CLIENT As String = "800"
    Const CNT_STR_LOGON_LANG As String = "EN"
    Const CNT_STR_LOG_FILE As String = "C:sap_vb.txt"
    Const CNT_INT_LOG_LEVEL As Integer = 9
    'Works Fine
    Public Sub GetUserDetails()
    'Using SAP Functions
    Dim obSAPFn As Object
    Dim obFuncUsrDtl As Object
    Dim obFuncRtrn As Object
    Dim obFuncLogDtl As Object
    Dim sRetStatus As String * 1, sErrText As String, sUsrGroup As String * 12
    Dim iRetRowCount As Integer, iLoop As Integer
    Dim bErrFlag As Boolean
    'Set obSAPFn = New SAPFunctions
    Set obSAPFn = CreateObject("SAP.Functions")
    obSAPFn.Connection.ApplicationServer = CNT_STR_APPLN_SRVR
    obSAPFn.Connection.SystemNumber = CNT_STR_SYS_NUM
    obSAPFn.Connection.User = CNT_STR_USR
    obSAPFn.Connection.Password = CNT_STR_PWD
    obSAPFn.Connection.Language = CNT_STR_LOGON_LANG
    obSAPFn.Connection.Client = CNT_STR_CLIENT
    obSAPFn.LogLevel = CNT_INT_LOG_LEVEL
    obSAPFn.LogFileName = CNT_STR_LOG_FILE
    'Check For Connection
    If obSAPFn.Connection.Logon(0, True) = False Then
        MsgBox "R/3 connection failed"
    Exit Sub
    Else
        If obSAPFn.Connection.IsConnected Then
    '    MsgBox "Connected"
        Else
        MsgBox "Not COnnected"
        Exit Sub
        End If
    End If
    'Get User Details.
    Set obFuncUsrDtl = obSAPFn.Add("BAPI_USER_GET_DETAIL")
    obFuncUsrDtl.Exports("USERNAME") = CNT_STR_USR
    obFuncUsrDtl.Call
    Set obFuncRtrn = obFuncUsrDtl.Tables("RETURN")
    iRetRowCount = obFuncRtrn.RowCount
    bErrFlag = False
    For iLoop = 1 To iRetRowCount
        If obFuncRtrn(iLoop, "TYPE") = "E" Then
    '        ErrorUsuario = True
            sErrText = "E" & obFuncRtrn(iLoop, "ID") & obFuncRtrn(iLoop, "NUMBER") & _
                         " " & obFuncRtrn(iLoop, "MESSAGE")
            MsgBox sErrText
            bErrFlag = True
            Exit For
        End If
    Next
    If bErrFlag = False Then
    Set obFuncLogDtl = obFuncUsrDtl.Imports("LOGONDATA")
    sUsrGroup = obFuncLogDtl("CLASS")
    MsgBox sUsrGroup
    End If
    Set obFuncRtrn = Nothing
    Set obFuncLogDtl = Nothing
    Set obFuncUsrDtl = Nothing
    obSAPFn.Connection.LogOff
    Set obSAPFn = Nothing
    End Sub
    ' Does not work
    Public Sub GetUserDetails2()
    'Using BAPI Object
    Dim obSapBAPICtrl As Object 'BAPI control object
    'Dim obSAPConn As Object 'Connection object
    Dim obSAPUSER As Object ' To Get Details of USER Object
    Dim obLogondata As Object, obDefaults As Object, obAddress As Object, obCompany As Object
    Dim obSnc As Object, obParameter As Object, obProfiles As Object, obActivitygroups As Object
    Dim obReturn As Object, obAddComrem As Object, obAddRml As Object, obAddPag As Object
    Dim obAddUri As Object, obAddSsf As Object, obAddPrt As Object, obAddRfc As Object
    Dim obAddX400 As Object, obAddSmtp As Object, obAddTlx As Object, obAddTtx As Object
    Dim obAddTel As Object, obAddFax As Object, obParameter1 As Object
    Dim sRetStatus As String * 1, sTransId As String, sUsrGroup As String
    Dim iRetRowCount As Integer, iLoop As Integer
    Set obSapBAPICtrl = CreateObject("SAP.BAPI.1")
    obSapBAPICtrl.Connection.ApplicationServer = CNT_STR_APPLN_SRVR
    obSapBAPICtrl.Connection.SystemNumber = CNT_STR_SYS_NUM
    obSapBAPICtrl.Connection.User = CNT_STR_USR
    obSapBAPICtrl.Connection.Password = CNT_STR_PWD
    obSapBAPICtrl.Connection.Language = CNT_STR_LOGON_LANG
    obSapBAPICtrl.Connection.Client = CNT_STR_CLIENT
    obSapBAPICtrl.LogLevel = CNT_INT_LOG_LEVEL
    obSapBAPICtrl.LogFileName = CNT_STR_LOG_FILE
    'Don't show the logon details
    'Connect to SAP
    If obSapBAPICtrl.Connection.Logon(0, True) = False Then
        MsgBox "R/3 connection failed"
        Exit Sub
    Else
        If obSapBAPICtrl.Connection.IsConnected Then
    '    MsgBox "Connected"
        Else
        MsgBox "Not COnnected"
        Exit Sub
        End If
    End If
    ‘Could not find a way to pass the User Id?
    ‘ Is this the right way to pass the user Id for this Object?
    Set obSAPUSER = obSapBAPICtrl.GetSAPObject("USER", CNT_STR_USR)
    Set obLogondata = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Logondata")
    Set obDefaults = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Defaults")
    Set obAddress = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Address")
    Set obCompany = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Company")
    Set obSnc = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Snc")
    Set obParameter = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Parameter")
    Set obProfiles = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Profiles")
    Set obActivitygroups = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Activitygroups")
    Set obReturn = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Return")
    Set obAddComrem = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddComrem")
    Set obAddRml = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddRml")
    Set obAddPag = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddPag")
    Set obAddUri = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddUri")
    Set obAddSsf = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddSsf")
    Set obAddPrt = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddPrt")
    Set obAddRfc = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddRfc")
    Set obAddX400 = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddX400")
    Set obAddSmtp = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddSmtp")
    Set obAddTlx = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddTlx")
    Set obAddTtx = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddTtx")
    Set obAddTel = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddTel")
    Set obAddFax = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "AddFax")
    Set obParameter1 = obSapBAPICtrl.DimAs(obSAPUSER, "GetDetail", "Parameter1")
    sTransId = obSapBAPICtrl.CreateTransactionID()
    'obSapBAPICtrl.TransactionId = sTransId
    obSAPUSER.GetDetail Logondata:=obLogondata, Defaults:=obDefaults, Address:=obAddress, _
    Company:=obCompany, Snc:=obSnc, Parameter:=obParameter, Profiles:=obProfiles, _
    Activitygroups:=obActivitygroups, Return:=obReturn, AddComrem:=obAddComrem, _
    AddRml:=obAddRml, AddPag:=obAddPag, AddUri:=obAddUri, AddSsf:=obAddSsf, _
    AddPrt:=obAddPrt, AddRfc:=obAddRfc, AddX400:=obAddX400, AddSmtp:=obAddSmtp, _
    AddTlx:=obAddTlx, AddTtx:=obAddTtx, AddTel:=obAddTel, AddFax:=obAddFax, _
    Parameter1:=obParameter
    iRetRowCount = obReturn.RowCount
    If iRetRowCount > 0 Then
        For iLoop = 0 To iRetRowCount
            sRetStatus = obReturn(iLoop, "TYPE")
            If sRetStatus = "S" Then
            sUsrGroup = obLogondata("CLASS")
            MsgBox sUsrGroup
            End If
        Next
    End If
    Set obSAPUSER = Nothing
    obSapBAPICtrl.Connection.LogOff
    'Set obSAPConn = Nothing
    Set obSapBAPICtrl = Nothing
    End Sub
    Regards,
    Vikas

    The problem was occuring because, the structure Return was not holding any values.
    But the other tables which returned values were getting populated.
    Regards,
    Vikas

Maybe you are looking for