Exception handling in an RFC server

Hi,
   I've an RFC server coded in vb.net.  Am trying to capture the exceptions raised by the server in an ABAP program.  But it is giving a short dump.  Can any one tell me the reason for this? 
Regards,
Aravinda Sarma M.
The following is the code:
Try
            SqlHeaderConnection.Open()
            rsHeaderData = sqlCommand.ExecuteReader()
        Catch ex As RfcAbapException
            'excpError = New RfcAbapException("NOCONN", "Error in Query")
            Throw ex
        Finally
            rsHeaderData.Close()
            SqlHeaderConnection.Close()
        End Try

Neither SqlHeaderConnection.Open nor sqlCommand.ExecuteReader will throw RfcAbapExceptions, but some other .NET exceptions that cannot be understood by APAP. So you need to convert the .NET-exception to an ABAP-Exception:
Try
SqlHeaderConnection.Open()
rsHeaderData = sqlCommand.ExecuteReader()
Catch ex As Exception
Throw New RfcAbapException("NOCONN", "Error in Query")
Finally
rsHeaderData.Close()
SqlHeaderConnection.Close()
End Try

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.

  • 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

  • DOTNET RFC-Server: Throwing ABAP-exceptions

    Dear all,
    how do I throw ABAP-exceptions in a generated RFC-server?
    When I have an RFC-function module like the attached one in an SAP system and generate a server for this function module, how can I throw the ABAP-exception WRONG_UUID (for example in the C# code attached)?
    I haven't found an rfc-server example dealing with ABAP-exceptions.
    Best regards,
       Willy
    FUNCTION ZZZ.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(UUID) TYPE  SYSUUID_C DEFAULT SPACE
    *"  EXCEPTIONS
    *"      WRONG_UUID
        // Implementation of remote function module ZZZ
        protected override void Zzz (
               string Uuid)
          // TODO: add your server code here

    Hi Willy
    If I am not mistaken, it should be ...
    RfcAbapException ns = new RfcAbapException("WRONG_UUID", " Wrong user Id");
    throw ns;
    Not a C# guru but it should be something like that.

  • How to display the 500-internal server error on the Exception Handler page

    Hello
    My situation is as follows : JDev 11.1.1.0.2, ADF fusion application, one unbounded task flow containing 2 view pages view1.jspx and error.jspx
    The error jspx is marked as the exception handler.
    When an error occurs (typically a 500-Internal Server Error) the error.jspx is correctly displayed and shows our message such as 'Don't panic, please call our tech support'
    What I would like to do is to display the actual error stack on this page along with our message.
    I've searched around and I can't find how to either get the error stack in a bean or what EL expression should be used to get the error stack.
    Can anybody help ?
    Best Regards
    Paul
    Switzerland

    The error will be the same, but the stack trace will be different, such as
    Error 500--Internal Server Error
    oracle.adf.controller.security.AuthorizationException: ADFC-0619: Echec de la vérification des autorisations : '/view1.jspx' 'VIEW'.
         at oracle.adf.controller.internal.security.AuthorizationEnforcer.handleFailure(AuthorizationEnforcer.java:145)
         at oracle.adf.controller.internal.security.AuthorizationEnforcer.checkPermission(AuthorizationEnforcer.java:124)
         at oracle.adfinternal.controller.state.ControllerState.initializeUrl(ControllerState.java:639)
         at oracle.adfinternal.controller.state.ControllerState.synchronizeStatePart2(ControllerState.java:449)
         at oracle.adfinternal.controller.application.SyncNavigationStateListener.afterPhase(SyncNavigationStateListener.java:44)
         at oracle.adfinternal.controller.lifecycle.ADFLifecycleImpl$PagePhaseListenerWrapper.afterPhase(ADFLifecycleImpl.java:529)
         at oracle.adfinternal.controller.lifecycle.LifecycleImpl.internalDispatchAfterEvent(LifecycleImpl.java:118)
         at oracle.adfinternal.controller.lifecycle.LifecycleImpl.dispatchAfterPagePhaseEvent(LifecycleImpl.java:166)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$PhaseInvokerImpl.dispatchAfterPagePhaseEvent
    What I would like is to display the above stack trace on the page marked as the exception handler....
    Regards
    Paul

  • 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

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

  • Exception Handling in Client/Server Application

    Hi All,
    My application is a Server application that receives socket connections from a client which pass an image file, the server saves the file in a specified directory..
    Some errors may appear during writing the file by the server, Socket or IO Exception may occurr( i.e. the network connection cut, no space on the disk....)
    i noticed that the server terminates when an exception occurs. I catch this exception and handls it just by printing the exception message to the command line.
    So when it occurs server prints the exception message then the application terminates.
    I want to handle the exception in a way the server doesn�t terminate and also can receives more connections?
    Note: i tried the case in wich there is no enough memory space so the server will copy the passed image file on the drive a.(floppy disk)
    Here are my Server, Client source code ...
    Server.java
    import java.io.*;
    import java.net.*;
    import java.awt.*;
    import javax.swing.*;
    class Server{
    public static void main(String[] args){
    try{
    System.out.println("Server Started.........");
    ServerSocket ss = new ServerSocket(9999);
    while(true){
    Socket s = ss.accept();
    System.out.println("Socket from : "+s.getInetAddress().getHostName()+ " "+s.getInetAddress().getHostAddress());
    BufferedInputStream bis = new BufferedInputStream(s.getInputStream());
    FileOutputStream fis = new FileOutputStream("a:/abc1.bmp");
    BufferedOutputStream bos = new BufferedOutputStream(fis);
    int c;
    c = bis.read();
    while( c != -1){
    bos.write(c);
    c = bis.read();
    bos.flush();
    bos.close();
    fis.close();
    bis.close();
    s.close();
    System.out.println("Complete");
    }catch(SocketException se){
    System.out.println("Socket Error : "+se.toString());
    catch(IOException ioe){
    System.out.println("IO Error : "+ioe.toString());
    Client.java
    import java.io.*;
    import java.net.*;
    import java.awt.*;
    public class Client{
    public static void main(String[] args){
    try{
    FileInputStream fis = new FileInputStream("abc.bmp");
    BufferedInputStream bis = new BufferedInputStream(fis);
    int available = bis.available();
    byte[] b = new byte[available];
    int read = bis.read(b,0,available);
    bis.close();
    fis.close();
    Socket s = new Socket("localhost",9999);
    BufferedOutputStream bos = new BufferedOutputStream(s.getOutputStream());
    bos.write(b,0,available);
    bos.flush();
    bos.close();
    s.close();
    catch(Exception e){
    System.out.println(e);
    System.out.println("Complete");
    thanx in advance.
    shelal

    Get the try catch block inside the while loop. In that case, even if an exception occurs, it is going to continue in the while loop.
    Server.java
    import java.io.*;
    import java.net.*;
    import java.awt.*;
    import javax.swing.*;
    class Server{
    public static void main(String[] args){
    try{
    System.out.println("Server Started.........");
    ServerSocket ss = new ServerSocket(9999);
    catch(Exception e)
    System.out.println("Server socket creation failed");
    // you may wish to exit here.
    while(true){
    try
    Socket s = ss.accept();
    System.out.println("Socket from : "+s.getInetAddress().getHostName()+ " "+s.getInetAddress().getHostAddress());
    BufferedInputStream bis = new BufferedInputStream(s.getInputStream());
    FileOutputStream fis = new FileOutputStream("a:/abc1.bmp");
    BufferedOutputStream bos = new BufferedOutputStream(fis);
    int c;
    c = bis.read();
    while( c != -1){
    bos.write(c);
    c = bis.read();
    bos.flush();
    bos.close();
    fis.close();
    bis.close();
    s.close();
    System.out.println("Complete");
    }catch(SocketException se){
    System.out.println("Socket Error : "+se.toString());
    catch(IOException ioe){
    System.out.println("IO Error : "+ioe.toString());
    }

  • Sync Send without a Exception Handler ??

    hi..
    Can a synchronous send step work with out an exception handler..??
    im gettin my messages and combinin then n sendin via the sync send to call rfc , followeed by a send back to my server..
    at this very stage it expects me to define a handler for the same for the sync send.
    regards,
    vishal

    hi bhavesh..
    im doin the same...
    Mode : Synch
    Request Message
    Response Message
    Receiver From : Send Context
    any reason fr it dmandin fr an exception handler../
    it tch details i see the error as "no handler defined for this system exception"..
    any inputs..

  • Exception handling is not working in GCC compile shared object

    Hello,
    I am facing very strange issue on Solaris x86_64 platform with C++ code compiled usging gcc.3.4.3.
    I have compiled shared object that load into web server process space while initialization. Whenever any exception generate in code base, it is not being caught by exception handler. Even though exception handlers are there. Same code is working fine since long time but on Solaris x86, Sparc arch, Linux platform
    With Dbx, I am getting following stack trace.
    Stack trace is
    dbx: internal error: reference through NULL pointer at line 973 in file symbol.cc
    [1] 0x11335(0x1, 0x1, 0x474e5543432b2b00, 0x59cb60, 0xfffffd7fffdff2b0, 0x11335), at 0x11335
    ---- hidden frames, use 'where -h' to see them all ----
    =>[4] __cxa_throw(obj = (nil), tinfo = (nil), dest = (nil), , line 75 in "eh_throw.cc"
    [5] OBWebGate_Authent(r = 0xfffffd7fff3fb300), line 86 in "apache.cpp"
    [6] ap_run_post_config(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0x444624
    [7] main(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0x42c39a
    I am using following link options.
    Compile option is
    /usr/sfw/bin/g++ -c -I/scratch/ashishas/view_storage/build/coreid1014/palantir/apache22/solaris-x86_64/include -m64 -fPIC -D_REENTRANT -Wall -g -o apache.o apache.cpp
    Link option is
    /usr/sfw/bin/g++ -shared -m64 -o apache.so apache.o -lsocket -lnsl -ldl -lpthread -lthread
    At line 86, we are just throwing simple exception which have catch handlers in place. Also we do have catch(...) handler as well.
    Surpursing things are..same issue didn't observe if we make it as executable.
    Issue only comes if this is shared object loaded on webserver. If this is plain shared object, opened by anyother exe, it works fine.
    Can someone help me out. This is completly blocking issue for us. Using Solaris Sun Studio compiler is no option as of now.

    shared object that load into web server process space
    ... same issue didn't observe if we make it as executable.When you "inject" your shared object into some other process a well-being of your exception handling depends on that other process.
    Mechanics of x64 stack traversing (unwind) performed when you throw the exception is quite complicated,
    particularly involving a "nearly-standartized" Unwind interface (say, Unwind_RaiseException).
    When we are talking about g++ on Solaris there are two implementations of unwind interface, one in libc and one in libgcc_s.so.
    When you g++-compile the executable you get it directly linked with libgcc_s.so and Unwind stuff resolves into libgccs.
    When g++-compiled shared object is loaded into non-g++-compiled executable's process _Unwind calls are most likely already resolved into Solaris libc.
    Thats why you might see the difference.
    Now, what exactly causes this difference can vary, I can only speculate.
    All that would not be a problem if _Unwind interface was completely standartized and properly implemented.
    However there are two issues currently:
    * gcc (libstdc++ in particular) happens to use additional non-standard _Unwind calls which are not present in Solaris libc
    naturally, implementation details of Unwind implementation in libc differs to that of libgccs, so when all the standard _Unwind
    routines are resolved into Solaris version and one non-standard _Unwind routine is resolved into gcc version you get a problem
    (most likely that is what happens with you)
    * libc Unwind sometimes is unable to decipher the code generated by gcc.
    However that is likely to happen with modern gcc (say, 4.4+) and not that likely with 3.4.3
    Btw, you can check your call frame to see where _Unwind calls come from:
    where -h -lIf you indeed stomped on "mixed _Unwind" problem then the only chance for you is to play with linker
    so it binds Unwind stuff from your library directly into libgccs.
    Not tried it myself though.
    regards,
    __Fedor.

  • DS XI3.2 SP1 - Problem when starting RFC server from management console

    Hi,
    We're using DataServices XI 3.2 SP1 FP1 on a windows 2008 server 64bits to load SAP BW. We have set up an external system in SAP BW called "DI_SOURCE" and then successfully created a RFC server interface (DI_SOURCE) within the management console.
    When we try to start this RFC server from the management console, we immediately get the following error message : "An internal error occurred in: server.start()::rfc_bad_connection".
    On the other hand, when we follow the "old method" (pre SP2) and start the RFC server from a command window, it works : we have "CONNECTION DI_SOURCE OK" in SAP BW.
    Any ideas how to solve this ?
    Thanks,
    Olivier

    Hi,
    We have tried your suggestions above.
    Instead of just crashing we now get an error from designer (before closing down). Seems as if our librfc32.dll has a problem.
    We have verified that the librfc32.dll from the Data Services package is the only one on the server.
    Problem signature:
      Problem Event Name:        BEX
      Application Name:        al_designer.exe
      Application Version:        12.2.2.0
      Application Timestamp:        4b99c5ef
      Fault Module Name:        LIBRFC32.DLL
      Fault Module Version:        7100.3.144.6097
      Fault Module Timestamp:        49bec8be
      Exception Offset:        000179a4
      Exception Code:        c0000409
      Exception Data:        00000000
      OS Version:        6.1.7600.2.0.0.272.7
      Locale ID:        1030
      Additional Information 1:        4b85
      Additional Information 2:        4b85a4b06dde50b4e092d24f447efca0
      Additional Information 3:        45fe
      Additional Information 4:        45feda9db76a48384005c14dafbddc29
    Read our privacy statement online:
      http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
    If the online privacy statement is not available, please read our privacy statement offline:
      C:\Windows\system32\en-US\erofflps.txt

  • Java Exception Handling

    Hello everyone,
    I'm searching for a design pattern / framework to manage exception handling. I'm currently working on a distributed document management system for PC / AS/400, which consists of Commandline clients, a Socket Server and a windows NT daemon in java, which accepts network requests from the Socket Server. Communication is done via serialized Objects.
    My Problem is, that exceptions can be thrown either on the server or on the client side and have to be transferred to the user. Error Messages should be read from the database. Exception handling should prefferably take place in a central piece of code, such as the two endpoints of network connections, the SocketServer as service under win32 and another SocketServer as Application on another box, currently with UNIX OS.
    thanks in advance for any answers
    regards

    You should look into Bridge [GOF:151] and Memento [GOF:273].
    Bridge allows you to decouple your mechanism from the implementation memento on how to propergate the decoupled exception information.

  • Integration Process exception handling & alerts, Java

    Hello,
    I would like to enhance my basic scenarios fool proof and with as much Java as possible.
    I have set up several asynchronous and synchronous File to SOAP transfers between systems A and B
    using PI70 including my own Java mapping classes and PI's AF_Modules beans. They work just fine.
    I have not designed my own Integration Processes yet, so execution is based on channel settings and availability timing.
    I have learned this aproach may be exposed to general faults resulting manual monitoring and repairing.
    For example server problems at receiver side can result data losses as sender channel just keeps removing source
    files like normally, as the process would be better to just stop right there and alert or something.
    My question is, is the "Enterprise services Builders" Integration Process & Graphical definition screen the one and only tool to 
    customize whole process exception handling and alerts in PI, and Java is not an option?
    Appreciate your advice on this.
    Kind regards m

    Hi m,
    Strange Name
    >>I have learned this aproach may be exposed to general faults resulting manual monitoring and repairing. For example server problems at receiver side can result data losses as sender channel just keeps removing source  files like normally, as the process would be better to just stop right there and alert or something.
    If you are looking to handle this particular scenario, then we have the alert mechanism and CCMS monitoring. There you will come to know whether the end system down or not.
    Also in addition to this you can write your own java (in message mapping, as modules, java mapping) /abap code (as abap mapping, user exit in standard functions etc) for providing more details in error scenarios. But you need to validate whether the maintenance/development cost for the code is justified in your scenarios
    Regards
    Suraj

Maybe you are looking for