RFC JDBC Exception Handling

Hello,
i have the following scenario:
RFC receiver adapter (synchronous) <> XI <> JDBC receiver adapter (to MS SQL-database)
Is it possible to catch JDBC-exceptions, e.g. "duplicate primary key" and pass it to the calling rfc adapter?
thanks for your help
Christian

Hello,
still my problem is the exception handling of the synchronous JDBC - call.
If an error occurs I get the error "no payload found" in sxmb_moni_bpe
I think this is a problem of where the error occur, in the SOAP header
In sxmb_moni i get the following Error:
  <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!--  Aufruf eines Adapters
  -->
- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
  <SAP:Category>XIAdapterFramework</SAP:Category>
  <SAP:Code area="MESSAGE">GENERAL</SAP:Code>
  <SAP:P1 />
  <SAP:P2 />
  <SAP:P3 />
  <SAP:P4 />
  <SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'KUNDEN' (structure 'STATEMENT_NAME'): com.microsoft.sqlserver.jdbc.SQLServerException: Verletzung der PRIMARY KEY-Einschränkung 'PK_Kunden'. Ein doppelter Schlüssel kann in das 'dbo.KUNDEN'-Objekt nicht eingefügt werden.</SAP:AdditionalText>
  <SAP:ApplicationFaultMessage namespace="" />
  <SAP:Stack />
  <SAP:Retry>M</SAP:Retry>
  </SAP:Error>
Has anybody got any idea where my mistake is?#
I´m at loss.
If you need further information, contact me. I´ll send you the required informations.
Thanks and regards
Christian

Similar Messages

  • 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

  • Error Handling in RFC- JDBC sync

    Hi all,
    We are having scenario RFC<->XI<->JDBC(Sync),and its working fine also.
    Suppose  exception  occur in RFC->JDBC request mapping,Now is it possible to pass the error back to R/3 ?
    If parsing error occurs in JDBC adapter how to catch this error in error structure of rfc ?
    We observed that if any exception occurs on request side , response mapping will not get executed can anybody explain me why this is happening ?
    Thanks in advance,
    Tuhin

    Hi Gopesh,
    U should follow the steps as below.
    1.Create TCT/IP connection with t-code SM59
      in R/3 and give program id (it is case sensitive also).
    2.Give same program name in Sender RFc communication     channel.Check that this channel is register in your R/3 system with t-code SMGW(Gate way monitor)
    Only this much extra config I have done.
    Thanks,
    Tuhin

  • 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

  • Exception thrown by RFC To be handled in BPM

    Hi All ,
    I am trying the scenario.
    Http Client -> XI-->BPM -
    > RFC
                <-   <--    <------- 
    The whole communication is Synchronous.
    So I  have
    One Outbound  Synchronous Interface
    One Inbound  Synchronous Interface.
    Two Abstract  Synchronous Interface for  BPM.
    And  4  Abstract Asynchronous Interfaces for the containers which is to used in BPM.
    (Two for request and two for response )
    For simple Request Response Messages from the RFC my Scenario is working perfectly.
    But  I  Introduced  an Exception in RFC, So my Rfc is Throwing an Exception Message which needs to be returned back to Http Client.
    Now my problem is only Synchronous interfaces have the option of  fault messages in which the  exception  message can be included. So how do I pass the Exception message to Http Client via BPM , Because Containers require Asynchronous Interfaces and they are not accepting fault messages.
    Has Anyone tried this kind of exception handling in BPM,
    Please Help Me.
    Yomesh.

    Hi Saravana,
    first of all thanks for ur reply,
    In my scenario there are two reciever systems(SAP and JDE) and call to both the systems is synchronous. I am merging the responses from both systems into one using BPM. Thats why I needed BPM.
    Now About exception handling that is required because if response from one system is not there then also the BPM process should not terminate .It should give the output from other system and an error message for first one to the HTTP client.
    I think now the scenario is clear for you,
    Please see if you can help me with that.
    Thanks,
    Yomesh

  • Handling PI 7.1 RFC Lookup Exception in Graphical Mapping

    Dear Experts,
              I would like to know the better way of handling PI 7.1 - RFC Lookup Exception in Graphical Mapping without using  BPM. Say I perform a RFC Lookup from PI 7.1 Graphical Mapping and it fails due to RFC server down. In this case I suppose the RFC exception would be returned as response to the mapping? But, am really not sure how this response (RFC Exception) could be effectively used. Please clarify.
    Thanks,
    Hussain.
    Edited by: HussainShaik on Oct 26, 2009 8:24 AM

    Hi Hussain,
    I am not sure if I understood you query completely.
    IF the RFC look up raised some exception then how this is going to impact your interface will depend your mapping (which you did in ESR)
    (the following is adopted from help.sap,com)
    If you handled exceptions  by selecting Use Exceptions checkbox in the function properties of the standard function, the mapping editor adds an additional parameter in red (the bottommost return parameter) to the standard function in the data-flow editor. If you do not assign a target field to this return parameter, ignore the RFC exceptions (the message mapping is not terminated at runtime). Otherwise the mapping runtime transfers the exception as an XML structure and it can then be evaluated in a user-defined function, for example. If there is no exception, the mapping runtime transfers an empty context.
    If you have not selected the Use Exceptions checkbox, the mapping runtime terminates the message mapping if an exception occurs during the RFC lookup.
    Is this you are looking here?
    Also check this thread and help.sap site
    Re: SAP-PI - RFC call to SAP backend system
    http://help.sap.com/saphelp_nwpi71/helpdata/en/33/1ec6ced273493a993a80c2301c03da/content.htm
    Regards
    Suraj

  • How to implement Exception Handling for soap to RFC sync interface...

    Dear Experts,
    we have an interface like soap to Rfc sync, already develepment is done and moved to production. but we are getting some quatitity is greater than item then it is throwing an error below. i want to handle that exception in XI level.
    please guide i am not found any document for this type of interface.
    Please suggest what can i do for this. Please share me the screen shot for this.
    Error Log:
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Request Message Mapping
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>Application</SAP:Category>
      <SAP:Code area="RFC_ADAPTER">APPLICATION_ERROR</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="urn:sap-com:document:sap:rfc:functions">Z_DEPOT_DISPATCH.Exception</SAP:ApplicationFaultMessage>
      <SAP:Stack />
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    <rfc:Z_DEPOT_DISPATCH.Exception xmlns:rfc="urn:sap-com:document:sap:rfc:functions"><Name>RFC_ERROR_SYSTEM_FAILURE</Name><Text>Delivery quantity is greater than target quantity 10.000 MT</Text><Message><ID>VL</ID><Number>363</Number></Message><Attributes><V1>10.000</V1><V2>MT</V2></Attributes></rfc:Z_DEPOT_DISPATCH.Exception>
    Regards,
    Kiran Polani

    Dear All,
    This is clearly soap to rfc interface and we are using currently PI 7.0. This is a validation of BAPI, BAPI is not accepting the field of "Quantity is some value". The quatity is greater than the amount BAPI is throwing an error like "APPLICATION_ERROR". Is it possbile to validate in XI Level.
    Soap --> XI--> BAPI(Request)
    BAPI--> XI-->Soap(Response)( in this step what ever message return by bapi those error message not getting 3 rd party application).
    here by catching that error and i should throw to 3rd party application.
    is it possible to handle this or not.?
    If it is possible in Fault Mapping/Fault message type please give me the steps or document for me.
    I am new for fault mapping?
    Please help me on this.
    Regards,
    Kiran Polani

  • An exception handler is obligatory for synchronous RFC communication

    I am getting the error "An exception handler is obligatory for synchronous RFC communication" when I try to activate an Integration Process. Under a synchronous Send step, under Exceptions, I have System Error and the RFC.Exception Application Error to be handled. For both I have given the same Exception handler block. Is this not allowed? Why am I not able to go to same Exception handler block in case of both System Error as well as Application Error?
    Thanks

    you are right, it was erroring out due to the next step. Now if there is system error or exception, it will go to the exception branch. Here I need to have the ability to restart the process from this point after being alerted and having fixed the issue. So I am thinking of doing the send step again in the exception branch. But since the application error initially will exist soon after the alert is issued, this step will complete as I cannot handle application error a second time (this is where it was giving that error that exception handler was mandatory).
    Is there a way in which I can stop/fail the process after the exception branch gives the alert so that I can restart the failed branch again?

  • How to implement Exception Handling error in IDoc to File and RFC to File

    Hi,
    We are implementing the two below scenarios :
    1. IDOC to File
    2. RFC to File
    We have to implement the Exception Handling for the above two cases. Kindly could you provide the inputs to implement the Exception Handling for the above two cases.
    Please provide the precious inputs to implement this.
    Thanks,
    Ramesh

    Hi Ramesh,
    The exception handling for idocs
    http://help.sap.com/saphelp_nw04/helpdata/en/dc/6b7f1543d711d1893e0000e8323c4f/frameset.htm
    Exception handling in File to IDoc Scenario
    For RFCs
    Re: Passing SAP Exceptions to a sync SOAP Call
    Error Handling when using RFC
    Exception Handling while Calling RFC - BPM
    handle exceptions in remote function modules
    Regards,
    Prateek

  • BPM - RFC exception handling

    Hi,
    I have a Syn-RFC call in my BPM. I would appreciate help regarding the exception handling on the RFC.
    Ideally the RETURN parameter in RFC will be populated if theres an error. The BPM needs to check if there are entries in RETURN, if so then stall the message in MONI as error and mail support with contents of RETURN. only if RETURN is empty (success), it should go ahead with next step.
    Thanks.

    What ERP version are you working with?
    If 4.7+, consider using ABAP Proxy instead of RFC.
    There, you can define a fault message in the interface and it will be triggered if there is an exception at server application.
    Regards,
    Henrique.

  • RFC: Exception handling

    Hi there,
    after playing a bit with external xml files provided by my
    application i'm ready to go to the next topic on my ToDo-List.
    How could one implement a good and stable technique for
    exception handling? I'm talking about the interaction from spry to
    our Web Framework which throws an error sometimes.
    My current idea is that the server side framework could
    return some kind of Error XML format which contains the exception
    message and so on. This would require functions on client side to
    precheck the server output.
    Imho the best place for this is inside the XMLDataSet
    constructor. When catching some bad XML file internal error
    messages could be send using the already existing techniques OR by
    providing an public function which then should be overriden by an
    selfwritten one, e.g. to put it into my own `error box`.
    Also, some kind of internal statemachine in XMLDataSet may
    help a lot. That way each access to functions which aren't working
    at the moment could be loggend and catched by an selfwritten
    function.
    I hope you get the idea,
    what do you think?
    Best regards,
    Sebastian

    Better error handling and error handling hooks is on the list
    of things to do.
    The way I see it, there are several types of errors that can
    occur:
    1. Server returns valid XML, but it's XML that describes an
    error instead of the data requested.
    - I believe this is what Sebastian was mentioning. I was
    actually thinking of allowing a hook for developers to catch and
    handle this case and perhaps leverage the states mechanism to let
    them change the dynamic region markup used to display the error
    since the data references in this error XML would be different.
    2. The server returns an error. (Invalid URL or Server Error)
    - This could be handled with states, but we need to expose
    some data references, or set the data set to contain a known data
    set schema that would allow the designer to show more info about
    the error.
    3. The server returns XML but uses a mime-type that is not
    understood by Spy or the XML parsing code built-into the browser.
    - I believe it was Doug [?] that had a patch that *always*
    forced the data set to try and parse the XML string in the response
    if the response didn't contain an XML DOM. My one paranoia about
    that is that the server could actually be returning something that
    is not XML, in which we would still fail and perhaps choke
    somewhere else. I need to do some testing in that area.
    I was thinking perhaps we should add something to the
    XMLDataSet constructor that allowed a user to specify mime-types
    for formats they knew were XML, but didn't use one of the standard
    XML formats.
    4. The browser chokes on "not-well-formed" XML.
    - This is an interesting problem. IE silently fails when the
    parser chokes, but Mozilla creates an XML DOM tree that reports the
    error which does *not* match the XML string from the request
    response. I had to add code to spry to detect when this happens.
    5. An exception is thrown during Spry processing of XML data.
    - This will require more programming on our part to handle
    more cases.
    --== Kin ==--

  • Removing ABAP dump when JDBC is down in RFC- JDBC- RFC scenario

    Hi All,
    I need help to build one scenario.
    I am working on RFC->XI->JDBC->XI->RFC scenario. It is working fine.
    But problem is that whenever JDBC server is down RFC is giving ABAP dump in SAP. How can i Remove ABAP dump in SAP and give information to RFC that "JDBC is out of order"
    Is it possible to implement without BPM, then How?
    If not possible then what could be the steps of BPM?
    Thanks & Regards

    Rohan,
    1.Recive Step should open the Synch - Asynch Bridge
    2. Block Step --> Send Synchronous inside this step with an Exception Hanler.
    3. Now in the exception ahndler step, do the necessary error handling requirement.
    4. Send Step --> closes Synch Asynch bridge.
    My question is what data do you want to send back to the RFC if the DB is down? This data should be populated inside the exception handling block and then this data should be mapped to the corresponding RFC response and used in the step 4.
    Regards,
    Bhavesh

  • Exception handling of Transport acknowledgement in asynchronous send in BPM

    HI,
    A silly question, but your help would be greatly appreciated..
    - I have a asynch send step in a BPM for sending data to the target system through RFC
    - It has acknoweledgement property of this send step is set to transport acknowledgement
    - The exception property of this send step is set to throw a 'RFCException'
    - This send step is inside a block
    - This block also has an Exception branch which catches this 'RFCException'
    - now my RFC channel failed for some known reason, but the flow never went into the Exception branch
    IS this behaviour of the 'transport acknowledgement' property of an asynch send step in BPM expected ?
    What should I take care so that if my RFC receiver channel throws an exception, the flow of my BPM goes to the exception branch ??

    - now my RFC channel failed for some known reason, but the flow never went into the Exception branch
    IS this behaviour of the 'transport acknowledgement' property of an asynch send step in BPM expected ?
    What should I take care so that if my RFC receiver channel throws an exception, the flow of my BPM goes to the exception
    branch ??
    When an exception is caught by the Transport Acknowledgement it will trigger the Exception branch (if the send step is defined inside a Block with an Exception Branch)
    I think you have not defined (and then assigned) a proper Exception Handler for the Block.
    Click on the Block and define an Exception Handler......click on the Exception Branch and then select the Exception Handler from the dropdown......if this is not done then the Exception Branch wont be executed.....perform a check on your BPM in IR (using F7) you may get some warnings.
    Regards,
    Abhishek.

  • Capturing actual JDBC exception in BPM

    I have a scenario wherein i am inserting data in sql server syncronously using the xml insert structure.
    I have a BPM in place to do error handling, so that whenver any exception occurs, exception branch is executed,
    however, in the exception branch am not able to detect wht the error was. Like was the error related to connectivity or related to DB that something failed because of BD constraint.
    How can I trap the actual JDBC error in my exception handling..

    Hi,
    As you are using BPM and the call is Sync,you can get the response back if everything is fine. If not it will throw exception.
    If you want to detect the Application errors, one option is using Stored Procedures in the DB side, so that it will respond you back with insertion failed bacause of duplicate entry etc...
    If you want to handle , exceptions for connectivity issuses, you can make use of ALerts configured for JDBC adapters.. So you can create the Alerts like that.
    To know more-
    http://help.sap.com/saphelp_nw2004s/helpdata/en/33/4a773f12f14a18e10000000a114084/content.htm
    Hope this helps
    Regards,
    Moorthy

  • Exception Handling in Message Mapping and Alert

    Hello,
    1. Pls let me know the concept of Exception Handling and Alerts.
    2. Pls provide some blogs for Exception Handling in Message Mapping.
    3.What are Alerts and how it help us in XI. Pls provide some blogs for Alert
    4.How are Alerts and Exception Handling can be related say for some scenario
    Regards

    Hi,
    Plz check out these blogs of Sravya on Error Handling:
    /people/sravya.talanki2/blog/2006/11/22/error-handling-framework-xiout-of-the-box-episode-1
    /people/sravya.talanki2/blog/2006/11/23/error-handling-framework-xiout-of-the-box-episode-2
    Also check this SAP Presentation:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9418d690-0201-0010-85bb-e9b2c1af895b
    /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
    Error Handling :
    http://help.sap.com/saphelp_nw04/helpdata/en/56/b46c3c8bb3d73ee10000000a114084/frameset.htm
    Alerts:
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--troubleshooting-guide
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step
    http://help.sap.com/saphelp_nw04/helpdata/en/56/d5b54020c6792ae10000000a155106/content.htm
    BPM:
    /people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit
    Working with acknowledgements
    regards

Maybe you are looking for

  • Access sharepoint list form visual studio

    I am trying to access share point  site as data source in visual studio .I am getting below error.Please help me resolve this error. The HTML document does not contain Web service discovery information. Metadata contains a reference that cannot be re

  • How to keep photos and still download ios7 on Ipad?

    I use my IPad as a camera. To take photos of construction jobs I have done. I want to download the IOS7 update for my IPad, but have been told I have to remove my photos from my IPad to make room for the download. I purchased additional storage which

  • Assign company code to consolidation staging ledger

    Dear Guru, When I execute tcode GC41, there is an error message , it said : No ledger for consolidation has been specified Message no. GC191 Diagnosis No consolidation staging ledger was allocated to the company code. System Response If an extract is

  • Carry and forward agent

    Hi i want to do the configuration for C& F agent in the system. From the forum i understand that it is done through the partner determination using "FA" as a partner functions. Could someone elaborate more and tell me the required accouinting enrtrie

  • Clustered blade servers

    We're currently investigating a hardware refresh of our production landscape and we've come across a bit of a stumbling block. For the record, we're not particularly big, currently running ERP 2005 with a database instance and the central instance on