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

FM errors on job log

Former Member
0 Likes
850

Hi,

im using FM 'L_TO_CANCEL' and I need to show all errors coming from this FM on the job log. Do I need to create a message for every exception? How should i do it?

Thanx!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
812

just hard code message type to 'S'.

there is one more way, i hope you are running that FM in side a loop, so keep storing the exceptions in a table and finally display the table as output.

Hi,

im using FM 'L_TO_CANCEL' and I need to show all errors coming from this FM on the job log. Do I need to create a message for every exception? How should i do it?

Thanx!

4 REPLIES 4
Read only

ThomasZloch
Active Contributor
0 Likes
812

There will be only one exception at a time, so you probably only need something like

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

depending on how the FM issues the messages with the RAISING option.

If you don't want the job to cancel, you can hard code the TYPE as 'I' or 'S'.

Thomas

Read only

0 Likes
812

i get an error message MESSAGE_TYPE_UNKNOWN

Read only

0 Likes
812

Please invest some own research effort as well. The short dump text will tell you the invalid value. Check for a blank SY-MSGTY before issuing the message. Oh, and include my snippet in IF SY-SUBRC >< 0, obviously.

Once again, please try solving things yourself first.

Thomas

Read only

Former Member
0 Likes
813

just hard code message type to 'S'.

there is one more way, i hope you are running that FM in side a loop, so keep storing the exceptions in a table and finally display the table as output.