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

RFC_ERROR_SYSTEM_FAILURE

Santosh21N
Explorer
4,030

Dear Experts,

I am using FM "L_TO_CREATE_MULTIPLE" to create TO in my custom FM, i have enabled all the exceptions and using below code to catch all the errors.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno INTO lv_msg
WITH sy-msgv1.
return-type = sy-msgty.
return-id = sy-msgid.
return-number = sy-msgno.
return-message = lv_msg.

But for some of the invalid inputs are not getting captured in this message, instead it goes out of FM and comes on status bar, attached screen shot.

In PI system getting the message as below, i want handle this in my FM and send the structure to PI system.

<rfc:ZWM_BL_TO_CREATE.Exception xmlns:rfc="urn:sap-com:document:sap:rfc:functions"> <Name>RFC_ERROR_SYSTEM_FAILURE</Name>
<Text> Storage bin EWGSSAY in storage type ASY does not exist (check your e</Text>
</rfc:ZWM_BL_TO_CREATE.Exception>

Please let me know how to handle this?

to-error.jpg

10 REPLIES 10
Read only

FredericGirod
Active Contributor
3,375

As it is an RFC, you just have to call it for RFC destination none, the message will not be displayed.

CALL FUNCTION 'L_TO_CREATE_MULTIPLE'
  DESTINATION 'NONE'...
Read only

0 Likes
3,375

Excellent.. Its working. thanks a lot..

Read only

0 Likes
3,375

Hi Frederic,

Actually when this FM called from PI system same error is thrown,it works internally and in debugging mode. Kindly advise.

Regards

Santosh

Read only

0 Likes
3,375

Sorry Idon't understand, what is the problem from PI ?

Read only

0 Likes
3,375

When call is made from PI system to my FM its throwing error.

<rfc:Z_BL_TO_CREATE.Exception xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
<Name>RFC_ERROR_SYSTEM_FAILURE</Name>
<Text>Message type is unknown.</Text>
</rfc:Z_BL_TO_CREATE.Exception>

Read only

0 Likes
3,375

BEST ANSWER:

use the below exception which will handle everything

error_messge = 1.

Read only

0 Likes
3,375

Not agree, you will avoid having exception, but you will not catch the message.

But for some of the invalid inputs are not getting captured in this message, instead it goes out of FM and comes on status bar, attached screen shot.
Read only

0 Likes
3,375

Santosh N Please post a separate answer, it's not related to what Frederic proposed.

It's not very precise to say that using ERROR_MESSAGE "handles everything". It's more exact to say that it solves your question better than calling L_TO_CREATE_MULTIPLE in sRFC (destination 'NONE' + handling the exception SYSTEM_FAILURE). The special ERROR_MESSAGE exception is explained in the ABAP documentation.

Frederic Girod you say "not catch the message", but I don't understand what you mean. ERROR_MESSAGE is a special exception which really makes the kernel catch the error message and terminates the function module.

Read only

0 Likes
3,375

sandra.rossi, SAP display the message, but you are not able to manage this message. For example if you want to make specific action, if you want to use the message in a log ...

I have exactly this case with RF screen, and I need to focus on the field that generate the error, if I let SAP display the error, I could not do it. So I used the dummy RFC, SAP does not display the error message, but returns the value (SYST). So you could display it as you want.

Read only

0 Likes
3,375

What Santosh did, and that works for him:

CALL FUNCTION 'L_TO_CREATE_MULTIPLE'
  ...
  EXCEPTIONS
    error_message = 1
    ...

No need of using sRFC 'NONE' in his case.

You say that "SAP display the message". NO if you use the special exception ERROR_MESSAGE, any MESSAGE ... TYPE 'E' (without RAISING) executed inside the function module and its nested procedures will be implicitly interpreted like MESSAGE ... TYPE 'E' RAISING error_message. The ABAP documentation says about ERROR_MESSAGE:

Messages of the type E and A raise the exception error_message and set sy-subrc to n_error. 
The message class, message type, message number, and the contents of possible placeholders for the 
MESSAGE statement are in the fields sy-msgid, sy-msgno, sy-msgty, and sy-msgv1, ... sy-msgv4. 
In the case of messages of type A, the statement ROLLBACK WORK is also executed explicitly.