1

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 ?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
André Silva
  • 1,149
  • 9
  • 30

2 Answers2

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.

vwegert
  • 18,371
  • 3
  • 37
  • 55
Hogan
  • 69,564
  • 10
  • 76
  • 117
  • For all that is good. There is no freaking documentation in the whole company that says anything about this. Thanks, that is going to save my life. That really helped. Thanks. – André Silva Jan 08 '13 at 15:58
  • @vwegert - Is it really the case that your browser did something different when `nw` was in upper case in the link?? My mind is blown. – Hogan Jan 08 '13 at 16:02
  • @Hogan: yes, see http://stackoverflow.com/questions/7996919/should-url-be-case-sensitive – vwegert Jan 08 '13 at 16:05
  • I still have two problems, `RfcAbapException.AbapException` returns an empty string and I have no idea where SAPProxy1 comes from. The second problem I can search and try to solve it. The first one I still have on idea. – André Silva Jan 08 '13 at 16:13
  • @vwegert - Of course I know this, my point is this: The case does not matter to the browser, it matters to the server (in this case help.sap.com). Since this server does not care about letter case (at least when I query it) I was shocked and dismayed that you experienced problems. My best guess for cause is that you are **experiencing a man in the middle attack** and you are not actually using the server at help.sap.com. – Hogan Jan 08 '13 at 16:46
2

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.

Community
  • 1
  • 1
vwegert
  • 18,371
  • 3
  • 37
  • 55