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

Error Message in BAdI

Former Member
0 Likes
1,547

Dear all,

I want to show an error message in standard program according to certain condition,

now I have found the BAdI and implemented it, append following codes in the BAdI:

MESSAGE E000(ZMSG)

Then I ran the standard program,errors messages came out,but when press ENTER,

the program dumps

I don't know why,can't the message statement be appended to BAdI ??

3 REPLIES 3
Read only

narin_nandivada3
Active Contributor
0 Likes
815

Hi Alex,

Please check suggestions given to the below thread of similar kind of issue..

Hope this would help you.

Good luck

Narin

Read only

0 Likes
815

《Look if the BAdi interface has any exceptions defined for the method, if so, raise the exception with your message like:

MESSAGE e002(sy) WITH 'Error' RAISING <badi_exception>.

Or Simply call fm POPUP_TO_CONFIRM to show error messages to user

Regards

Kiran Sure 》

Above are the solution suggestion I guoted from other thread.

For the solution 1, because I want to show error message in status bar,so it does not take effect

For the solution 2,truly,it takes effect,but what I should next? How I lock the current screen and stop the subsequent execution? May 'Leave to screen' be effective?

Read only

indra_dewaji
Explorer
0 Likes
815

Hi All,

I have a simillar problem. I need BADI to stop processing after validation.

For example:

READ TABLE itab INTO ld_field1

WITH KEY field1 = 'R'.

IF sy-subrc NE 0.

< Here, I want to insert stop process statement >

ENDIF.

What I do now is using EXIT statement, but it just exit from the method. What I want is stop processing into next step.

Any Idea?

Thanks,

Regards,

Indra Dewaji