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 ==--

Similar Messages

  • 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.

  • Asynchronus RFC  exception handling

    Hi,
    I have scenario File-XI-RFC.I have created an RFC enabled FM in R/3 and raising an exception if some errors occurs.I want that exception should be visible in sxmb_moni when RFC raises that exception.I am not using
    BPM.How can I use Fault message for this in my scenario.
    Any help will be appericiated.
    Thanx
    Rekha

    Hi Michal,
    I have seen that thread.It seems similar to my scenario except I dont have to send the response back.I want to have that fault message in SXMB_moni for monitoring.
    How I will achive the step3 in my case.
    This is my scenario.
    Outboundinterface-FILEMI   "To pick data from file
    Inboundinterface - ZRFC_TST.
    >>Step3: In interface mapping with target interface as ZRFC_Tst you will have to do three mappings
    >>3.1 Request
    This is ok I will map my FILEMI - ZRFC_tst.
    >>3.2 Response : map result
    What will be my source and target interface?
    >>3.3 Fault
    >>map zrfc_tst.Exception to FaultMessage
    What will be my source and target interface?
    How will I handle these three interface mapping in Interface determination in configuration?I dont have to send back  response and exception back to any system.Instead  I will keep them in monitoring.
    I can see this in sap help for fault message type but how we will achieve it.
    The fault message of the application for an asynchronous inbound interface is persisted for monitoring.
    Thanx for the reply and hope to hear from you on this.
    Rekha.

  • RFC Exception handling in BPM

    Hi All,
    I currently have a scenario where I receive an IDoc, then need to make an RFC call to another R/3 system to get some additional data, and then transform and send the resulting message out to another system.  There is a possible case where the R/3 system will send back a fault message with some meaningful text which we would like to map to a Status IDoc to send back to the source system.  The problem is, I can't seem to find a way to be able to use the fault message in a map in the BPM.
    Is this a limitation of XI, or is there some way to get this fault message into the BPM?

    Fault message propagation still functions the same for BPM....now instead of populating it as a Fault message can you ask the end system to populate the error (if any) as a response....may be the response RFC will be required to have the error structure.
    Now in BPM decide whether this is an error....if yes then create the IDOC....if not then discard the message.
    In one of my project requirements we had a similar req wherein there was proxy at receiving end....we updated the proxy (ASYNC) and if any error then another proxy would be populated giving error details (in case there was an error)....both the flows ASYNC....once we got the details we would do further processing.
    Regards,
    Abhishek.

  • 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

  • Synchronous RFC exception BPM

    Anybody has successfully getting the RFC.exception in a synchronous call via BPM? What i mean, is to get the RFC.exception then use it inside BPM.
    I have already searched the forum, and i think nobody have done it before. Any clue guys??? Thank you very much in advanced....

    Sorry, i still dont get it. Here i will illustrate my problem.
    I got an abstract sync message interface (lets call it: MIAS_RFC) with structure like this:
    1. Output Msg: From RFC
    2. Response Msg: From RFC.response
    3. Fault Message: From RFC.exception
    I use MIAS_RFC in a SEND node in my BPM inside a block with exception handler branch for my RFC exception handling.
    My purpose is to map the RFC.exception to other message interface abstract async inside the exception handler.
    How can i do this? You said earlier that i should create another sync abstract message interface (MIAS) then use it in a mapping...Am i correct? Could you please describe to me more detail (sorry about this ) Thank you so much....

  • How to handle RFC exception in XI

    We have developed a proxy-> RFC scenario. But its not able to handle the RFC exception. In case of an exception the response payload is as below
    <rfc:Y_BAPI_GET_POSTING_PERIOD.Exception xmlns:rfc="urn:sap-com:document:sap:rfc:functions"><Name>RFC_ERROR_SYSTEM_FAILURE</Name><Text>Screen output without connection to user.</Text><Message><ID>RFC_ERROR_SYSTEM_FAILURE</ID><Number>044</Number></Message><Attributes><V1>DYNPRO_SEND_IN_BACKGROUND</V1></Attributes></rfc:Y_BAPI_GET_POSTING_PERIOD.Exception>
    Is it correct way to get exception from RFC in such a way or the error/exception text should come in RETURN part of the RFC response? 
    What is the best approach or solution to handle the sync. RFC call exception in XI?

    Hi,
    You can create a Fault Message Type and map the RFC exception text to this.
    In the interface mapping in addition to Request and response
    mapping you will get an additional fault message mapping.
    This will handle your exception properly.
    Regards,
    V.Ramya

  • 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

  • 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?

  • 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

  • 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.

  • Problem with RFC exception in BPM

    Hi,'
    I have created control step for RFC exception. Assigned the alert catagory and given alert message.
    i have below steps:
    Transformation-control-send RFC-cancel process.
    while trying to test i changed ip address of rfc channel and tested but i am not receiving any alert but messages are getting stucked in BPM with error -
    permanent error in message proccessing
    could you please suggest how to trigger rfc execption

    Suggestions..
    refer  BPMPatternReqRespTimeout for triggering exception.
    Basically you might change the sequence of steps as follow
    Create Block with deadline branch where you use control step to trigger exception and have another branch exception handler  and in that branch you have transformation and senderror.  This will help.

  • 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

  • How to populate the RFC .Exception Message Type?

    Hi All,
    I am invoking an RFC synchronously from PI.
    I am using the RFC.Exception message type to capture the exception raised from the RFC.
    In the RFC, I have created a Non-class based exceptino anf raising it using the "Raise" command.
    But it is only pupulating "Name" and "Text" of the Exception message. All other fileds are blank.
    Is their a special way to raise the excpetion in rfc so as to populate the Exceptoin message type in PI completely?
    thanks,
    Piyush

    But it is only pupulating "Name" and "Text" of the Exception message. All other fileds are blank.
    Did you follow the steps as mentioned in this blog: /people/jin.shin/blog/2007/05/21/handling-web-service-soap-fault-responses-in-sap-netweaver-xi
    Regards,
    Abhishek.

  • BPM Exception Handling control step

    Hi,
    Does anybody have any idea, whats the variable we need to pass in the control step of exception handling  in BPM? and how to map the error message back to the RFC Response.
    I had Transformation step, in that mapping is also there.
    Is there any ideas??.
    Thanks,
    Raj.

    Hi,
    The requirement was to send the exception that occured to a target (say file).
    <i>insert a block for the exception</i>
    You cannot place an exception step without a block right... thats what i mean by the above statement.
    Now, just after the exception has taken place, if i put a transformation step, and a send step, you will be taking care of sending the exception message to the target.
    <i>how to build the exception message ? It should map from what?</i>
    You could build a data type for the exception.
    In the mapping, you could map it to constants. For ex:
    if you build your DT as
    <excep>
    <code/>
    <desc/>
    </excep>
    You could map the description to a constant string "timeout".
    After this, the send step will send the message to the file, through the abstract interface that you create.
    Regards,
    Smitha.

Maybe you are looking for