cancel
Showing results for 
Search instead for 
Did you mean: 

RFC Error Handling

Former Member
0 Kudos

I'm using Excel to upload some data into a custom transaction. My problem is that when there is an exceptlion in the RFC I can't seem to trap it. Basically I doing the following;

ReturnCode = objRFC.call

If not ReturnCode = "True" then

Message = objRFC.imports("E_MESSAGE_ERROR")

msgbox Message

End if

This doesn't work. Can someone please point me in the correct direction.

Thanks,

Bob

Accepted Solutions (0)

Answers (1)

Answers (1)

CountZero
Explorer
0 Kudos

Hi Bob,

Personally I would try debugging the RFC from within SAP. To do this go into your RFC in SE37 and go to your source code. Then go to the menu option Utilities -> Settings. In the box that comes up goto the ABAP editor tab. You should see some more tabs further down the screen and click on the debugging tab. Make sure External Debugging is ticked. Then when you set a break point in your code you will get the option of turning on external debugging. Run your Excel macro and when SAP gets called then a SAP session should start up. You can then debug your code to see where the error is and why it isn't being reported. It might be the case that it is leaving the RFC before it hits the error handler.

I hope this helps.

Nath