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

exception after executing the function module

Former Member
0 Likes
623

HI,

I have called a function module and how can i know that an exception has raised.

5 REPLIES 5
Read only

Former Member
0 Likes
594

Hi,

check the sy-subrc value.

regards,

Read only

Former Member
0 Likes
594

Hi Karthick,

SY-SUBRC will store corresponding value....

by using CASE or IF...ENDIF..you can find actual exception...

Read only

Former Member
0 Likes
594

Hi,

The sy-subrc value is set based on that exception number.

Read only

Former Member
0 Likes
594

Hi Karthick,

If you want know whether exception raised or not, write if condition just after your FM call ends.

If Sy-subrc <> 0.

Write : \ Sy-subrc , ' FOUND'.

endif.

<b>

Kindly reward if useful

Rohit G</b>

Read only

Former Member
0 Likes
594

Don't forget you'll need to map each of the exceptions to a numver for sy-subrc to have any meaning.

E.g.

CALL FUNCTION example

IMPORTING

something = something

EXCEPTIONS

FAILED = 1

ALMOST_WORKED = 2

VERY_CLOSE = 3

and so on.

Regards,

Nick