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

How to catch excpetions in function module?

Hallo everybody,

how can i catch the exception from function module "exception" and deliver it to call function parameter table --exception table.

For example,a function module 'RPY_TABLE_INSERT' is called by Call Function (parameter_table)in order to create a new table.When the table exists already, a exception "Already_exist" activated.But it can not be caught,since it is raised by "message raise". Therefore in the exception-table of caller no error is caught.

How can I deal with it?

Thanks in advance!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2005 at 12:41 PM

    HI,

    after the FM call, using sy-subrc you can catch

    if sy-subrc = 1.

    CANCELLED

    else sy-subrc = 2.

    ALREADY_EXIST

    endif

    cheers,

    sasi

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      but I can not go back to the caller,that means it was interrupted as soon as

      IF OBJ_EXISTS NE SPACE.

      MESSAGE E005 WITH 'eine Tabelle'(036)

      TABLE_NAME RAISING ALREADY_EXIST.

      Error occurs before I go back

      Call Function RPY_TABLE_INSERT

      PARAMETER-TABLE

      ***

      EXCEPTION-TABLE

      t_exc.

      B.R.

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.