Skip to Content
Author's profile photo Polly Gan

Typical MM/FI inconsistency: MM missing FI — Why and how to prevent it

As we all know if we post material document which is relevant to valuation, an FI document will be created subsequently.
A typical MM/FI inconsistency would be the material document is generally while the FI document is however missing.
If ML(material ledger) is activated system will issue error C+048 and no more goods movement is possible for the material.
In the worst situation, period closing activity will be affected and even causing auditing issue.
(This is the same content moved from Chinese forum as per quest from peers)

Here will give a detailed explanation, possible reason and the way to prevent it:

  •   The important user-exit and BAdI

    • material document missing FI document
    • FI document missing material document
    • check mechanism to prevent it
  •    Relevant SAP notes

The important user-exit and BAdI

During goods movement, there’re many requirements to implement customer specific checking logic, so BAdI

MB_DOCUMENT_BADI and User-exit  EXIT_SAPLMBMB_001(include ZXMBCU01 / enhancement component MB_CF001)

are the ones to be often used. If there’re inappropriate command(from note 92550) below implemented in the BAdI or user exit,

MM missing FI could happen:

  • Remote Function Call (CALL FUNCTION .. DESTINATION)
  • Own updates on the document or stock tables (for example, an update on the table MBEW, MARD, MSEG)
  • Unlocking data (for example, by DEQUEUE_ALL)
  • Calling a dialog box (POPUP_TO_CONFIRM, for example)
  • material document missing FI document

        Here I’d like to introduce the concept of SAP LUW. LUW is “Unit Logical Unit of Work” and usually there’re
        Database LUWs and SAP LUWs. SAP LUW is used to keep consistency of application programs that are executed

        across different work processes, and the updates are first registered and then executed by a single work process.

        One of the techniques is known as update task(via update function modules: CALL FUNCTION…IN UPDATE TASK).

        BAdI MB_DOCUMENT_BADI is called after the update function module MB_UPDATE_TASK, so if there is COMMIT WORK

        in MB_DOCUMENT_BADI method MB_DOCUMENT_BEFORE_UPDATE, SAP LUW will be destroyed.

8-18-2015 1-17-30 PM.png

   Considering sequence below:

  • Material document:

          Call function ‘A’ in update task.

          Call function ‘B’ in update task.

          COMMIT WORK -> update of material document is triggered and database MKPF/MSEG will be updated.


  • FI document:

          Call function ‘C’ in update task.

          Call function ‘D’ in update task.
         ->If there’s any error happens at this stage, system can only rollback C and D while material document
            cannot be rolled back any more as it has been already written into database.

You may still have concern, why the issue does not always happen. Sometimes twice or three times in a month?
As shown in above flow, you could understand it only happens when LUW is destroyed i.e. there’s error afterwards however
system can no longer roll back the whole transaction completely. If there’s no error then with 2 times of COMMT WORK,
you can still see both material document and FI document are created.

  • FI document missing material document

        Similarly, if there’s inappropriate ROLLBACK in user-exit, FI document missing MM could happen as well

  • Material document

         Call function ‘A’ in update task.

         Call function ‘B’ in update task.

        -> material document update is cancelled


  • FI document

        Call function ‘C’ in update task.

        Call function ‘D’ in update task.

        Standard COMMIT WORK is executed, and only FI document is updated into database

  • check mechanism to prevent it

        We’ve got lots of customer incidents reported with this kind of inconsistency. The correction can only be carried out
        by SAP authorized engineer with debugging so we implement the checking mechanism in note 1776835

        to prevent such inconsistency. This note implement the coding to catch and track the inappropriate COMMIT

        or ROLLBACK in customer coding, and once it’s detected system throws short dump to terminate the process.
        In transaction ST22 call stack, you can see in which user-exit or BAdI COMMIT/ROLLBACK is triggered, and then

        you have to review the coding with your ABAPers and correct it accordingly. So we highly recommend you to
        implement the note to prevent MM missing FI inconsistency. It’s always necessary that customer development obey
        the rules and keep the completeness of SAP LUW.

SAP notes      
Regarding the MM/FI inconsistency topic, you can also refer to SAP note below for details:

  • Note 968812 MM-FI Differences caused by ROLLBACK or COMMIT
  • Note 92550  Stock inconsistency due to customer enhancement (exit, BAdI)
  • Note 1284654  Caution with implementations of the BAdI: MB_DOCUMENT_BADI

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Jürgen Lins
      Jürgen Lins

      From the reported inconsistencies between FI and MM here in SCN I would say that 90% are based on direct account stock account postings made by Finance people, e.g. for depreciation of old stock value.

      Author's profile photo Polly Gan
      Polly Gan
      Blog Post Author

      FI manual posting is one of main reasons. I've been correcting such inconsistency for more than 5 years...but still have customer report it because of the own coding...