Skip to Content
author's profile photo Former Member
Former Member

Error message in MB_DOCUMENT_BEFORE_UPDATE

Hi All,

I have to use a error message in MB_DOCUMENT_BEFORE UPDATE method. before error message I need to update one customize tabele.

If I used like this.

ROLLBACK WORK.

UPDATE customize table.

COMMIT WORK.

will it create any inconsistency in MM and ML even I am using COMMIT work in MB_DOCUMENT_BEFORE_UPDATE.

Please suggest me as its very urgent.

Thanks ,

sandeep.

Add comment
10|10000 characters needed characters exceeded

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 03, 2006 at 06:19 AM

    Sandeep ,

    u cannt use BADI to raise Error messages ? what u can do is u can make use of Error Log ? in that u can like this ?

        msg-vbeln  = w_lips-vbeln.
        msg-posnr  = w_lips-posnr.
        msg-msgty  = 'E'.
        msg-msgid  = 'YW2'.
        msg-msgno  = '042'.
        msg-msgv1  =
        'Avail.dt for this Item/batch is later than today'.
        msg-msgv2  = w_lips-lfimg.
        msg-msgv3  = w_lips-meins.
        msg-msgv4  = w_lips-charg.
        append msg to ct_log.

    <b>in addition to RB , u cannt rollback , but what u can do is u can change data in the table which are avail at this stage ? and u can update ur Ztable with Update Command.

    and coming to error message ? try @ ur end and let me know the status.</b>Regards

    Prabhu

    Message was edited by: Prabhu Peram

    Message was edited by: Prabhu Peram

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hey Prabhu,

      question is that can I use ROLLBACK WORK to back out the changes to the standard table and COMMIT WORK in BADI for udpating the customize table.

      Reagrds,

      Sandeep.

  • author's profile photo Former Member
    Former Member
    Posted on Aug 03, 2006 at 06:14 AM

    Hi,

    You cant issue error message of type 'E' inside the BADI, you can use fm 'POPUP_TO_CONFIRM' to display the message in a popup screen,

    If you dont want to update both custom & standard tables after the error message you can issue 'LEAVE PROGRAM', command to leave the control out of the program,

    Hope this helps,

    Rgds,

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 03, 2006 at 06:25 AM

    Hi !

    Never do any COMMIT or ROLLBACK within a BADI or User-Exit.

    You will interrupt the DB-Transaction (LUW) of the original-program !

    What you can do...

    You can call a Function-Module in TRFC. Within that you can update your own table.

    Regards

    Rainer

    Some points would be fine of that helped a bit.

    Add comment
    10|10000 characters needed characters exceeded