Exception handling in rfcs and bapis

exception handling in rfcs and bapis

Hi Jayakrishna,
In General , there are non execptions in BAPIs, because of the reason, that the exception raised in a SAP envoronment may not mean anything for a non SAP initiator. All the exception situations would only fill the return table(TYpe BAPIRET2 or something like that). If you read that table after the call to the bapi, you can understand what has gone wrong.
Regards,
Ravi

Similar Messages

  • Unable to differentiate between RFC and BAPI

    Hi guys,
        Nowadays I am studying the above concepts:BAPI and RFC.  But I am confused by the two.
    So far I learnt that the two are both techniques used to realize communication between SAP and external
    systems,and frequently via Remote-enabled Function.  
       My confusion is the distinctions between the two. Would you please do me a favor? Tks

    Hi   Alex,
    Just check it out these answers.
    Remote Function Call :
    RFC is an SAP interface protocol. Based on CPI-C, it considerably simplifies the programming of communication processes between systems.
    RFCs enable you to call and execute predefined functions in a remote system - or even in the same system.
    RFCs manage the communication process, parameter transfer and error handling.
    http://help.sap.com/saphelp_47x200/helpdata/en/22/042860488911d189490000e829fbbd/frameset.htm.
    BAPI
    BAPI stands for Business API(Application Program Interface).
    A BAPI is remotely enabled function module
    ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..
    You can make your function module remotely enabled in attributes of Function module but
    A BAPI are standard SAP function modules provided by SAP for remote access.
    Also they are part of Businees Objest Repository(BOR).
    BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects.
    You create business objects and those are then registered in your BOR (Business Object Repository)
    which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA.
    In this case u only specify the business object and its method from external system
    in BAPI there is no direct system call. while RFC are direct system call.
    Some BAPIs provide basic functions and can be used for most SAP business object types.
    These BAPIs should be implemented the same for all business object types.
    Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs.
    Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
    another points,
    BAPI is object oriented. It is placed under Business objects as methods.
    RFC is just a Function module or a call.
    RFC: is just a FM that can be called from remote system too(destination defined in transaction SM59).
    BAPI: Business Application Programming Interface
    A BAPI is a method of a business object defined in the Business Object Repository (BOR). For example, in the BOR, you can find a business object called SalesOrder, which conceptually represents a sales order in the system. A business object typically has several methods that can be used to read, create, modify a particular instance of the business object, or list instances of the business object matching certain selection criteria. These methods are BAPIs.
    Technically, a BAPI is implemented using a RFM. But, unlike the non-BAPI RFMs, a BAPI is usually well documented, has nicer parameter names, and is supported by SAP for several SAP software releases. You can browse Business objects and BAPIs in the SAP system using transaction BAPI.
    Thanks
    Eshwar
    *Rewards if useful*

  • Preference between rfc and bapi

    Hi
    If rfc and bapi are available for the similar task to implement ...........as a XI consultant which one you will suggest ?? If so could you please explain me the reason for the same ??
    thanks
    kumar

    Hi,
    From an XI Implementation perspective,
    BAPI's do not have a implict COMMIT associated with them and so , in the receiver RFC adapter you need to provide the COMMIT HANDLING FOR BAPI CALLS. This option was avilable from SP 14.
    Prior to that you had to writter a warpper RFC and import it into XI and use this instead of the BAPI.
    The RFC's conatin an Implicit commit so no such issue here.
    regards
    Bhavesh

  • RFC AND BAPI

    Hi,
    Difference b/w the BAPI and RFC.

    Dear Bhagavan,
    Go through the following threads
    BAPI and RFC
    What is the difference between RFC and BAPI?.
    RFC AND BAPI
    BAPI& RFC
    Best Regards,
    Srikanth
    Reward the useful answers and you will get
    ONEPOINTyourself

  • About RFC and BAPI

    Hello Masters,
                 What Makes the exact difference between RFC and BAPIs. Both can perfom same thing. BAPI uses the RFCs only. Then how can it justify?
    Thank you

    RFC:
    RFC --- > Function module and general will be used to make call to function
    sending the function (XI has RFC adapter)
    BAPI:
    BAPI ---> Other version of RFC (Objected oriented) mostly we will use for Sync
    calls (Mostly in XI using proxies we will call BAPI's)
    Refer these links for more details:
    http://sapabap.iespana.es/sapabap/sap/faq/ale_idocs_bapi.htm
    http://www.sap-img.com/fu033.htm
    BAPI Vs IDOC - in detail
    http://searchsap.techtarget.com/tip/1,289483,sid21_gci824860,00.html
    /thread/127699 [original link is broken]
    IDOC,RFC,BAPI
    Re: When and Why we use BAPI, RFC and IDOC.. in XI
    Diff... between  ALE, IDOC, RFC, BAPI, BADI --- Not clear and clarify
    idoc and bapi
    Difference among  IDOCS,BAPI,RFC?
    http://searchsap.techtarget.com/ateQuestionNResponse/0,289625,sid21_cid558752_tax293481,00.html
    Differences Between RFC & BAPIS
    RFC Vs BAPI
    For more details:
    refer this thread.
    What are idocs, BAPI, RFC?
    BAPI is nothing but the Business process programing interface which are standard and stable and these are store in the business object repository.
    Standardized programming interface that enables external applications to access business processes and data in an SAP System
    RFC is the remote function call which is used to call the function remotely which may be in same system or ather system
    its also used communication between SAP systems , between SAP systems ,external systems.
    idoc and bapi
    Difference among  IDOCS,BAPI,RFC?
    http://searchsap.techtarget.com/ateQuestionNResponse/0,289625,sid21_cid558752_tax293481,00.html
    Differences Between RFC & BAPIS
    RFC Vs BAPI
    http://www.sap-img.com/abap/ale-bapi.htm
    RFC means remote function call,
    these are the function modules which can help u to access across the sap and from sap to third party front end,
    BAPI means Business application programing interface which is the RFC enable function module and uses in OOPS concept.
    RFC ,IDoc and BAPI
    ALE/ IDOC
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://www.sapgenie.com/sapedi/index.htm
    http://www.sappoint.com/abap/ale.pdf
    http://www.sappoint.com/abap/ale2.pdf
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://www.sappoint.com/abap.html
    http://www.sap-img.com/abap/interview-question-on-bapi-rfc-abap-objects-tables.htm
    This is a short description of BAPI and RFC
    BAPI stands for Business Application Programming Interface. It is a library of functions that are released to the public as an interface into an existing SAP system from an external system.
    RFC is the protocol used to call functions in an R/3 system by a caller external to R/3 or to call programs external to R/3 from an R/3 system.

  • WAD Call RFC and BAPI

    Dear all,
         I have a problem about using WAD call RFC and BAPI get BW data,who can help me?

    HI Bill,
    Please give details of what you are trying to do. 
    Brian

  • Aout RFC and BAPI

    Hi Eperts,
        Would you please tell me the difference between the two,because I learnt that BAPI is a kind of RFC,I'm not sure whether it is right or not.

    Hi,
    RFC Vs BAPI
    BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. 
    In this case you only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.  It is not  possible to connect SAP to Non-SAP systems to retrieve data using RFC alone. RFC can acces the SAP from outside only through BAPI and same is for vice versa access. 
    RFC is the protocol used by SAP for remote communication, that is, for communications between remote (independent) systems. RFC is used for communications between two independent SAP systems, or for communications between an SAP system and a non-SAP system, such as an external application. It can also be used for communications between modules on the same system. Using the RFC interfaces you can extend the functionality of R/3 applications from an external program.
    Reward if it useful...
    Lakshmi.

  • Are all RFCs and BAPIs automatically exposed as web services?

    Hello,
    Our product helps business users exchange data with SAP. We use standard RFCs and BAPIs to communicate with SAP. This is a .NET application although my question is not specific to .NET.
    It seems SAP obsolete their .NET connector in near future. The emphasis is on web services. This is a great move. We can simply drop using the .NET connector and start using the web services. However, I have a few doubts:
    1. RFCs and BAPIs are automatically exposed for remoting. When the customer installs our application, it just works out of the box. Customers do not have to make any configuration changes to SAP to expose RFCs and BAPIs.
    In the new world, are all RFCs and BAPIs automatically exposed as web services or one has to go through each RFC/BAPI and expose it explicitly?
    2. Is there a comprehensive WSDL schema available anywhere for all the RFCs/BAPIs?
    3. Are there any other web services (besides RFCs/BAPIs) that SAP Netweaver exposes? Where can I get more information?
    Thank you in advance for your help.
    Regards,
    Pradeep

    Darryl,
    Thank you for your help or at least trying to help me. However, you left me with more questions than answers:-(.
    1. "Old" does not mean "bad."  Each RFC/BAPI serves a specific function. If some RFC is being obsoleted, there must be a replacement documented somewhere. Is there one?
    2. I can look into SE80 (and other transactions) to see what is exposed. However, what I need to understand is what is SAP's stance on exposing standard web services.
    Can others please share your thoughts?
    Regards,
    Pradeep

  • Exception Handling in RFC lookup

    Hi Experts,
    I have a query in RFC Lookup function working with PI 7.1,  file to Idoc scenario.
    I am using Enhance Receiver Determination to find the dynamic recivers.Here we have used a Functional Module which gives an output according to the the input parameter (which comes from input file). thus i have used RFC lookup to the remote system to fetch this info from FM.
    Problem -
    When the remote system is down or if the RFC lookup attemped & exceptions raised for some reason (RFC user authority has been changed & it was not able to perform the intended Job at remote system) , the message stuck in queue and block the several other messages from another interfaces which belongs to teh same queue.
    Queries-
    This is not allowed in production as it affects other services.
    1>how can we handle the RFC lookup exception (in case of remote system is down or if the RFC lookup exception)
    2>how can we perform Local lookup at PI box rather then remote lookup (the FM fetches the data from remote system)
    3>Is Value mapping is relevant in this case raher the RFC lookup ? I am not sure as the values are dynamic & selected as per the FM's output.
    Please provide your valuable insight .
    Thanks in advance !
    -Jyoti

    Hi Jyoti,
    Answer for your 3 question.
    1. RFC lookup will get execute on R/3 so if R/3 is down there no way that your RFC lookup will work as expected.
    2. So if R/3 is down or RFC not able to get receiver system due to some problem.. then in that case.
              On your Receiver determination at bottom
              Configure  u201Cif no receiver found proceed as followingu201D
               In this you can have 3 option.
                        a. Error message u2013 if you select this the transaction will end with error message in SXMB_MONI
                        b. Ignore: if you select this execution will get ignored and there will not be any entry in SXMB_MONI
                        c. Select the following receiver. You can select this and can configured default receiver system in case if RFC not able to determine receiver then interface will get route to receiver system configured here.
    3. As you mentioned values are dynamic  then Value mapping doesnu2019t make any sense here. RFCl ookup is the right option and above are few other option in case you RFC lookup flailed.
    Thanks,
    Bhupesh

  • Bapi doubt ...difference rfc and bapi

    Plese give me the following information.
    1) wt is the difference between BAPIRETURN, BAPIRET1 and BAPIRET2?
    2) wt is the diff. between an RFC-enabled fm and BAPI ?

    Hi again,
    1. YES, Definitely it will behave like BAPI.
    2. The sap concept of
       naming function modules (related to business object)
       and naming them as BAPI*
       is JUST FOR IDENTIFIECATION PURPOSE,
               and nothing else.
      We can give ANY NAME.
    regards,
    amit m.
    Message was edited by: Amit Mittal

  • Accessing RFCs and BAPIs from enterprise java beans

    Hello folks,
         my question is concerning comunication between EJBs and RFCs. I want to develop a simple session bean that connects to a R/3 back-end, calls a RFC then returns some data, let's say, an example of this could be a list of employees from BAPI_EMPLOYEE_GETDATA.
         Ok, by using a web dynpro and adaptive RFC my works could be very very easy, but I'd like to test this way: session (stateless) EJB -> RFC. Can I:
    *     use JCO.ClientService with a non-portal SAP WAS?
    *     use embedded JRA (SAP Library stated "The SAP JRA is an add-on for the SAP JCo. If you use      the SAP Web AS, the SAP JRA is installed automatically with the SAP JCo.", but I found      nothing so in Connector Container Service ...)
    *     install and configure JRA by myself?
    I'm working on a SAP WAS 6.40 Sneak Preview (Java only), and finding a path for easily integrate SAP WAS developed ejbs and external business system. SAP Library suggest to "obtain the JCo connection through the connection framework": is it related to JRA, JCA and SAP Resource Adapter?
    Thank you
    Pasquale

    hello
    i´ve written a simple stand alone client to test jra connection to a sap system
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.util.Properties;
    import javax.resource.cci.Connection;
    import javax.resource.cci.ConnectionFactory;
    import javax.resource.cci.Interaction;
    import javax.resource.cci.MappedRecord;
    import javax.resource.cci.RecordFactory;
    import javax.resource.cci.ResultSet;
    import javax.resource.spi.ManagedConnectionFactory;
    import com.sap.mw.jco.jra.*;
    public class Example
         public void exampleTest()
              Properties properties = new Properties();
              Connection   connection=null;
              try
                   properties.load(new FileInputStream ("props.txt"));
              catch(Exception e)
                   System.out.println("properties could not be loaded");
                   e.printStackTrace();
              try
                   ManagedConnectionFactory mf = new JRA.ManagedConnectionFactoryImpl(properties);
                   ConnectionFactory cf = (ConnectionFactory)mf.createConnectionFactory();
                   connection = cf.getConnection();
                   RecordFactory rf = cf.getRecordFactory();
                   Interaction interaction = connection.createInteraction();
                   MappedRecord request      = rf.createMappedRecord("STFC_STRUCTURE");
                   // Since the STFC_STRUCTURE does not create any new records
                   // in the data base, you do not need to start a trancation here.
                   // fill out a structure with dummy data
                   MappedRecord importstruct = (MappedRecord)request.get("IMPORTSTRUCT");
                   importstruct.put("RFCFLOAT","1.23456");
                   importstruct.put("RFCCHAR4","ABCD");
                   importstruct.put("RFCINT1", "11");
                   importstruct.put("RFCDATE", "2001-08-24");
                   // fill out a table with dummi data
                   ResultSet rfctable = (ResultSet)request.get("RFCTABLE");
                   for (int i = 0; i < 10; i++)
                        rfctable.moveToInsertRow();
                        rfctable.updateString("RFCCHAR4","EFGH");
                        rfctable.updateInt("RFCINT1", i);
                        rfctable.updateString("RFCDATE", "1961-08-24");
                        rfctable.updateDouble("RFCFLOAT",1.65432);
                        rfctable.insertRow();
                   // call defined RFC and cast the result to the optional ResultMap interface
                   ResultMap response = (ResultMap)interaction.execute(null,request);
                   // release resources
                   interaction.close();
                   // create an xml file from the output of the called RFC
                   // the optional interface ResultMap offers additional methods, like writeXML
                   FileOutputStream os = new FileOutputStream(response.getRecordName() + "_Structure_from_NotManaged_Example.xml");
                   response.writeXML(new java.io.OutputStreamWriter(os,"UTF-8"),true);
                   os.close();
                   ResultSet resultSet = (ResultSet)response.get("RFCTABLE");
                   System.out.println("Name of the table is: "+resultSet.getRecordName());
              catch (Exception ex)
                   ex.printStackTrace();
                   System.exit(1);
              finally
                   if (connection != null)
                        try
                             connection.close();
                        catch(Exception exception1)
         public static void main(String[] args)
              Example anExample = new Example();
              try
                   anExample.exampleTest();
              catch(Throwable t)
                   t.printStackTrace();
    the property file looks like this:
    jco.client.client=010
    jco.client.user=user
    jco.client.passwd=pass
    jco.client.ashost=your host
    jco.client.sysnr=00
    but this only an example for a standalone test client
    to use jra inside j2ee first deploy the connector with the settings you need and then get a connection to it using jndi
    i don´t have an example at hand for using it inside an ejb or servlet, but if you need one i'll have a look

  • Can you read Reports and Tables through RFCs and BAPIS?

    Is there any way to read established reports and tables through RFC or BAPI function calls?  We have a middleware that can execute various BAPIs and RFCs.  I see a few promising ones: RFC_READ_REPORT, but no examples anywhere what the parameters needed are for the inputs. 

    Hello Scott,
    Check below FMs for reading tables and programs.
    Tables : RFC_READ_TABLE
    Program : RFC_READ_DEVELOPMENT_OBJECT
    Please note that for reading program using RFC_READ_DEVELOPMENT_OBJECT , lines in program should not exceed 72 chars else FM will throw dump(READ_REPORT_LINE_TOO_LONG).
    Program code will appear in table QTAB which is 72 chars wide.

  • BPM Exception handling for RFC errors

    Hi all
    I have to handle the exception which would be like below:
    com.sap.aii.af.ra.ms.api.DeliveryException: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: could not get a client from JCO.Pool: com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to SAP gateway failed
    I am trying to put Block step and things are not working fine. Can anyone please explain me the steps to trap the exception?
    My scenario has synchronous call to RFC FM.
    Rightnow i have inserted Exception branch in my Block step and put the send step to write the error file.  I have put the Synchronous SEND step as part of block. This is not working.
    Help please??

    Hello Samuel,
    Just to close this thread and finish up my own search, where I met your discussion, here I'm quoting two experts of this forum:
    "you cannot catch the exception's value in the XI "
    (see posting from Michal Krawczyk, Jun 12, 2006, in thread catch the exception)
    "The content of a fault message are not accessible inside a BPM."
    (see posting from Bhavesh Kantilal, Oct 3, 2007, in thread Notify user about Exception in BPM)
    Regards,
    Dennis

  • Exception handling in BPM and ABAP mapping

    Hello all,
    We have a BPM with this structure:
    . REC (receiver)
    . <begin BLOCK1>
      . TRANSFORMATION1 (Abap Mapping)
      . <begin EXCEPT> (exception branch)
        . CONTROL (Cancel Process)
    . <end EXCEPT>
    . <end BLOCK1>
    The same exception is assigned to the block; to the mapping and to exception branch.
    The problem is that, when in the Abap Mapping the exception CX_MAPPING_FAULT is raised, the exception branch seems to be ignored and so, the BPM doesn't finish.
    This problem only occurs in some of ours BPMs, because the same thing, when done in other BPMs, works fine.
    I know i can change the BPM to turn around this problem, but i would very much like to know the solution to this.
    Please, help us with this posting.
    thanks in advance
    Filipe Barreira

    Hi again,
    We are in SP19, witch invalidates the note 921757 listed.
    Also, i made an abap mapping witch only raises the exception. So i think it is not an ABAP error.
    Also the XML seems to be correct, because this is a duplicates check routine. A message (with the same data) already entered previously (we trying to avoid another entry).
    In the trace analysis for the message, it is stated that the exception has occurred:
      <?xml version="1.0" encoding="utf-8" ?>
    - <MappingTrace>
      <Trace level="1" type="T">Mapping-Namespace:http://xi.es/suministros</Trace>
      <Trace level="1" type="T">Mapping-Name:IM_SALIDAS_TESTE1</Trace>
      <Trace level="1" type="T">Mapping-SWCV:7CE651C00ABC11DBCBF0C8E8C0A901F6</Trace>
      <Trace level="1" type="T">Mapping-Step:1</Trace>
      <Trace level="1" type="T">Mapping-Type:R3_ABAP</Trace>
      <Trace level="1" type="T">Mapping-Program:ZCLTD_MM_SALIDAS_CARGA_TESTE</Trace>
      <Trace level="1" type="T">Creating Abap mapping. Classname =ZCLTD_MM_SALIDAS_CARGA_TESTE</Trace>
      <Trace level="1" type="T">CALL APPLICATION MAPPING.</Trace>
      <Trace level="1" type="T">Application error in mapping program ZCLTD_MM_SALIDAS_CARGA_TESTE, error code: , error text:</Trace>
      </MappingTrace>
    the problem is that the process keeps running.
    regards Filipe Barreira

  • What is the diffrence between BAPI and RFC and business object

    Hi Experts,
    Can anybody tel me what is the diffrence between RFC and BAPI , and also what is ther relation with business object?
    Thanx in advance.
    Nilesh Hiwale

    Hi,
    BAPI's are associated with Business Objects and also they are RFC enabled.
    But RFC's are the FM's which can be called from external systems, those FM's can be used in many places based on the applications..
    Check these Links
    whats the difference between BAPI and RFC??
    Diff. Between BAPI and RFC
    Regards
    Kiran

Maybe you are looking for

  • How many users can you have on one account ?

    Hi, I have just created a ID with Adobe Reader for a group to use files stored in cloud. I would like to know how many users can access the account at one time via, mobile devices, ipad, desktops ?

  • Dock disappears for a few seconds and minimized apps open up

    Hello My dock at the bottom of the display will disappear for a few seconds and at the same time, my minimized open applications will open up. This usually happens when I'm running a few light applications at once. It almost seems to "gulp" or catch

  • An error occurred while publishing file "/Web/Sites/iWeb/Jim and Steph's Si

    I'm guessing this is a common message most see when they try to publish their website. Reason I say this, is it is the only message I have recieved in the last week when trying to use this faulty software. Here it is again if you missed it: An error

  • Viewing Images in PDF.....

    Dear All, Sometimes I can't view images in PDF that I created in Illustrator by making PS and PDF. But it get viewing when am selecting "OVERPRINT PREVIEW" in Advanced Tab in Adobe Acrobat. can anyone explain what is the reason? and what settings tha

  • ORA-04052: Error occurs when execute the block

    I'm trying to run one block and his query definition uses an active public database link. When I ran the script to block I get the following message: ERROR in line 1: ORA-04052: error occurred when looking up remote object SQ_DSV.temp_tipo_contr@SQ_D