cancel
Showing results for 
Search instead for 
Did you mean: 

Different exception behaviour between NCo and SAP SE37 ?

Former Member
0 Kudos

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"

Accepted Solutions (1)

Accepted Solutions (1)

reiner_hille-doering
Active Contributor
0 Kudos

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*.

Former Member
0 Kudos

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

Answers (0)