cancel
Showing results for 
Search instead for 
Did you mean: 

How to catch excpetions in function module?

Former Member
0 Kudos

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!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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.