Application Development 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: 

Changing message from BAPI

Former Member
0 Kudos
526

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

raymond_giuseppi
Active Contributor
0 Kudos
188

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

Former Member
0 Kudos
188

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.

former_member222709
Contributor
0 Kudos
188

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.

raymond_giuseppi
Active Contributor
0 Kudos
189

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

0 Kudos
188

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.