Abap Proxy exception Handling

Hi guys,
I've implemented the following scenario:
BPM Process where I've got a async receive (from a file receiver), a sync send (to an ABAP PROXY) and a send async (to a file sender).
The scenario is working great, I've catched 'Communication exceptions', and the proxy contemplates the necessary exception throwers too, but I'm now trying to Handle one specific exception. Imagine you force a dump, with a divide by zero in the proxy code...the proxy will dump and the XI gets a mapping exception (like is supposed to).
The exception is:
<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
<SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
<SAP:P3>RuntimeException in Message-Mapping transformatio~</SAP:P3>
The thing is, I want to catch this exception on the mapping and handle it, so the bpm process sends the handle response with the file sender.
I've looked to Alessandro Guarneri blog, but it's a little bit different, because I don't want to throw an exception but I'd like to handle it....
Can you guys help me with this question?

Hi Vijaya,
I was able to catch the exception like you said, on the proxy side.
I'm trying to conceive some real and feasible dumps scenarios and for that I'm forcing dumps, and catching exceptions. Divisions by zero was one of the examples.
For division by zero I was able to catch it with a cx_sy_no_handler exception, but I've another example which I'm not being able to catch it.
I'm sendind an message e001(zisa), which will exit automatically from the function module. Am I able to catch that message? Meaning, can I catch it and treat it, instead of the system exiting the function and showing the corresponding message?Is there any cx_* ?
Even better, on sxmb_moni I get:
<SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
  <SAP:Category>XIServer</SAP:Category>
  <SAP:Code area="INTERNAL">HTTP_RESP_STATUS_CODE_NOT_OK</SAP:Code>
  <SAP:P1>500</SAP:P1>
  <SAP:P2>Internal Server Error</SAP:P2>
  <SAP:P3 />
  <SAP:P4 />
  <SAP:AdditionalText><html> <body> <H1> 500 SAP Internal Server Error </H1> <B> Error message: </B> O centro nao existe ou nao esta preenchido. ( <B> type of termination: </B> ERROR_MESSAGE_STATE ) <BR /> </body> </html></SAP:AdditionalText>
  <SAP:ApplicationFaultMessage namespace="" />
  <SAP:Stack>HTTP response contains status code 500 with the description Internal Server Error Error when sending by HTTP (error code: 500, error text: Internal Server Error)</SAP:Stack>
  <SAP:Retry>N</SAP:Retry>
  </SAP:Error>
So, the SOAP adapter receives something. If it's not possible to catch this exception on the abap proxy side, can I catch and map that soap adapter error text on the BPM side?
Thanks a lot for all of your attention

Similar Messages

  • ABAP proxy exception to SOAP fault and vice versa not getting mapped

    Hi there,
    I have these scenario's: ABAP proxy to SOAP (AXIS framework) and the other way around, synchronous, using AAE.
    When declaring the Synchronous Service interfaces we also defined error message types in order to pass system and application exceptions back to the service consumers.
    The behavior we are observing is as follows;
    When an exception is generated on the ABAP proxy, the error message type is correct generated and filled with the corresponding values in the ABAP proxy runtime. However, when the response arrives at the service consumer, it only contains a SOAP fault filled with some kind of generic PI mapping exception information.
    1. Why is the original ABAP proxy exception not mapped/passed into the SOAP response?
    2. What can we do in order to change that situation?
    3. Does it has to do with the use of the AAE - Advanced Adapter Engine or the AXIS framework?
    PS: We have performed a test of the Operation Mapping - OM using the ABAP exception as input and it did work correctly, so the error structure seems to be Ok.
    Many thanks for your replies.
    Edited by: Roberto Viana on Jul 26, 2010 8:30 PM

    Problem was caused by some differences in namespaces between source and target.

  • ABAP Client Proxy Exception Handling and Alerting

    Hi,
    When we call an outbound ABAP Proxy we have a try/catch section for handling system exception. In what situation the exception is thrown. Also since we are catching that exception, how alerting can be done via CCMS or Alert Framework.
    Regards,
    Sudharshan

    Hi Sudharsan,
    First configure CCMS in XI System:-
    /people/sap.user72/blog/2005/11/24/xi-configuring-ccms-monitoring-for-xi-part-i
    For Monitoring in the CCMS:-
    http://help.sap.com/saphelp_nw04/helpdata/en/4d/6272376d3bfa2be10000009b38f8cf/frameset.htm
    Go thro' this link for configuration scenario:-
    /people/aravindh.prasanna/blog/2005/12/23/configuring-scenario-specific-e-mail-alerts-in-xi-ccms-part--1
    I hope this helps.
    Regards.
    Praveen

  • ABAP Proxy Exception

    Hello everybody i have this error in my sxmb_moni of xi for a abap proxy server receiver:
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Inbound Message
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>XIProxy</SAP:Category>
      <SAP:Code area="ABAP">DYNAMIC_CALL_FAILURE</SAP:Code>
      <SAP:P1>UNCAUGHT_EXCEPTION</SAP:P1>
      <SAP:P2>ZFUS_CL_MI_FMGOB_CAT_FONDOS_C1</SAP:P2>
      <SAP:P3>EXECUTE_SYNCHRONOUS</SAP:P3>
      <SAP:P4 />
      <SAP:AdditionalText>Unable to execute the dynamic application call (kernel error ID UNCAUGHT_EXCEPTION, class ZFUS_CL_MI_FMGOB_CAT_FONDOS_C1, method EXECUTE_SYNCHRONOUS)</SAP:AdditionalText>
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack />
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    any suggestions?
    Regards,
    Julio Cesar

    Hi
    Below is the full details of above links
    For link 4196517?
    Q) Hi All,
    I have got a requirement to raise an exception from existing ABAP Proxy depending on condition. XI consultant created a fault messge type and attached to the inbound interface message type. I have regenerated the ABAP proxy but I cant find any thing in excpetion tab to raise exception.
    Please let me know the solution for this.
    Answers : 1) Go to Sproxy .
    Select the message interface for which you generated the proxy.
    Click on the Structure tab. Do you see any Exception Class generated for fault message ?
    2) Just follow all the steps defined in the below Blog and you will find the solution.
    /people/shabarish.vijayakumar/blog/2006/11/02/fault-message-types--a-demo-part-1
    3) I can't find any exception class there in 'Structure' tab. what might be the problem.
    4) In SProxy ..under the Message Interface you will see Fault Message Type.
    Click on Fault Message Type and check if you can see the fault message type created by xi consultant.
    Also ask your xi team to login to IR and re-activate the interface.
    5) I can't find any fault message type under Fault Message Type. I will ask my XI consultant to reactivate the interface.
    Is this the only problem for this or is htere any other reason for not finding this fault message type in SPROXY.
    6) Ideally the fault message type should be visible unless he has defined Software Dependencies and using MT from some other SC.
    Even if the fault message type is not visible everything could be all right.
    Ask him to check if he selected the fault message type while activating the interface.
    Do update us when you get a reply from ur xi team.
    7) I have checked with XI admin, he said that he created fault message types in Development Xi but R/3 Development refers to Production XI system in exchange profiles. He asked me to change it to XI development in exhange profile settings. So I am searching info on how to set exchange profiles.
    8) The following link will guide you ..
    http://help.sap.com/saphelp_nw04s/helpdata/en/c9/7a1041ebf0f06fe10000000a1550b0/frameset.htm
    I dont think we need to do any changes in Exchange Profile for proxy communication.
    Changing the RFC Destinations (in your R/3 system)- LCRSAPRFC & SAPSLDAPI should solve your problem.
    II) For Link :4147406?
    Q) Hi All,
    We have an ABAP Proxy implemented for posting goods movement and it is calling BAPI function module to post good movement. We have got a requirement that if BAPI returns any error, this error message send back to SAP XI.
    data call proxy
    Legacy -
    > XI -
    > SAP R/3(call bapi)
    <----
    error message
    Please let me know how to send the message back to XI.
    Answers: 1) Refer the following
    /people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy - ABAP Proxy to File
    /people/prateek.shah/blog/2005/06/14/file-to-r3-via-abap-proxy - File to ABAP Proxy
    2) you can utilize the fault messages for such an usage -
    Ref:
    Fault messages -
    /people/shabarish.vijayakumar/blog/2006/11/02/fault-message-types--a-demo-part-1
    Handling Web Service SOAP Fault Responses in SAP NetWeaver XI -
    /people/jin.shin/blog/2007/05/21/handling-web-service-soap-fault-responses-in-sap-netweaver-xi
    3) You have to do Fault message implementation in this case...
    A no. of exception will be there.For any error proxy will catch the exception and will write it in the fault message...so....from r/3 response will go to Xi as Fault message response in case any error/exception occours......
    have look here...
    Fault message implementation.
    /people/shabarish.vijayakumar/blog/2006/11/02/fault-message-types--a-demo-part-1
    4) Please go through it is very useful.
    /people/krishna.moorthyp/blog/2005/12/23/monitoring-for-processed-xml-messages-in-abap-proxy --Monitoring for Processed XML messages in ABAP Proxy
    /people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy --ABAP Proxies in XI(Client Proxy)
    /people/sap.user72/blog/2005/12/29/service-enable-your-sap-application-component --- Service Enable Your SAP Application Component
    5) the file adapter can work only asynchronous, so you cant have a response. You should build two asynchronous messages. File -> proxy inbound and after the bapi call an outbound proxy is called which is sending a second messge to the file adapter.
    6) you can define a synchronous scenario which will include request/response messages.
    send the response back to XI.
    the file adapter supports BE QoS.
    http://help.sap.com/saphelp_nw04s/helpdata/en/0d/5ab43b274a960de10000000a114084/frameset.htm
    7)I have an interface Z_stock_move(message interface(inbound)) and class z_STOCK_MOVE in that. I have clicked exception tab but not able to add exception there as its not enabled for change.
    Please let me know how to add the exception to an existing abap proxy.so that i can raise an exception when bapi call to goods movenment returns errors.
    Might be useful to U.

  • ABAP Proxy Exception / Fault Message

    Hi All,
    I have got a requirement to raise an exception from existing ABAP Proxy   depending on condition. XI consultant created  a fault messge type and attached to the inbound interface message type. I have regenerated the ABAP proxy but I cant find any thing in excpetion tab to raise exception.
    Please let me know the solution for this.
    reward points are available.
    -Venkat

    Hi Venkat,
    The following link will guide you ..
    http://help.sap.com/saphelp_nw04s/helpdata/en/c9/7a1041ebf0f06fe10000000a1550b0/frameset.htm
    I dont think we need to do any changes in Exchange Profile for proxy communication.
    Changing the RFC Destinations (in your R/3 system)- LCRSAPRFC & SAPSLDAPI should solve your problem.
    Regards,
    Sumit

  • Client ABAP proxy error handling. Please help!

    Hi Experts,
       I have following scenario:
       SAP ECC (ABAP Client Proxy) -> PI(XI)-->(SOAP) Third party web service System
       This is Asynchronous.
       What will happen when ABAP client Proxy in ECC sends data to PI but PI is down?
       Will the message be queued in ECC? Can the queued message be processed automatically when PI is UP later?
       Please help.
    Thanks & Regards
    Gopal

    Hello Gopal,
    Correct, it should be an automatic entry into the queue!
    refer below for a detailed understanding!
    /people/arulraja.ma/blog/2006/08/18/xi-reliable-messaging-150-eoio-in-abap-proxies     XI: Reliable Messaging u2013 EOIO in ABAP Proxies
    /people/krishna.moorthyp/blog/2005/12/23/monitoring-for-processed-xml-messages-in-abap-proxy     Monitoring for Processed XML messages in ABAP Proxy
    Weblog to send Response from RFC to File in Asyn Mode Using Proxy [original link is broken]     Weblog to send Response from RFC to File in Asyn Mode Using Proxy
    /people/michal.krawczyk2/blog/2009/06/20/pixi-abap-proxies-say-goodbye-to-executeasynchronous-method     PI/XI: ABAP Proxies say goodbye to Execute_Asynchronous method
    /people/krishnakumar.ramamoorthy3/blog/2008/11/02/error-handling-framework-for-abap-proxies--part-1     Error handling framework for ABAP proxies - Part 1
    /people/krishnakumar.ramamoorthy3/blog/2008/12/19/error-handling-framework-for-abap-proxies--part-2     Error handling framework for ABAP proxies - Part 2
    Regards,
    Jilan

  • ABAP Object Exception handling

    Hi all,
    I would very much like some links to learn how to create Exception objects, and how to use them in my ABAP Object apps.
    Thanks in advance!

    hi,
    Object Services classes work exclusively with Class-Based Exceptions. The exception classes are predefined in the system. They always start with CX_OS_.
    Exceptions of the CX_DYNAMIC_CHECK category are passed to the caller using the RAISING clauses of interface methods; class-specific methods of the class actor; attribute access methods of persistent classes; in the transaction object; and the system actors. Such exceptions must be handled here by the user, (in contrast to the general rule that exceptions should be handled within a procedure, not passed along the hierarchy). Thus semantically, the above exceptions of the CX_DYNAMIC_CHECK category belong more to the CX_STATIC_CHECK category. However, they could not be defined as such, due to their incompatibility with existing Object Services applications.
    Check out the link.
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/66/bc7aec43c211d182b30000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/fb/35c62bc12711d4b2e80050dadfb92b/content.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/17/f9f44295bae2499e8c56ca4f5106fb/frameset.htm
    Regards,
    Richa.

  • Scenario SOAP - PI - PROXY - Exception handling

    Hi all,
    I have the following scenario:
    Scenario SOAP(.NET)  <-> PI <-> PROXY
    When I raise an exception at the proxy side, PI will be informed with an exception text that an exception has occured.
    In the .NET receiver I only get an application exception (but not the real exception) - no exception text
    How can I get the exception text at .NET side?
    There is a datatype of type "XXXXException".
    But I can't use this class in the catch block because it is not inherited from class exception.
    regards

    Hi,
    thanks for your answer.
    But how to handle the exception in my C# client:
    I have created the .NET classes out of the WSDL
    There is a class ZQM_SVC_QMEL_GETException generated, but I don't know how to use it.
    try
                res.ES_SVC_QMEL = client.MI_OSRBG_QM_MASTERDATA_AUDIT_QMEL_GET_SYNC_OUT("123");
            catch (ZQM_SVC_QMEL_GETException  ex1)
    This coding is not working because the class ZQM_SVC_QMEL_GETException is not inherited from the class exception.
    This class has an attribute Nodes and several methods getSchema, ReadXML, WriteXML.
    But I don't know how to use it.
    Any idea?
    regards

  • ABAP: Smartform exception handling

    Dear Abap Experts ,
    How can I handle exception  while calling the smartform and when incorrect parameters are sent to the smartfom.
    I have used following code but problem not resolved.
                 EXCEPTIONS
               formatting_error     = 1
               internal_error       = 2
               send_error           = 3
               user_canceled        = 4
               OTHERS               = 5.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Thanks,
    Aneel

    Hi Aneel.
    After each generated FM call, make sure you get the errors as well whenever there is any exception. Call FM SSF_READ_ERRORS to retrieve the error message. Pass these message back to the NAST protocol if the SmartForm is being called from the Output control.
    Check the below code.Hope this will help you.
    CALL FUNCTION lf_fm_name
         EXPORTING
                    archive_index        = toa_dara
                    archive_parameters   = arc_params
                    control_parameters   = ls_control_param
                    mail_recipient       = ls_recipient
                    mail_sender          = ls_sender
                    output_options       = ls_composer_param
                    user_settings        = SPACE
         IMPORTING  job_output_info      = ls_job_info
         EXCEPTIONS formatting_error     = 1
                    internal_error       = 2
                    send_error           = 3
                    user_canceled        = 4
                    OTHERS               = 5.
    IF sy-subrc <> 0.
      DATA: LT_ERRORTAB             TYPE TSFERROR.
      FIELD-SYMBOLS: <FS_ERRORTAB>  TYPE LINE OF TSFERROR.
    * get smart form protocoll
      CALL FUNCTION 'SSF_READ_ERRORS'
        IMPORTING
          ERRORTAB = LT_ERRORTAB.
    * add smartform protocoll to nast protocoll
      LOOP AT LT_ERRORTAB ASSIGNING <FS_ERRORTAB>.
        CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
             EXPORTING
                  MSG_ARBGB = <FS_ERRORTAB>-MSGID
                  MSG_NR    = <FS_ERRORTAB>-MSGNO
                  MSG_TY    = <FS_ERRORTAB>-MSGTY
                  MSG_V1    = <FS_ERRORTAB>-MSGV1
                  MSG_V2    = <FS_ERRORTAB>-MSGV2
                  MSG_V3    = <FS_ERRORTAB>-MSGV3
                  MSG_V4    = <FS_ERRORTAB>-MSGV4
             EXCEPTIONS
                  OTHERS    = 1.
      ENDLOOP.
    ELSE.
    ENDIF.
    Thanks
    KH

  • Error Handling in Inbound ABAP Proxy with EOIO

    Hi,
    The scenario
    I have a File to ABAP Proxy scenario and since the requirement is that the messages have to be processed in a single queue in the SAP system (i.e. EOIO), the sender file channel was configured to be EOIO. This ensures that all messages that enters the SAP system are put in a single queue and then processed one after the other.
    The Issue
    Now if one of the messages that enter SAP system fails during the processing in the ABAP program, the queue gets stuck and all messages after that go into a scheduled state. And one has to manually clear the errored message in order to continue processing the other waiting messages.
    The Question
    I know this is a default behavior in an EOIO scenario, however is there any way in which if a message fails in the ABAP program then one can automatically push it out of the queue and keep processing the other messages after it ?
    Thanks
    Bharath

    As a general rule I only use EOIO when there is a possibility of dependancy between messages (message 1 must be first and finsihed before message 2 starts). Assuming your just moving the errored message asside, I would assume that EOIO should be just EO.
    Alternatively, change the ABAP proxy to handle the error and return a clean status. Exception handling (try/catch) should be used were ever dangerous code is being used.
    If alerting in the proxy end point is to much trouble - change your proxy to a sync scenario return the error to PI and fire alerts from there <- I think this should be avoided but it will work.
    The main point is the exception handling so that the proxy fails "gracefully".

  • Exception handling in outbound ABAP proxy

    Hi All,
    i need to catch exception in outbound abap proxy in two cases:
    1. if RFC dest in R3 which is pinging to XI goes down.
    2. IF xi server is down.
    in both the cases i need to catch the exceptions.
    now i written the code in this way:
    DATA: v_exceptions TYPE REF TO cx_ai_system_fault.
    TRY.
    CALL METHOD zirco_o_msg_if_as_req_details=>execute_asynchronous
    EXPORTING
    output = s_reference.
    COMMIT WORK.
    CATCH cx_ai_system_fault INTO v_exceptions.
    WRITE: 'Exception CX_AI_SYSTEM_FAULT caught'.
    WRITE: / v_exceptions->errortext.
    WRITE: / v_exceptions->code.
    but this code is not working.
    can anybody tell me how can i acheive this?

    Hi All,
    I need to log the error when receiver syatem is down.
    Its like this:
    Outbound proxy >>>XI>>>File adapter..
    Now if xi goes down....means message is succussefully sent from ISD and get stuck in XI then i need to catch this exception in ISD.
    Is it possible?? if yes then how??
    Kunaal

  • How to handle exceptions in sender ABAP Proxy

    Hi Experts,
       I have a synchronous scenario.
       SAP R/3 System A -ABAP Proxy <-> PI <-----> SOAP< ---> Webservice
       In system 'A', a function module calls the ABAP Proxy method.
       My requirement is that if there is an exception in PI ( for example: timeout or ABAP engine error) then I want to get the exception details in the calling function module.
    For example:
    Exception in PI:
      <SAP:Error xmlns:SAP="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.engine.interfaces.messaging.api.exception.MessagingException: java.net.ConnectException: Connection timed out: connect</SAP:AdditionalText>
    <SAP:ApplicationFaultMessage namespace=""/>
    <SAP:Stack/>
    <SAP:Retry>M</SAP:Retry>
    </SAP:Error>
    In the calling function module:
    Try
    Call to proxy-> method
    Catch cx_ai_system_fault INTO v_o_fault.
           v_err_msg1 = v_o_fault->GET_TEXT( ).
           v_err_msg2 = v_o_fault->errortext.
           v_err_msg3 = v_o_fault->code.
    Endtry.
    Here I get value "MESSAGE.GENERAL" for  v_err_msg1 and v_err_msg3. v_err_msg2 is blank.
    I want to capture the info available under <SAP:AdditionalText>. How to get that?
    Please help!
    Thanks & Regards
    Gopal

    >
    gopalkrishna baliga wrote:
    > Hi Experts,
    >
    >    I have a synchronous scenario.
    >
    >    SAP R/3 System A -ABAP Proxy <-> PI <-----> SOAP< ---> Webservice
    >
    >    In system 'A', a function module calls the ABAP Proxy method.
    >
    >    My requirement is that if there is an exception in PI ( for example: timeout or ABAP engine error) then I want to get the exception details in the calling function module.
    >
    >  For example:
    >
    > Exception in PI:
    >
    >   <SAP:Error xmlns:SAP="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.engine.interfaces.messaging.api.exception.MessagingException: java.net.ConnectException: Connection timed out: connect</SAP:AdditionalText>
    > <SAP:ApplicationFaultMessage namespace=""/>
    > <SAP:Stack/>
    > <SAP:Retry>M</SAP:Retry>
    > </SAP:Error>
    >
    > In the calling function module:
    > Try
    >  Call to proxy-> method
    >
    >  Catch cx_ai_system_fault INTO v_o_fault.
    >        v_err_msg1 = v_o_fault->GET_TEXT( ).
    >        v_err_msg2 = v_o_fault->errortext.
    >        v_err_msg3 = v_o_fault->code.
    > Endtry.
    >
    > Here I get value "MESSAGE.GENERAL" for  v_err_msg1 and v_err_msg3. v_err_msg2 is blank.
    >
    > I want to capture the info available under <SAP:AdditionalText>. How to get that?
    >
    > Please help!
    >
    > Thanks & Regards
    > Gopal
    Hi Gopal,
    Maybe the exception is CX_SY_APPLICATION_FAULT, or you can catch by BPM in PI and send back to proxy like a message response.

  • Exception handling in client proxy

    Hi
    Can someone please help me with exception handling in ABAP client proxy.

    HI
      Welcome to SDN
    Check this link you wil get information regarding ABAP Proxy  http://help.sap.com/saphelp_nw04/helpdata/en/c9/74246d8ad2447799063d39013e9a11/content.htm

  • Error handling in abap proxy

    Hi,
    In my scenario, I have written code in the execute_synchronous method of the abap proxy in ECC. I want to capture all possible errors that might occur here and for all of them i want to capture the message id and the text and send it out. what kind of possible errors/exceptions can occur and how to handle them. My proxy class simply selects data from multiple tables in ECC and returns the same.
    thks

    Hi,
    for outbound proxies the error handling should be done within R3 itself and there is no need to send errors to XI or receiving system for that matter. You would want someone from R3 side to take a note of it.
    For Inbound proxies, you will have to implement the Fault messages
    Fault message types are designed for application-specific errors that occur on the inbound side and that are reported back to the sender or persisted in monitoring.
    ·        In the synchronous case, when an application-specific error occurs on the inbound side, instead of sending a response message back to the sender, the application can send a fault message to handle the error.
    ·        The fault message of the application for an asynchronous ABAP server proxy is persisted for monitoring. In the case asynchronous of Java server proxies, the fault message is part of a negative application acknowledgement (see Acknowledgments).
    Application-specific means that the application on the inbound side triggers the error itself because, for example, the request message did not contain sufficient information.
    For more information on the same.
    http://help.sap.com/saphelp_nw04s/helpdata/en/dd/b7623c6369f454e10000000a114084/frameset.htm
    In your case, since you said that you are selecting data from some tables, the possibility is that an entry is not found in the DB tables you will have to simply populate the fault message data and raise an expection CX_FM. It also depends on what error handling requirements from the Business .
    regards,
    Advait.

  • Sender Abap Proxy -- Receiver JDBC , catch communication channel exceptions

    Hi All,
    I have a sender abap proxy and a receiver jdbc asynchronous interface.
    Now under some circumstances when I send some junk data for an update query(which satisfies metadata requirement but wrong primary key) it shows chequered flag in both XI and r/3.
    But in communication channel it shows error.
    Queries:
    1. How do I handle this.
    2. Since this is triggered from Abap wht will be subrc when method ends in this particular case.
    3. Is there any possibility of program goin into dump?
    Regards,
    Prem

    You can catch the exception in cx_ai_system_fault.
    http://help.sap.com/saphelp_nw70/helpdata/en/75/a55c3cff8ca92be10000000a114084/content.htm
    DATA:
    lo_mes TYPE REF TO
         [Client proxy class],
    l_sys_exc TYPE REF TO
            cx_ai_system_fault,
    l_app_exc TYPE REF TO
            cx_ai_application_fault.
    CREATE OBJECT lo_mes.
    TRY.
    CALL METHOD
      lo_mes->EXECUTE_SYNCHRONOUS
        EXPORTING
          OUTPUT    = ls_request
        IMPORTING
          INPUT     = ls_response.
    CATCH cx_ai_system_fault
                INTO l_sys_exc.
    * handle system error
        EXIT.
    CATCH cx_fault_1
                INTO l_app_exc.
    * handle application error 1
    CATCH cx_fault_n
                INTO l_app_exc.
    * handle application error n
    CATCH cx_ai_application_fault
                INTO l_app_exc.
    * handle other
    * application errors
    ENDTRY.
    Thanks,
    Beena.

Maybe you are looking for