Skip to Content
0
Former Member
Aug 10, 2010 at 09:08 AM

Commit Work in MIGO BADI

304 Views

Hi,

Can we use COMMIT WORK statement in BADI? Hope its not advisable to use it.

I am using MB_MIGO_BADI~POST_DOCUMENT to update the GR Number in a custom table.

Sometimes the GR number is not getting updated in the custom table.

The modify statement given below does not updates the table sometime.

IF WA_ZMM_GATE_ENTRY-GR_NUMBER IS INITIAL.
      WA_ZMM_GATE_ENTRY-REFERENCE = GS_EXDATA_HEADER-REFERENCE.
      WA_ZMM_GATE_ENTRY-REFWERKS  = GS_EXDATA_HEADER-WERKS.
      WA_ZMM_GATE_ENTRY-GR_NUMBER = IS_MKPF-MBLNR. 
     WA_ZMM_GATE_ENTRY-GR_YEAR   = IS_MKPF-MJAHR.
     MODIFY ZMM_GATE_ENTRY FROM WA_ZMM_GATE_ENTRY .u201Dupdating the Z-table
ELSE.
      MESSAGE E901(ZMM) WITH GS_EXDATA_HEADER-GATEENTRYNO WA_ZMM_GATE_ENTRY-GR_NUMBER.
    ENDIF.

Is there any other option to replace the commit work in BADI?

Plz suggest...

Regards,

P.S.Chitra

Edited by: Chitra Karthik on Aug 10, 2010 11:19 AM