Skip to Content
author's profile photo Former Member
Former Member

Different exception behaviour between NCo and SAP SE37 ?

Hello,

I've got a problem concerning exceptions calling RFC.

My C# code is s.t. like

try
{
  _sapProxy.RfcFuction(param1, pram2,ref this.SapTable1, ref this.SapTable2)
}
catch(SAP.Connector.RfcEx rfcEx)
{
  // Log error messages
}
catch(Exception ex)
{
  // Log other exceptions
}
finally
{
  // clean up (close open connections etc.)
}

The (generated) proxy code is s.t. like

  results[] = null;
  results = this.SAPInvoke("RfcFuction", new object[] {I_param1, I_param2, T_Table1, T_Table2});
   retVal1 = {string}results[0];
   retVal2 = {string}results[1];
   retTab1 = {SAPTableStructure1}results[2];
   retTab2 = {SAPTableStructure2}results[4];

If an RFC exception occurs, the proxy jumps direct from this.SAPInvoce(...) into the catch-block without filling the returns[] object.

If I am calling "RfcFunction" directly from SAP "SE37" all return values/tables are filled, even if an error occurs.

Some additional words to the used RFC "RfcFunction". It collects all SAP messages (errors, warnings, etc.) into a table (type of BAPIRET2).

Any ideas, how to modify the generated proxy class to fill result[] ?

Best regards,

Gerhard Rausch

Message was edited by: Gerhard Rausch

Added some additional words about "RfcFunction"

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Nov 24, 2005 at 08:40 AM

    It might be true that there is a difference, but this shouldn't be a problem:

    - If you have a RfcException or ConnectionException, the result if most likely anyway unusable or does not even exist.

    - If you have an AbapException, you usually don't have a BAPIRET* paramter and vice versa: officical BAPIs don't throw AbapExcpetions. Non-BAPIs throw AbapExceptions, but don't have BAPIRET*.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello,

      I've found the "error" on my own.

      A college changed s.t. at the RFC (before going to holiday for the rest of the week ). Certenly without informing me 😔

      Regards

      Gerhard Rausch

      Message was edited by: Gerhard Rausch

      Message was edited by: Gerhard Rausch

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.