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

user exit - stop processing with error message displayed

Former Member
0 Likes
1,547

Hi guys,

My scenario is like this

Whil doing migo for the same batch number more than 3 times i should not allow to post the document.

I have the material number and batch number in a seperate ztable

for checking this found out there is an exit.

Enhacmenet - MBCF0002

EXIT_SAPMM07M_001

I have written code in the above exit as

select count(*) from ztable

into t_charg

where matnr eq i_mseg-matnr

and charg eq i_mseg-charg.

if t_charg gt 3.

call function 'POPUP_DISPLAY_MESSAGE'

exporting

titel = 'Error Message'

msgid = 'BD'

msgty = 'E'

msgno = '899'

msgv1 = 'Batch Already Received 3 Times'.

if sy-ucomm = 'OKAY'.

elseif sy-ucomm = 'RW'.

else.

endif.

endif.

The program works fine and gives a pop up message and when i post the document

it still gets posted.

I should not allow to post the document

Help me on this issue?

Regards

Senthil

1 ACCEPTED SOLUTION
Read only

former_member188827
Active Contributor
0 Likes
621

this happens with 'POPUP_DISPLAY_MESSAGE'.

so instead use

message e001(zmesg) type 'E'.

gve desription in long text of message

reward points if it helps

Message was edited by:

abapuser

2 REPLIES 2
Read only

former_member188827
Active Contributor
0 Likes
622

this happens with 'POPUP_DISPLAY_MESSAGE'.

so instead use

message e001(zmesg) type 'E'.

gve desription in long text of message

reward points if it helps

Message was edited by:

abapuser

Read only

0 Likes
621

thanx for the reply

Ihave created a message class z001 and maintained a message(001)

but when i am trying to activate it says

Field "Z001" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement . . . . . . . . . .

whether i need to include anything in the program for message class

senthil