on 11-23-2005 4:10 PM
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"
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*.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.