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: 

How to pass error messages from User exit to BAPI Return parameter?

VijayaKrishnaG
Active Contributor
0 Kudos

Dear experts,

I have implementend an User exit: MM08R002 for validating the Invoice quantity with PO quantity (while creating invoice through MIRO) - for 107/108/122 movement types.

This is working fine while doing invoice manually (MIRO), I am able to fill the error log box using some FM.

But same invocie can also be posted using BAPI: BAPI_INCOMINGINVOICE_CREATE. But while posting invoice through BAPI the RETURN[] parameter is being initial and Invoice is getting generated.

Can anyone help me in filling the BAPI Return parameters with an error message from User exit (component: EXIT_SAPLMR1M_001).

This can be achieved my writing "MESSAGE ENNN(MSG_CLASS)" but for this T-code validation to done so, looking for anyother way like through FM or something else to achieve this.

Thanks & Regards,

Vijay

5 REPLIES 5

Jelena
Active Contributor
0 Kudos
"but for this T-code validation to done so,"

What does this mean? How are you triggering the message?

PraveenChitturi
Participant
0 Kudos

Hi,

Generally for BAPI processing we need to fill the error message to the return table with the standard subroutine that exists in that bapi. You may try to fill the return table by calling the below subroutine from user exit.

Thanks,

Praveen.

raymond_giuseppi
Active Contributor
0 Kudos

Did you raise the CALL_FAILURE error in your CMOD implementation of EXIT_SAPLMR1M_001?

VijayaKrishnaG
Active Contributor
0 Kudos

Hi I mean, there should be an IF conditioin based on T-Code like... IF SY-TCODE = MIRO - filling log box ELSE - Use MESSAGE statement. So, I wanted to check instead of writing this IF ELSE condition, whether we have any other way.

Jelena
Active Contributor
0 Kudos

It's been more than 2 months and I believe Raymond answered your question below. Is this still open?

If it's resolved then kindly close it, see this blog.