Skip to Content
author's profile photo Former Member
Former Member

return message from function module

Hello Folks

How can we get the return message from function modules where there

is no return table associated? I am using a FM 'CCAP_ECN_CREATE', CCAP_REVLEVL_MAINTAIN etc. None of these has a return table associated to fetch the return message. Any ideas are appreciated

Thanks

Ricky

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 09, 2007 at 03:03 PM

    Hi,

    make use of exceptions here.

    if sy-subrc EQ <exeption Number>

    message 1.

    elseif sy-subrc EQ <ex number2>

    message2.

    endif.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 09, 2007 at 03:05 PM

    Hi Ricky

    Probably you can check back the table AENR, whether the change number is created, if yes, than it success

    Regards

    MD

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 09, 2007 at 03:08 PM

    Hi Ricky,

    Mainly, return strucutures are used with BAPI modules. Most regular FM use the system variable sy-subrc for return codes. You can look in transaction se37 under exceptions to see the exceptions codes associated with sy-subrc for any given FM.

    thanks.

    Jamie

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 09, 2007 at 03:08 PM

    When there is no return message table, you can check the return code or exceptions. If you view the function module in transaction SE37, you can see what the coded exceptions are. I hope this helps.

    - April King

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks guys. But I wanna capture the real system error message. Not based on sy-subrc.

      Right now, I am using a select statement after calling the function module

      SELECT SINGLE text INTO return-message FROM t100

      WHERE sprsl = sy-langu

      AND arbgb = sy-msgid

      AND msgnr = sy-msgno.

      But here for error, I am getting the message with & in it which gets populated inside the standard function module. How can I replace this & with the real value. and populate the return-message with the same.

      Thanks

      Ricky

  • author's profile photo Former Member
    Former Member
    Posted on Oct 10, 2007 at 04:31 AM

    Hi,

    You can use the function module FORMAT_MESSAGE to prepare the message text for the corresponding message id, number and place holders (&)

    Thanks

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

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.