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

EXIT_RETURN

Former Member
0 Likes
1,252

Hi experts,

When I want to use the macro EXIT_RETURN i have to give a code. Here 9001.

exit_return 9001 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

I read i have to declare the exceptioncode as LIKE SWOTINVOKE-CODE.

How can I do this?

DATA: 9001 LIKE SWOTINVOKE-CODE.

does not work

Thanks,

Philippe

1 ACCEPTED SOLUTION
Read only

Harsh_Bansal
Contributor
0 Likes
945

Hi,

You can declare it in the method you want to raise the exception.

Like -

DATA: w_exception_9001 LIKE SWOTINVOKE-CODE.

Now in SWO1, go to exceptions of that method and click on create.

There you can write 9001 and select w_exception_9001 in name in FM.

Then you can use it in exit_return.

Regards,

Harsh Bansal

4 REPLIES 4
Read only

Harsh_Bansal
Contributor
0 Likes
945

Hi,

You can give it like this only -


exit_return 9001 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

Regards,

Harsh Bansal

Read only

0 Likes
945

When I don't declare it the workflow error log says

Exception '9001' is not defined for method <method>' object type '<objecttype>'

Read only

0 Likes
945

Hi,

you have to define the exception in the method with the number you are specifying in EXIT_RETURN.

Regards,

Gaurav

Read only

Harsh_Bansal
Contributor
0 Likes
946

Hi,

You can declare it in the method you want to raise the exception.

Like -

DATA: w_exception_9001 LIKE SWOTINVOKE-CODE.

Now in SWO1, go to exceptions of that method and click on create.

There you can write 9001 and select w_exception_9001 in name in FM.

Then you can use it in exit_return.

Regards,

Harsh Bansal