Skip to Content

Regarding function module

Hi all,

i have requirement to raise exception in function module.

in this function module , we have total two EXIT statements.

i need to raise exception for that.

is there any point to know solution .

Thanks in advance,

Regards,

Bhaskar

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2007 at 09:24 AM

    Hi Bhaskar,

    What is the issue.

    You can just use RAISE EXCEPTION.

    Regards,

    Atish

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      I enter two exptection in EXPECTIONS tab.

      if i declare statement with after EXIT statement.

      But its showing message like "<b>EXCEPTION" is not defined as an exception in the function module. </b>.

      can u give navigational steps if cretation exptection .

      Thanks in advance,

      Regards,

      Bhaskar

  • Posted on Oct 22, 2007 at 09:25 AM

    define 2 exceptions.

    replace EXIT statement by RAISE exception1. and the others by RAISE exception2.

    regards,

    Hans

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2007 at 09:25 AM

    Hi Bhaskar,

    Raise the excepton by using the bellow syntax, if the FM contain exception perameters. Otherwise include the exceptions and populate those.

    RAISE EXCEPTION { {TYPE cx_class [EXPORTING p1 = a1 p2 = a2 ...]}

    | oref }.

    Effect

    This statement interrupts the execution of the current statement block and triggers a class-based exception. It can appear at every stage of a processing block.

    If the addition TYPE is specified, an exception object of the exception class cx_class is created when the exception is triggered. After TYPE, every exception class cx_class visible at this point can be specified. With the addition EXPORTING, you can assign appropriate actual parameters to the input parameters of the instance constructor using the same syntax as with CREATE OBJECT.

    If oref is specified, no new exception object is created during the trigger. For oref, an object reference variable must be specified which refers to an already existing exception object.

    The statement RAISE EXCEPTION rules out the simultaneous use of the statement CATCHSYSTEM-EXCEPTIONS to handle catchable runtime errors, and the statements RAISE or MESSAGE RAISING to trigger non class-based exceptions in function modules and methods in the current processing block.

    Note

    When oref is specified, you can use an exception object instanced via CREATE OBJECT, or you can re-trigger an exception that had already been caught during the exception handling.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2007 at 09:26 AM

    Hi Bhaskar,

    Declare some expceptions in the Exceptions tab of the function module.

    Before Exit command is getting executed, raise exception with one of the exception you have maintained in the function module.

    <b>Reward for helpful answers</b>

    Satish

    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.