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

Changing message from BAPI

Former Member
0 Likes
1,570

Hi All,

I have implemented BADI WORKBREAKDOWN_UPDATE. I have added some coding in the AT_SAVE method. It works great.

Only a small issue though, when the coding finds an error, exception ERROR_WITH_MESSAGE is raised.

This will result in a simple error message, but I would like to give the user some more information why the error occurred.

So, is it possible to change, or add some extra information to the error message given?

many thanks,

regards,

Ron.

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,232

Replace the

raise error_with_message.

with a

message id wa-msgid type wa-msgty number wa-msgno

    with wa-msgv1 wa-msgv2 wa-msgv3 wa-msgv4

    raising error_with_message.

Did you look at sample CL_EX_WORKBREAKDOWN_UPDATE ?

Regards,

Raymond

4 REPLIES 4
Read only

Former Member
0 Likes
1,232

If you can change the error message in SE91, add long text to the error message. So when user clicks the message he can see the whole reason why it went wrong.

Read only

former_member222709
Contributor
0 Likes
1,232

Dear Ron,

As the BAPI raises exceptions at multiple instances, it will be a huge task change or add details to the messages. Also, as these messages are stored as part of Standard message classes, changing the messages in the standard message class will also be cause changes across the application.

Practically, not recommended.

Finally, if it is a very custom requirement that you have already enhanced and the error message is

also raised in the same routine, you can attempt to override the exceptions if it is in an enhancement section.

Regards, Pranav.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,233

Replace the

raise error_with_message.

with a

message id wa-msgid type wa-msgty number wa-msgno

    with wa-msgv1 wa-msgv2 wa-msgv3 wa-msgv4

    raising error_with_message.

Did you look at sample CL_EX_WORKBREAKDOWN_UPDATE ?

Regards,

Raymond

Read only

0 Likes
1,232

Thanks Raymond,

Your solution worked like a charm!

regards,

Ron.

I altered the statement as follows:

message id sy-msgid type 'I' number sy-msgno with sy-msgv1 sy-msgv2 'doesnt''t allow a billing flag' ''

      raising error_with_message.