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: 

badi "invoice_update " error "Express document "Update was terminated" received from author "Administrator Admin."

Former Member
0 Kudos

Hello Experts,

   I put validations while posting invoice in MIRO tcode  through badi "INVOICE_UPDATE",

   I implemented method "CHANGE_AT_SAVE" .Now while posting invoice the following error is coming

   Express document "Update was terminated" received from author "Administrator Admin.

When i deactivate the BADI ,the error is not coming .Where is the problem,

Please help me in this.



12 REPLIES 12

Former Member
0 Kudos

Put your code inside the BADI impl here.

ThomasZloch
Active Contributor
0 Kudos

Look for hints in ST22 short dumps and SM13 canceled update requests, consult your system administrator, post relevant info here if you cannot solve it this way.


Thomas

0 Kudos

Hi Shambu / Thomas,

thank u for giving immediate response.

This is the code,Please help me where  i did a mistake.

method IF_EX_INVOICE_UPDATE~CHANGE_AT_SAVE.

   DATA : WA_MSEG TYPE MSEG,
          WA_RSEG TYPE mrmrseg ,
          WA_MCHB TYPE MCHB.
   DATA : TI_MRMRSEG TYPE TABLE OF MRMRSEG.



   LOOP AT  TI_RSEG_NEW INTO WA_RSEG.
     IF ( WA_RSEG-MATNR GE '000000000000100000' AND WA_RSEG-MATNR LE '000000000000299999' ).

       SELECT SINGLE  * FROM MSEG INTO WA_MSEG
         WHERE MBLNR = WA_RSEG-LFBNR AND MJAHR = WA_RSEG-LFGJA AND ZEILE = WA_RSEG-LFPOS.
         IF SY-SUBRC EQ 0.

        SELECT SINGLE * FROM MCHB INTO WA_MCHB
          WHERE MATNR = WA_RSEG-MATNR AND WERKS EQ WA_MSEG-WERKS AND LGORT EQ WA_MSEG-LGORT AND CHARG EQ WA_MSEG-CHARG.
          IF SY-SUBRC EQ 0.
         IF  ( WA_MCHB-CINSM > '0.0' OR   WA_MCHB-CSPEM > '0.0' OR WA_MCHB-CVMSP > '0.0' ).
*        IF WA_MSEG-INSMK NE ' '.
           MESSAGE 'NOT ALLOWED TO POST INVOICE ' TYPE 'E'.
         ENDIF.
         ENDIF.
         ENDIF.
         ENDIF.
         ENDLOOP.
endmethod.

0 Kudos

The badi document says - Note that no Commit work statement can be entered in this method.

Your message statement of type E triggers an Implicit Db commit when it interrupts the process.

The below part of the documentation will solve your problem:

Exceptions

ERROR_WITH_MESSAGE should be triggered if you want to prohibit creation of a logistics invoice document or changing of or deleting a parked document.

Note that this exception should only be triggered in conjunction with a system message (message xxx raising ERROR_WITH_MESSAGE).

0 Kudos

Just checked some existing implementations in my system.

The messages were also captured in this manner:

INCLUDE mm_messages_mac.

IF SY-SUBRC EQ 0.

         mmpur_message_forced 'E' 'M8' '462' '' '' '' ''.

ENDIF.

Please check it.

0 Kudos

Hi Kesavadas,

   Thank u for giving help ,

   Can u give more details ?

  Please help me in this.

0 Kudos

All the details are already provided clearly. Please mention the point you did not understand.

0 Kudos

Hi,

check this thread:

http://scn.sap.com/message/2679137#2679137

try to do something like:

MESSAGE e208(00) WITH 'NOT ALLOWED TO POST INVOICE'

                     RAISING error_with_message.

Best regards.

0 Kudos

Hi  Casamayor,

  I applied what u told but the same error is coming , 'Update was terminated'

  please help me in this.

0 Kudos

Hi,

please go to SM13 and show us the content of ST22.

Otherwise it would be very difficult to help.

Best regards.

0 Kudos

Hello,

What has been suggested by Kesav is correct and I think he has given explanation from the documentation as well. Would just add that the include mm_messages_mac contains the definition of macro mmpur_message_forced. We just call that macro from the method. We have to add the statement INCLUDE mm_messages_mac to call the macro. I assume you understand the term macro!

Regards,

Kumud

0 Kudos

Hi All,

  I solved  myself using User exit.

  Thank u for all .