on 09-26-2007 5:30 PM
Originally I posted this in the Scripting forum, but there were no replies. Hopefully this is the correct forum for such a question.
I'm using Excel to upload a file to a "Z" transaction. My problem is there were errors in the RFC and I couldn't trap them. Found and fixed the problem, however, I still want to include exception handling should something else to wrong.
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
Hi Bob,
Try out -
On Error GoTo Err_handler
'your code goes here
'..............................
'..............................
Err_handler:
msgbox "......"
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bob,
Can you please explain it in little detail ?
Are you talking about handling exception/error inside RFC?
As a general practise you can populate structre BAPIRET2 with Id and Message in RFC and can retrurn to the client application.
In the client application you can first check whether this table is empty and then only proceed with the execution.
Regards.
Hi again Jitesh,
I'm not an ABAPer, and do the .net side of things. Here is what I have in Excel now;
Set objRFC = objLogon.Add("ZRFC_CALL_TRANSACTION_USING")
'/Set the export parameters:
objRFC.exports("PATH") = DTAddress & "TAPSHEET.CSV"
retCode = objRFC.call '/get return code
'/If the return code is not True, then display a message
If Not retCode Then
'Message = objRFC.imports("E_MESSAGE_ERROR")
Message = "Error Encountered"
MsgBox Message & vbCr & "Please notify BIS", vbCritical, "RFC ERROR"
End If
We are uploading the .csv file to a "Z" transaction. It all works just fine now. However we encountered some problems while developing which occured in the RFC. So now I'm trying to provide some response to the user should a exception/error happen inside the RFC in the future.
Thanks for your help
Bob
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.