2006 May 18 1:15 PM
Hi,
I am making a synchronous RFC call passing a structure and expecting a return value like "No of records updated"
I am passing a structure to XI from R/3 using RFC call. Xi has to insert this structure in a legacy database table and return the number of records inserted.
It is working fine when everything is fine but when the legacy database is down it is giving me a short dump
"call to messaging system failed: com.sap.aii.af.ra.ms.api.DeliveryException:" How to handle this exception? Please send me some solution to this ASAP.
My code is given below
CALL FUNCTION 'RFC_SYSTEM_INFO' DESTINATION l_rfcdest
IMPORTING
rfcsi_export = l_rfcsi
rfc_login_complete =
dialog_user_type =
current_resources =
maximal_resources =
recommended_delay =
EXCEPTIONS
communication_failure = 1 MESSAGE l_msg
system_failure = 2 MESSAGE l_msg
OTHERS = 3.
IF sy-subrc EQ 0.
IF l_msg IS INITIAL.
CALL FUNCTION 'Z_SAP_TO_CADB' DESTINATION l_rfcdest
TABLES
pt_items = pt_items
CHANGING
return = return1.
Here i am checking for the RFC destination first, if RFC destination is fine then only i am making an RFC call to XI.
Pt_items is the structure i am passing to XI
return1 is where i am expecting the number of records inserted.
Thanks in advance
Rajesh.
2006 May 18 2:18 PM
Try adding the exception handling to the Z_SAP_TO_CADB function call. So the following should be your call:
CALL FUNCTION 'Z_SAP_TO_CADB' DESTINATION l_rfcdest
TABLES
pt_items = pt_items
CHANGING
return = return1
EXCEPTIONS
communication_failure = 1 MESSAGE l_msg
system_failure = 2 MESSAGE l_msg
OTHERS = 3.
If sy-subrc eq 0.
Your Logic.
else.
Exception handling.
endif.
Hope it helps.
Sunil Achyut
Hi,
I am making a synchronous RFC call passing a structure and expecting a return value like "No of records updated"
I am passing a structure to XI from R/3 using RFC call. Xi has to insert this structure in a legacy database table and return the number of records inserted.
It is working fine when everything is fine but when the legacy database is down it is giving me a short dump
"call to messaging system failed: com.sap.aii.af.ra.ms.api.DeliveryException:" How to handle this exception? Please send me some solution to this ASAP.
My code is given below
CALL FUNCTION 'RFC_SYSTEM_INFO' DESTINATION l_rfcdest
IMPORTING
rfcsi_export = l_rfcsi
rfc_login_complete =
dialog_user_type =
current_resources =
maximal_resources =
recommended_delay =
EXCEPTIONS
communication_failure = 1 MESSAGE l_msg
system_failure = 2 MESSAGE l_msg
OTHERS = 3.
IF sy-subrc EQ 0.
IF l_msg IS INITIAL.
CALL FUNCTION 'Z_SAP_TO_CADB' DESTINATION l_rfcdest
TABLES
pt_items = pt_items
CHANGING
return = return1.
Here i am checking for the RFC destination first, if RFC destination is fine then only i am making an RFC call to XI.
Pt_items is the structure i am passing to XI
return1 is where i am expecting the number of records inserted.
Thanks in advance
Rajesh.
2006 May 18 2:18 PM
Try adding the exception handling to the Z_SAP_TO_CADB function call. So the following should be your call:
CALL FUNCTION 'Z_SAP_TO_CADB' DESTINATION l_rfcdest
TABLES
pt_items = pt_items
CHANGING
return = return1
EXCEPTIONS
communication_failure = 1 MESSAGE l_msg
system_failure = 2 MESSAGE l_msg
OTHERS = 3.
If sy-subrc eq 0.
Your Logic.
else.
Exception handling.
endif.
Hope it helps.
Sunil Achyut
2006 May 22 3:21 PM
Sunil,
Thanks for your inputs, Your solution works and solved my problem. Also i rewarded points.
2006 May 18 3:35 PM
Hi ,
Try using the below FM to check the destination and if its successful then cal FM 'Z_SAP_TO_CADB' .
Check RFC Destination++
CALL FUNCTION 'RFC_VERIFY_DESTINATION'
EXPORTING
destination = ws_dest
AUTOUPDATE = ' '
TIMEOUT = 60
IMPORTING
RFCSI_EXPORT =
RFC_LOGIN_COMPLETE =
DIALOG_USER_TYPE =
CURRENT_RESOURCES =
MAXIMAL_RESOURCES =
RECOMMENDED_DELAY =
CHARSIZE =
UPDATED =
EXCEPTIONS
internal_failure = 1
timeout = 2
dest_communication_failure = 3
dest_system_failure = 4
update_failure = 5
no_update_authority = 6
OTHERS = 7.
Regards,
Sreejesh .
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |