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

Raise error message in BADI

Former Member
0 Likes
4,732

Hi,

I am using the BADI 'CHANGE_DATA_AT_SAVE' while saving notification using tcode 'IW22'. I want to throe error message based on some condition.


MESSAGE: 'XXXXXX ''1'' ' TYPE 'E'.

But this will display as Information. Is it possible to display as error message.

Regards,

Manju

Hi,

I am using the BADI 'CHANGE_DATA_AT_SAVE' while saving notification using tcode 'IW22'. I want to throe error message based on some condition.


MESSAGE: 'XXXXXX ''1'' ' TYPE 'E'.

But this will display as Information. Is it possible to display as error message.

Regards,

Manju

6 REPLIES 6
Read only

ipravir
Active Contributor
0 Likes
2,431

Hi,

Can you try with 'DISPLAY AS 'E'. after message statement.

regards,

Praveer.

Read only

Former Member
0 Likes
2,431

Hi Manju,

That is the expected behaviour of the BADI.

Try to pass the values explicitly as

EV_SUBRC  = 1

EV_MSGID = 'ZIW22'

EV_MSGTYPE = 'E'

EV_MSGNO = '002'

EV_MSGV1 = 'Your message'.

Regards,

Kannan

Read only

Former Member
0 Likes
2,431

Hi Manju.

You can not add error message directly in most of the BADI implementation. Only way to populate any message is by passing values in EV variables which is provided by SAP itself in BADI parameters to display message. Sample code is given by Kannan in his last post.

Regards,

Shreyes Sorte

Read only

Former Member
0 Likes
2,431

Hi All,

thanks to all of you. I have done as Kannan suggested. It is working now.

regards,

Manju

Read only

0 Likes
2,431

Hi Manju,

Happy to hear that solution worked for you.

Regards,

Kannan

Read only

0 Likes
2,431

Hi

Now i'm facing another issue. teh BADI is NOTIF_EVENT_SAVE and method is 'CHANGE_DATA_AT_SAVE'. when i create notification using tcode IW21, badi throws error message and screen stops. but notification is created. is there any way to prevent the creation of notification

Regards,
Manju