Question

I use RFC_READ_TABLE to output data to my software, but there are a lot of times that when RFC returns and exception, it doesn't return a description. For instance, searching for a table that doesn't exist or querying a great amount of columns. It always returns the same title RfcAbapException with no detail and no InnerException.

The SAP dll referenced in my project is version 2.0.

EDIT:

So the question is : Why doesn't return an exception detail ?

Was it helpful?

Solution 2

As far as I can tell there is no description included with an RfcAbapException. Instead a code is returned which can be decoded. Like this:

catch (RfcAbapException ex)
   {
   switch (ex.AbapException)
     {
   case (SAPProxy1.No_Function_Found):
      MessageBox.Show("abap call failed because no function found");
      break;
   case(SAPProxy1.Nothing_Specified):
      MessageBox.Show("abap call failed because nothing specified");
      break;
   default:
      MessageBox.Show("Some unknown abap error occurred (" 
                       +ex.AbapException.ToString()+")");
      break;
     } //switch
}

see original source.

OTHER TIPS

Please check whether there are short dumps (transaction ST22) in your system related to the exceptions. If there are any, this is more or less by design. As I have tried to explain in this answer (although not in detail), the short dump leaves the ABAP processor in an invalid state. It is either unable to return any message of any kind to the caller or it is unwise to return any data to the caller because it might be invalid or even a security problem. In this case, the call will simply fail with an unspecified error message. The proxy exception codes mentioned in the other answer by Hogan won't be of any help in this case as they are only generated for named exceptions of the RFC modules, not basic system or programming faults.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top