Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to catch system exception

venkat_raman
Associate
Associate
0 Likes
558

Hi Expert,

I am calling an FM BAPI_USER_EXISTENCE_CHECK and it throws an exception for specific users. But it was not thrown as

exception parameter in the FM, but system exception occurs.

How can I catch that exception. What can be the exception name which will catch all kinds of exception.

Basically I am getting the exception like "not allowed to login as a trusted system". I am calling that RFC with trusted RFC connection.

Thanks and regards,

Venkat.

2 REPLIES 2
Read only

Former Member
0 Likes
477

Hi Venkat,

I had the same issue for a RFC Function. I resolved it as follows:


   DATA:  msg_text(120).

  CALL FUNCTION 'FM_XXXXXXX'
    DESTINATION l_rfcdest
    TABLES
      .............................
    EXCEPTIONS
      communication_failure = 1  MESSAGE msg_text
      system_failure       = 2   MESSAGE msg_text.

Regards,

Filippo

Read only

RaymondGiuseppi
Active Contributor
0 Likes
477

When executing a FM using the RFC interface there are specific system exceptions to manage , check SAP documentation via F1 or at [CALL FUNCTION - DESTINATION parameter_list|http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_DESTINATION_PARA.htm]

    [EXCEPTIONS [exc1 = n1 exc2 = n2 ...]
                [system_failure = ns [MESSAGE smess]]
                [communication_failure = nc [MESSAGE cmess]]
                [OTHERS = n_others]].

Regards,

Raymond