Calling custom BAPI from VB/VBA

Hello, all,
I have written a custom business object and its associated function module.  I can single-test the business object inside native SAP, and it works successfully.  I can also establish a handle to the business object from VBA (using the .GetSAPObject method of the BAPI control object.)  I can't call the method of the custom BAPI, though--I get error message "UploadResults is not a BAPI method."  (UploadResults is the name of both my business object and the method of the business object.)  Here's my source code:
Sub UploadChemToSAP()
Dim gConnection As Object 'global connection object
Dim oBAPICtrl As New SAPBAPIControl
Dim oBAPIService As Object
Dim boFunction As Object, boResults As Object, boReturn As Object
'Set up connection object for SAP.  Note that the SAP BAPI ActiveX object must be available on the form or otherwise.
Set gConnection = oBAPICtrl.Connection
'Log in to SAP.  Seems like passwords must be in uppercase.  There are examples of people defaulting some (or all)
'of the login values
gConnection.logon
Set boFunction = Nothing
Set boResults = Nothing
Set boReturn = Nothing
Set oBAPIService = oBAPICtrl.GetSAPObject("UploadResults")
Set boReturn = oBAPICtrl.DimAs(oBAPIService, "UploadResults", "Return")
'Log out of SAP.
gConnection.logoff
End Sub
To my knowledge, I have released both the business object and its associated method.  The function module has been released, too.  Any suggestions on where to go from here? 
Thanks in advance,
Eric

Hey,
Please check the "Processing Type" of the function module implementing the method. It should be a Remote-Enabled module.
Kiran

Similar Messages

  • How to call a BAPI from Visual Composer

    hi,
       I am new to Visual composer. can some body give me step by step information of calling a bapi or RFC from VC.
    Thanks in advance,
    Gopi

    Hi Gopi,
    Steps involed for calling RFC/BAPI from VC
    1. Choose Model->Select Data Services.
    (Alternatively, click the Data button in the task panel toolbar.)
    2. In the Portal field at the right end of the main toolbar, enter the URL of the portal from
    which you can access the back-end system used by the iView.
    For example, you could enter: http://<yourportal>:50000/..
    3. Click the traffic light icon to the right of the Portal field. The portal Welcome screen
    appears.
    4. Log on to the portal as a user that exists in the connected back-end system, or which is
    mapped to a user of that system. Click OK.
    Once a connection to the portal is established, a list of system aliases defined in the
    portal system landscape appears in the System drop-down
    list.
    From the System drop-down list, choose the SAP system that contains the function module.
    6. Under Search SAP System, click the Search tab and in the Name field, enter the search string: <RFC/BAPI name>. Then click Search (at the bottom).
    5. A list of function modules matching the search string is displayed.
    7. Drag the function module/bapi from the Data task panel into the
    workspace: The data service is added to your model.
    8. Periodically save your work. To do so, choose File->Save Model.
    Finally test the iview in VC.
    In the workspace, drag your mouse from the Input port of the data service, <inputform> and dragn your mouse from the outut port from the data service <tabelview and etc..>
    or
    Go through the this documentation...
    http://help.sap.com/download/netweaver/nw04/visualcomposer/VC_60_UserGuide_v1_1.pdf
    Thanks,
    Suriya.

  • I am trying to generate purchase order and i create a BAPI also which is active. But when i call the BAPI from SYbase Mobile Object RFC then after calling it gives an Error "Conflict when calling a Function Module (Field Length)".

    i am trying to generate purchase order and i create a BAPI also which is active.
    But when i call the BAPI from SYbase Mobile Object RFC then after calling it gives an Error "Conflict when calling a Function Module (Field Length)".

    Hi,
    Yeah i tried my Z_BAPI in R3 and then giving some ERROR.
    This is my CODE-
    FUNCTION ZBAPIPOTV2.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(POHD) TYPE  ZPOHD OPTIONAL
    *"     VALUE(POITEM) TYPE  ZPOITEM OPTIONAL
    *"  TABLES
    *"      RETURN STRUCTURE  BAPIRET1 OPTIONAL
    data: ls_pohd type bapimepoheader,
             ls_pohdx TYPE bapimepoheaderx,
             lt_poit TYPE TABLE OF bapimepoitem,
             lt_poitx TYPE TABLE OF bapimepoitemx,
             ls_poit TYPE bapimepoitem,
             ls_poitx TYPE bapimepoitemx.
       MOVE-CORRESPONDING pohd to ls_pohd.
       MOVE-CORRESPONDING poitem to ls_poit.
       ls_pohdx-comp_code = 'x'.
       ls_pohdx-doc_type = 'x'.
       ls_pohdx-vendor = 'x'.
       ls_pohdx-purch_org = 'x'.
       ls_pohdx-pur_group = 'x'.
       ls_poit-po_item = '00010'.
       APPEND ls_poit to lt_poit.
       ls_poitx-po_item = '00010'.
       ls_poitx-po_itemx = 'x'.
       ls_poitx-material = 'x'.
       ls_poitx-plant = 'x'.
       ls_poitx-quantity = 'x'.
       APPEND ls_poitx to lt_poitx.
    CALL FUNCTION 'BAPI_PO_CREATE1'
       EXPORTING
         POHEADER                     = ls_pohd
        POHEADERX                    =  ls_pohdx
    *   POADDRVENDOR                 =
    *   TESTRUN                      =
    *   MEMORY_UNCOMPLETE            =
    *   MEMORY_COMPLETE              =
    *   POEXPIMPHEADER               =
    *   POEXPIMPHEADERX              =
    *   VERSIONS                     =
    *   NO_MESSAGING                 =
    *   NO_MESSAGE_REQ               =
    *   NO_AUTHORITY                 =
    *   NO_PRICE_FROM_PO             =
    *   PARK_COMPLETE                =
    *   PARK_UNCOMPLETE              =
    * IMPORTING
    *   EXPPURCHASEORDER             =
    *   EXPHEADER                    =
    *   EXPPOEXPIMPHEADER            =
      TABLES
        RETURN                       = return
        POITEM                       = lt_poit
        POITEMX                      = lt_poitx
    *   POADDRDELIVERY               =
    *   POSCHEDULE                   =
    *   POSCHEDULEX                  =
    *   POACCOUNT                    =
    *   POACCOUNTPROFITSEGMENT       =
    *   POACCOUNTX                   =
    *   POCONDHEADER                 =
    *   POCONDHEADERX                =
    *   POCOND                       =
    *   POCONDX                      =
    *   POLIMITS                     =
    *   POCONTRACTLIMITS             =
    *   POSERVICES                   =
    *   POSRVACCESSVALUES            =
    *   POSERVICESTEXT               =
    *   EXTENSIONIN                  =
    *   EXTENSIONOUT                 =
    *   POEXPIMPITEM                 =
    *   POEXPIMPITEMX                =
    *   POTEXTHEADER                 =
    *   POTEXTITEM                   =
    *   ALLVERSIONS                  =
    *   POPARTNER                    =
    *   POCOMPONENTS                 =
    *   POCOMPONENTSX                =
    *   POSHIPPING                   =
    *   POSHIPPINGX                  =
    *   POSHIPPINGEXP                =
    *   SERIALNUMBER                 =
    *   SERIALNUMBERX                =
    *   INVPLANHEADER                =
    *   INVPLANHEADERX               =
    *   INVPLANITEM                  =
    *   INVPLANITEMX                 =
    ENDFUNCTION.
    i am trying to generate purchase order and i create a BAPI also which is active. But when i call the BAPI from SYbase Mobile Object RFC then after calling it gives an Error "Conflict when calling a Function Module (Field Length)". 

  • Call the BAPI from the program..

    Hey guys,
    can we  call the BAPI from the program..
    if yes how can  we  can show sales orders being loaded..
    thanks its urgent

    Nishant,
    yes easily you can call bapi from program.
    for getting all sales order use:
    BAPI_SALESORDER_GETLIST
    also am providing a program so that you can see how bapi has to call in program.
    CALL FUNCTION 'BAPI_SALESORDER_GETLIST'
                 EXPORTING
                      customer_number    = lf_customernumber
                      sales_organization = if_sales_organization
                      document_date      = lf_document_date_from
                      document_date_to   = lf_document_date_to
    *              PURCHASE_ORDER     = IF_PURCH_ORDER
                      material           = lf_matno
                 IMPORTING
                      return             = ls_return
                 TABLES
                      sales_orders       = sales_orders.
    Am afraid to say you that above solution you get about bapi it is not for showing the list of SO these are for creating SO.
    Edited by: Amit Gujargoud on Jul 3, 2008 3:12 PM

  • Problem with special charecter while calling a BAPI from Webdynpro JAVA.

    Hi Experts,
    I am calling a BAPI from Webdynpro JAVA. I am passing a special charecter  u2018 as input to BAPI. But I am getting a # as input in R/3.. Can any one explain why it is getting changed?
    Any inputs regarding this issue are appreciated.
    Thanks,
    Kasinath.

    Hi,
        I had same problem before..For this I have created function module in backend for removing #. It was for converting Stream to ITF text.
    CONVERT_STREAM_TO_ITF_TEXT.
    Try this.
    Thanks,
    Prajakta

  • Calling transactional BAPI from Web Dyn Pro

    Hi,
    I am trying to call an RFC from web dynpro, unfortunately I'm a java person rather than ABAP so am struggling a little.  The Bapi is BAPI_BPCONTACT_CREATEFROMDATA, which a colleague has wrapped up so that it saves data from memory and then commits.  I can successfully create sales activities using this RFC from the GUI.  I have connected it to a web dynpro screen and am sending the same information I send from the GUI but get the following error message
    Msg Type I.  Start Processing of refernce object - Handle generated: $000000001 Message variable $000000001 Msg.no 000000 Msg.no 082 MessageID V3 Lines in parameter 0
    Msg Type I.  Integrity rule F0026 broken (field check) - Object $000000001! Msg Variable F0026 Msg Variable $000000001 Msg.no 000000 Msg.no 084 MessageID V3 Lines in Parameter 0
    Msg Type E.  Partner function CR is not defined from fiedl VBKAKOM-PARVW_BPARNR Msg Variable CR Msg Variable VBAKOM-PARVW_BPARNR Msg.no 000000 Msg.no 688 MessageID V1 Lines in Parameter 0
    Msg Type I.  Integrity Rule D0008 broken(dependency) - Object CR VBKAKOM-PARVW_BPARNR! Msg Variable D0008 Msg Variable VBAKOM-PARVW_BPARNR Msg Variable CR Msg.no 000000 Msg.no 085 MessageID V3 Lines in Parameter 0
    Msg Type I.  Business partner 100000000 with function CR from VBKAKOM not in VBPAKOM Msg Variable D0008 Msg Variable 100000000 Msg Variable CR Msg.no 000000 Msg.no 075 MessageID V3 Lines in Parameter 0
    The implementation within web dynpro is forcing to add a Bapi_Sender which I don't have to specify when using the GUI.  I am sending a bapi_sender object in the call with no information which is what I do when using the GUI.  As I mentioned before the parameters I am sending work perfectly when sent from the GUI.
    Any help would be greatly appreciated and I will award generous points. FYI I am also going to post this in the ABAP forum.
    Thanks in advance John Abbott

    Hello John,
    seems to be a customizing problem in SAP. Error says, that the Partner function CR is not properly configured in the tables VBKAKOM and VBPAKOM.
    Did you try to execute the bapi from se37 with function module -> test -> single test ? That is a comparable situation
    The sender has to be a logical system, that in this case, i suppose, has to be declared in SAP (and referenced in the Partner function) to create Data. It depends on the 'type' of function you are executing, reading or creating data in SAP.
    Regards Andreas
    Message was edited by: Andreas Milbredt

  • Call Custom Service from Event Receiver as Current User

    Hello,
    i bang my head on this problem for days now:
    My custom web service hosted in Sharepoint 2013 needs to know the logged on user name. I used to have a self-written impersonation in my service client before, but with switching to claims authentication this should be obsolete.
    So within my service i decode the user from
    IClaimsPrincipal icp = Thread.CurrentPrincipal as IClaimsPrincipal;
    IClaimsIdentity ci = (IClaimsIdentity)icp.Identity;
    String User = ci.ToString();
    This works well when i call the service from a custom aspx page.
    It utterly fails when i call the service from a List Item Event Receiver. The User always is the Application Pool Account.
    This is the Client code to open the Channel:
    private void SetChannelFactory(
    MyServiceApplicationProxy proxy,
    Uri address)
    if (null == proxy)
    throw new ArgumentNullException("proxy");
    if (null == address)
    throw new ArgumentNullException("address");
    // Check for a cached channel factory
    string endpointConfigurationName = GetEndpointConfigurationName(address);// Get the endpoint configuration name
    if ((null == s_ChannelFactory) || (endpointConfigurationName != m_EndpointConfigurationName))
    lock (s_ChannelFactoryLock)
    if ((null == s_ChannelFactory) || (endpointConfigurationName != m_EndpointConfigurationName))
    // Create a channel factory without specifying an endpoint address
    // so it can be cached and used for multiple endpoint addresses
    s_ChannelFactory = new ConfigurationChannelFactory<IMyServiceContract>(
    endpointConfigurationName, proxy.Configuration, null);
    // Configure the channel factory for claims-based authentication
    s_ChannelFactory.ConfigureCredentials(SPServiceAuthenticationMode.Claims);
    foreach (var operation in s_ChannelFactory.Endpoint.Contract.Operations)
    DataContractSerializerOperationBehavior behavior = operation.Behaviors.Find<DataContractSerializerOperationBehavior>() as DataContractSerializerOperationBehavior;
    if (behavior != null)
    behavior.MaxItemsInObjectGraph = 2147483647;
    // Store the current endpoint configuration name.
    m_EndpointConfigurationName = endpointConfigurationName;
    private IMyServiceContract GetChannel(
    MyServiceApplicationProxy proxy,
    Uri address)
    //Create Channelfactory
    SetChannelFactory(proxy, address);
    // Create a channel from the channel factory.
    return s_ChannelFactory.CreateChannelActingAsLoggedOnUser(new EndpointAddress(address));
    All research pointed out that "CreateChannelActingAsLoggedOnUser" would pass the current user (which is correctly identified within the event receiver!) to the service, but it doesn't work for my event receiver...
    Any advice on this would be great!
    With kind regards,
    Joachim

    You should be able to get the current user id from the SPListItemEventProperties object. From here you should be able to create a Claim. For example get the user by using
    user = SPWeb.Users.GetByID(properties.CurrentUserId)
    SPClaim claim = SPClaimProviderManager.CreateUserClaim(user.email, SPOriginalIssuerType.TrustedProvider, issuerIdentifier);
    https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.claims.spclaimprovidermanager.createuserclaim(v=office.14).aspx
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

  • Calling Custom Form from Another Form

    Hi All,
    I have created a Custom form using TEMPLATE.fmb and created functions in Apps and assigned to Responsibility etc and it all works OK.
    Now, I need to call this Custom form from another seeded(PO form) Via Tools -> Menu.
    using Forms personalization I can get the Menu Entry and Actions to execute the Form successfully from the PO Form.
    BUT, I need it to automatically query records in my CUSTOM form based on my current PO_HEADER_ID value on my PO Form.
    How can I do it ?
    Do I need to modify my Block and add some parameters and then pass a value via Personalization ?
    Please help !
    Thanks
    Shankar

    Hi ,
    I found similiar solution on another forum as below.
    http://it.toolbox.com/blogs/apps-traction-blog/how-to-create-a-zoom-using-oracle-form-personalization-12081
    This works fine for the Purchasing form and allows me to zoom to the Supplier form.
    But in my case, I want to zoom from the Supplier Form to my CUSTOM form. I replicated the exact steps as per the link.
    However, it does NOT work as expected. It gets up to the ENTER QUERY mode in my CUSTOM form and remains in Enter Query mode. If I manually then Press key F11 to execute the query it brings back all records.
    Do I need to do anything special in my CUSTOM form to make it behave in a similiar way to the Supplier Form ?
    Thanks
    Shanky

  • How can we call a BAPI from a scheduler?

    My project involves reading some data from R/3 and send a mail at regular intervals. I intend to use a schedular for that but dont know how to call a BAPI there. Is there a better way to go about it?

    Scheduler Task->Portal Service->RFC or BAPI
    You still have one issue which is IPortalComponentRequest. Portal service doesn't have access to it but you can get around it by setting up a SAP system for usermapping and then mapping that userid to a generic userid. Example code:
    private IConnection getConnection(
                   String alias)
                   throws Exception {
    IUser user =
    UMFactory.getUserFactory().getUserByLogonID("Administrator");     
    IConnectorGatewayService cgService = (IConnectorGatewayService) PortalRuntime.getRuntimeResources().getService(IConnectorService.KEY);
    ConnectionProperties prop = new ConnectionProperties(user.getLocale(), user);
    return cgService.getConnection(alias, prop);
    thanks.
    sridhar

  • Calling ABAP BAPIs from a JAVA client - Web Services vs. JCo

    Hi All,
    When calling BAPIs from a JAVA client, what are the pros/cons for making the call employing JCo vs web service technologies.  I understand that using SOAP would play better into the SOA theme and that there are nice tools to generate a WSDL document from a BAPI.  Aside from the obvious, are there any performance considerations and/or other major pros/cons to each
    Thanks,
    Mark

    Hi Mark,
    Have you got any information on this. If you have any information on this pls forward to me at <b>[email protected]</b> I am also having this confusion. My question is a bit deviating from your point. If we use XI when developing WDJs with WS, will it help in improving performance and maintenance.will it give any advantage if I use XI with BAPIs to connecto backend from WDJ apps. I got this confusion, becasue of a requirement to develop WDJ apps that will be accessed by 50,000 users. Somebody told client that use of XI willimprove performance.
    Any help is greatful
    Regards
    Ravindra
    Message was edited by:
            Ravindra Babu Tanguturi

  • How to call custom screen from User exit?

    Hai,
    I have to call a custom screen from user exit include after the delivery save.
    Depends on the data in the delivery,
    if the data satisfies certain conditions I will call the screen otherwise no.
    Could any one please tell me how to do this?where to create screen & how to link it here?
    Regards,
    Bhaskar.

    Hi,
    Please check with the following Enhancements -
    V50PSTAT  - Delivery: Item Status Calculation 
    V50Q0001   - Delivery Monitor: User Exits for Filling Display Fields
    Rewards if it helps
    Regard
    Goutham

  • Calling two  BAPIs from single input field from Webdynro for ABAP

    Hi experts ,
    here i hve a small problem .
    i hve two BAPIs , both  having olly one import parameter and hving messages as the export parameters .
    so how i hve to call them , give the correct method .
    thanks in advance
    setu

    Refer to this thread
    How to call two Bapi with same inputfield in webdynpro application

  • How to make the Commit after calling a BAPI from SE37 ?

    Hi
    When i use a BAPI for update some SAP table i always call the BAPI inside a program and then i call the BAPI_TRANSACTION_COMMIT for made the changes and validate them
    Bot now i need to test the BAPI directly in SE37 , and the BAPI returns the sucess message but i can not see the changes in the SAP tables , i guess i need to make the Commit but how can i do this ? 
    by calling the BAPI_TRANSACTION_COMMIT directly in SE37 after the call to the other BAPI  ?
    Thanks
    Frank

    se37 > clear the field of the function module name
    menu path: Function module > test > test sequence and give you FM's sequence you want to test

  • Calling custom report from seeded spawned program

    Hi,
    I dont know how to call a custom report(ie.,My own report) when Dunning letter generate is kicked off rather than calling the original programs(ie., Dunning letter print from dunning letter generate etc).
    thanks in advance.

    Hello vishwam,
    as I remember, there is an option to keep the dunning conc request assigned but change to executable to your own.
    Keep in mind that this way is not fully supported, but it should work.
    Regards
    Volker

  • Call Custom JSP from Screenflow JSP

    I need to call a static custom JSP(JSP2.jsp) from Screen flow JSP(JSP1.jsp) in Oracle BPM Studio while running Workspace.
    How do I do it? What will be the context path of JSP2.jsp while running workspace?
    JSP1.jsp has some context path created by Workspace. Where to keep my this custom JSP2.jsp and what is the path to call the same?
    I have tried giving/putting this static custom JSP.jsp in some other web server URL and worked fine. I want it to be inside my BPM Studio and need to be that path. It didn't work by just giving "JSP2.jsp" in the same folder structure of screen flow JSP1.jsp.

    The only thing i can think of, is that you aren't including the taglib.... The following works for me... (I keep my js files in a js folder in the webResouces, and css in a css folder... )
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <%@ page session="true" language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <%@ taglib uri="http://fuego.com/jsp/ftl" prefix="f" %> 
    <html>
         <head>
              <link href="<f:webResources relativePath='css/Avio-JCI.css'/>" rel="stylesheet" type="text/css">
              <script type="text/javascript" src='<f:webResources relativePath="js/jquery-1.4.2.js"/>'></script>
    . . . . . HTH,
    -Kevin

Maybe you are looking for

  • ITunes 10.6.3 freezes whenever iPhone 4 or iPad 2 connected - SyncServer errors

    All was well toward the end of 6/2012. I migrated to iCloud and everything seemed to be working. I was away on vacation when MobileMe "closed." Now I'm back and having terrible trouble synchronizing either of my iPhone 4s or my iPad 2. iTunes seems t

  • Install R12 on windows 2003 server 64bit

    Hi Experts, I need to install Oracle Apps R12 on windows 2003 server 64Bit. what are all the steps should be followed to install Apps R12 on win 2003 server 64bit, Please help me to do this, Thanks Sundaravel.R

  • Text as true text in PDF format

    I have started very recently with DPS and one of the things I miss most is that users cannot copy a piece of text at their wish to paste it in their mail readers, browsers or any other app. I wonder if this 'textability' of text is in the future plan

  • Is it just me..or lots of unanswered posts?  need help with sync/restore...

    nearly lost everything off my iPhone, due to a computer problem which holds primary iTunes library...I believe I'm finally having success right now in restoring..... But just in case...... my question is whether I can connect my iPhone to a second co

  • Noisy CD/DVD drive

    I have a 2009 MacPro, running the latest system etc. For quite some time my CD/DVD drive is really noisy when reading discs. I called Apple Support, but they wouldn't send me a new drive, since it still reads. I'm some 90 miles and a ferry ride from