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: 

problem with warning mesg in user-exit?

Former Member
0 Kudos

Hi everyone,

I m using the user exit exit_sapmm07m_001 in the enhancement mbcf0002.I have written a code to display a warning mesg and error mesg in the exit.

When I checked the user-exit with the transaction MIGO for error message it is working fine.But for warning message,i m getting a warning mesg but it is not the message what i wrote in the code.It is getting a different warning mesg from somewhere.any suggestions please.

Thank you.

14 REPLIES 14

Former Member
0 Kudos

Hi,

U check the message class U might have written in some message class.

That message class may not be available in that program.

Assign points if useful.

0 Kudos

Hi yugnadhar,

Thanks for the reply.I think i m using the correct message class.

my code looks like this,

If mess_type = 'W'.

message w000(z1) with '...........................'.

elseif mess_type = 'E'.

message e000(z1) with '...........................'.

endif.

I m getting the error mesg perfectly for what i wrote.but the warning is displaying something else instead of what i wrote in the code.any more ideas?

Former Member
0 Kudos

Hi,

have u used message syntax as below:

MESSAGE E000(message_class_name) WITH '&'.

Former Member
0 Kudos

Hi,

Have you debug the code till the message you have given.

Many a times a standard msg may be triggereing before or after your message hence ovewritting it.

so please check that with a break point in your exit.

thanks.

taher

former_member404244
Active Contributor
0 Kudos

Hi,

In the message class Z1 define the messages for example

number text

000 ->its a warning message

001 ->its a error message.

now do like this

If mess_type = 'W'.

message w000(z1) .

elseif mess_type = 'E'.

message e001(z1) .

endif.

Regards,

Nagaraj

0 Kudos

Hi nagraj,

Thanks for the reply.I tried giving different message numbers from the message class.Even though for warning it is picking up the message from somewhere.I kept break point and i debugged it.It is executing the warning mesg line what i have written in the code but bringing a different warning mesg alltogether.Any more ideas will be helpful?

Former Member
0 Kudos

Hi d_p,

The new warning message is actually over writting your warning message. As the control does stop on error message, the control does not stop on warning message.

So the code is working fine, i guess.

Thank you.

0 Kudos

Hi,

Can you please post ur warning message getting from System.

Thanks,

Siva.

0 Kudos

Hi sivantham,

The warning mesg i m getting instead of the warning mesg i kept in the program is:

<b>Deficit of PU Ordered quantity 18 EA : 04/501900 6020 6021</b>

The Message no for that is M7021.

0 Kudos

HI,

as far as ur code is concerned ,the logic is coorect..what is happening is that ur warning message is overwritten by standard message.after ur warning message is triggered somewhere in the program the system also throwing the warning message and is over written,so for testing purpose give error message instead of warning and check..whether the error message is triggering or not..

Reward if helpful.

Regards,

Nagaraj

0 Kudos

Hi nagraj,

As u said i kept the message as error and tried.I got the my message as error mesg in a dialog box but in the list the first one is the warning mesg which is coming before when i changed from warning to error.

But for this message the user wants it as a warning mesg only not as error.

Former Member
0 Kudos

Hi d_p,

Put this code.

IF condition

Message S000(xxx) DISPLAY LIKE 'W'.

<b>EXIT.</b>

ENDIF.

0 Kudos

Hi srinivas,

I tried with ur way,but still the standard warning is coming instead of mine.

Former Member
0 Kudos

Hi everyone,

I think the problem is over. But for someone with the same problem, you could tried executing the function BAL_LOG_MSG_ADD

CALL FUNCTION 'BAL_LOG_MSG_ADD'

EXPORTING

i_log_handle = (SAPLMICK)g_s_msg_defaults-log_handle

i_s_msg = l_msg

Bye.