cancel
Showing results for 
Search instead for 
Did you mean: 

Exception handling in an RFC server

Former Member
0 Kudos

Hi,

I've an RFC server coded in vb.net. Am trying to capture the exceptions raised by the server in an ABAP program. But it is giving a short dump. Can any one tell me the reason for this?

Regards,

Aravinda Sarma M.

The following is the code:

Try

SqlHeaderConnection.Open()

rsHeaderData = sqlCommand.ExecuteReader()

Catch ex As RfcAbapException

'excpError = New RfcAbapException("NOCONN", "Error in Query")

Throw ex

Finally

rsHeaderData.Close()

SqlHeaderConnection.Close()

End Try

Accepted Solutions (0)

Answers (1)

Answers (1)

reiner_hille-doering
Active Contributor
0 Kudos

Neither SqlHeaderConnection.Open nor sqlCommand.ExecuteReader will throw RfcAbapExceptions, but some other .NET exceptions that cannot be understood by APAP. So you need to convert the .NET-exception to an ABAP-Exception:

Try

SqlHeaderConnection.Open()

rsHeaderData = sqlCommand.ExecuteReader()

Catch ex As Exception

Throw New RfcAbapException("NOCONN", "Error in Query")

Finally

rsHeaderData.Close()

SqlHeaderConnection.Close()

End Try

Former Member
0 Kudos

Hi Reiner,

It still have the same problem. The ABAP program is giving a short dump.

Regards,

Aravinda Sarma M.

Message was edited by: Aravinda Sarma

Former Member
0 Kudos

Hi Reiner,

Thanks for the help. I've solved the problem.

Regards,

Aravinda Sarma M.