Skip to Content

Passing message text from external RFC server into SAP EXCEPTION parameter

In function module CREDIT_CARD_SETTLEMENT the following DYNAMIC function module call exists:

  • ------ Send items for settlement to a RFC function -------------------



EXPORTING i_ccseth = i_ccseth

TABLES t_settab = t_settab

t_setexd_h = t_setexd_h

t_setexd_i = t_setexd_i

EXCEPTIONS system_failure = 01 MESSAGE rfc_msg_text

communication_failure = 02 MESSAGE rfc_msg_text

call_function_not_found = 03.

This is the code which calls an external credit card application server. I'm trying to figure out how, on the server side, I can return a message into the rfc_msg_text variable on the system_failure or communication_failure EXCEPTIONS.

I’ve found several examples of this construct in ABAP code in the SAP side – but I can’t for the life of me find anything that shows how to set this up in our external server.

There are several SAP function modules like RFC_PING that have similar constructs – but I can’t see the compiled C code to tell what command to use to fill in that text. I can raise the exception, just not fill in the text.

Any ideas?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 24, 2005 at 02:41 PM

    Hi Eric,

    I do not quite understand the problem.

    Is there an external NON-SAP system, that needs to do the call?

    Within any external SAP system (inside the RFC Function Module) you can raise exceptions in the following manner:

    MESSAGE e398(00) WITH par1 par2 par3 par4 RAISING exception_1.

    Message 398 in class 00 contains only & & & & as text.

    Each & is replaced by par1 through par4.

    Suppose par1='Order' par2='1234' par3='invalid' par4=''.

    Then a message would be build like: Order 1234 invalid.

    This all would reside in the remote called function module.

    When you call this module and after any exception in the call the addition MESSAGE rfc_msg_txt was put, then the variable rfc_msg_txt='Order 1234 invalid'.

    But as already stated before, i'm not quite sure what the problem is. Shed some light to it.



    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 24, 2005 at 03:02 PM

    Hello Eric,

    If I have understood your requirement correctly, then you want to populate the RFC_MSG_TEXT variable yourself. I'm afraid that is not possible.

    Obviously, if that were to be possible, then the code has to go into the function module that gets called, as Rob has mentioned. But as you have already observed, the call to the Function Module is <i>dynamic</i>, ie., you do not know which function module will be called. So there's no way you can get to have your own messages in RFC_MSG_TEXT.

    But if you can do some kind of configuration where in you always know which FM will be called and if it is a custom FM, then you could think about doing it.


    Anand Mandalika.

    Add a comment
    10|10000 characters needed characters exceeded

    • Anand,

      I'm saying both really. I can get the proper EXCEPTION to be called so that the SY-SUBRC value is set to '1' for the SYSTEM_FAILURE exception or '2' for the COMMUNICATION_FAILURE exception.

      However, in both cases I'm not able to get a text string into the RFC_MSG_TEXT variable.

      That's what I'm trying to figure out.



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.