Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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 ?

share|improve this question
Going to correct that. But the question is: Why doesn't return an exception detail ? – André Silva Jan 8 at 15:13
You have to show us the code. – Hogan Jan 8 at 15:18
How will I show you code if the exception is thrown inside the SAP dll.... – André Silva Jan 8 at 15:19
Seems either poor exception handling, or you are missing some bits in reading the exception. If it is poor exception handling, you need to ask Developers of API that is raising the exception – Tilak Jan 8 at 15:19
So any of you that, I think, already used the SAP dll had this problem ? Because is the generic dll that SAP sells that is throwing the exception. – André Silva Jan 8 at 15:22
show 2 more comments

2 Answers

up vote 1 down vote accepted

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.

share|improve this answer
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 8 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 8 at 16:02
@AndréSilva - yw, good luck! – Hogan Jan 8 at 16:02
@Hogan: yes, see stackoverflow.com/questions/7996919/… – vwegert Jan 8 at 16:05
@Hogan I could access with upper case nw and with lower case too... – André Silva Jan 8 at 16:06
show 2 more comments

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.