Skip to Content

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

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

Add comment
10|10000 characters needed characters exceeded

  • "but for this T-code validation to done so,"

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

  • 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.

  • 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.

  • Get RSS Feed

2 Answers

  • 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.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 14 at 12:51 PM

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

    Add comment
    10|10000 characters needed characters exceeded