Application Development and Automation 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: 
Read only

BAPI_TRANSACTION_COMMIT is dumping the program.

Former Member
0 Likes
9,030

I am Using BAPI    "BAPI_ACC_DOCUMENT_POST"   for FI Documents.

in return table, I am getting : 

TYPE  - S

ID     -   RW

MESSAGE - Document posted successfully: BKPFF 000030501310002013 STPCLNT600

After that when i am using BAPI_TRANSACTION_COMMIT, It cause a short dump.

I also tried Commit work  and wait.  But the response is same.

Please help me, this is really urgent.  

--> It may be urgent for you, but it is not for other members

The Dump message is:  

Long text of error message:

Diagnosis

     The material document posting was terminated to maintain data

     consistency. An expected COMMIT WORK or ROLLBACK WORK statement was

     triggered which is in turn caught by this error.

     Data has already been preselected for the UPDATE at the time of the

     COMMIT or ROLLBACK. If a COMMIT WORK or ROLLBACK is initiated in an

     enhancement, these are then written or rolled back into the

     database. If another error occurs during subsequent processing

     after a COMMIT, a complete ROLLBACK can no longer be performed,

     since the data up until the point of the COMMIT has already been

     written to the database. Otherwise, if no further errors occur

     following a ROLLBACK statement, the part that is subsequently

     entered into the posting is also written to the database.

     This can result in an inconsistent status, for example a material

     document without accounting document or an accounting document

     without a material document, which can only be repaired with

     considerable cost and effort.

     Inconsistencies that were caused by an incorrect implementation

     must be corrected by SAP in accordance with SAP Note 83020, subject

     to charge.

System Response

Procedure

     Remove the critical sections of code from your customer

     enhancements, such as MB_DOCUMENT_BADI. For more information about

     this error and how to avoid it, see SAP Note 1776835.

Procedure for System Administration

-

Message was edited by: Suhas Saha

1 ACCEPTED SOLUTION
Read only

deependra_shekhawat3
Contributor
0 Likes
5,732

Hi neeraj,

As per nabheet, there would be enhancement/BADI implementation  which having commit/rollback statements or in other words LUW are getting free. As BAPI_TRANSACTION_COMMIT runs an update process in system.

Thanks

Deependra

46 REPLIES 46
Read only

0 Likes
905

It is useless, this person just don't want to listen.

The problem is the commit in the BADI but he insist to keep it there. Even when the error message more or less tells him that what he does is SAP blasphemy. He seems to have a blinkered view.

The solution has already been given to him in this thread and in the SAP note that the error message refers to.

I guess he don't "like" that solution.

Read only

former_member186413
Participant
0 Likes
905

Symptom

The runtime error MESSAGE_TYPE_X occurs, and the system issues error message M7 685: "Posting termination to ensure data consistency - SAP Note 1776835"

Other terms

M7 685, M7685, dump, MESSAGE_TYPE_X, MESSAGE_TYPE_X, SAPMM07M, MM07MFB9_PROOF_DOC_CONSISTENCY, TERMINATE_AT_COMMIT, TERMINATE_AT_ROLLBACK

Reason and Prerequisites

The posting of the material document has been terminated to ensure data consistency. A COMMIT WORK statement or a ROLLBACK WORK statement was triggered unexpectedly in a customer enhancement, which is caught with this error.

At the time of the COMMIT or the ROLLBACK, data is already marked for the UPDATE. If a COMMIT WORK or a ROLLBACK is sent in an enhancement, this data is written to the database or rolled back. If an error occurs in the subsequent processing of a COMMIT, you cannot perform a complete ROLLBACK because the data up to the COMMIT has already been written to the database. In the other case, if no error occurs after the ROLLBACK statement, the part that is then transferred to the update is also written to the database.

This may result in an inconsistent state (for example, a material document without an accounting document or an accounting document without a material document), which can only be repaired with considerable effort and costs.

Inconsistencies that are the result of an incorrect implementation must be corrected by SAP according to SAP Note 83020 at an additional charge.

Solution

The delivery of these consistency checks is carried out with the assigned Support Package.

If an error occurs:
If you want to avoid this error, check all customer enhancements in the FORM routine BUCHEN_AUSFUEHREN in the include MM07MFB9_BUCHEN_AUSFUEHREN and remove the existing COMMIT or ROLLBACK statements. Also check the methods and functions that are called in your implementation. An SAP function module that is called in a customer enhancement may also trigger a critical COMMIT statement. This is incorrect.
Experience has shown that the incorrect implementation is in most cases located in the BAdI MB_DOCUMENT_BADI in the method MB_DOCUMENT_BEFORE_UPDATE. See SAP Notes 1284654 and 92550 for further information.

Emergency solution:
In case the error occurs in the production system and you can no longer post goods movements and you can no longer find the COMMIT/ROLLBACK statement, you can implement a temporary modification solution that deactivates the occurrence of the runtime error. Afterwards, you have sufficient time to search for the error.
In case you want to implement this modification, open a customer message on component MM-IM-GF-INC with reference to error message M7 685 and the modification solution. The employees in SAP Support will then provide you with the modification solution.
The runtime error M7 685 catches a goods movement that may cause real inconsistencies between materials management and accounting. It is therefore not damaging but wants to protect customers from inconsistencies. This type of inconsistencies may lead to problems with month-end reports and year-end reports and lead to production standstills. The effects or costs of these inconsistencies may be detrimental.


------------------------------------------------------------------------
|Manual Activity                                                       |
------------------------------------------------------------------------
|VALID FOR                                                             |
|Software Component   SAP_APPL                      SAP Application   |
| Release 600          SAPKH60001 - SAPKH60022                         |
| Release 602          Until SAPKH60212                                |
| Release 603          Until SAPKH60311                                |
| Release 604          SAPKH60401 - SAPKH60412                         |
| Release 605          Until SAPKH60509                                |
| Release 606          SAPKH60601 - SAPKH60605                         |
| Release 616          w/o Support Packages                            |
------------------------------------------------------------------------

Use SE91 to create the following message:

M7 685 with the short text:
"Posting termination to ensure data consistency - SAP Note 1776835"

Maintain the following long text:

Diagnosis
The posting of the material document has been terminated to ensure data consistency. A COMMIT WORK statement or a ROLLBACK WORK statement was triggered unexpectedly, which is caught by this error.

At the time of the COMMIT or the ROLLBACK, data is already marked for the UPDATE. If a COMMIT WORK or a ROLLBACK is sent in an enhancement, this data is written to the database or rolled back. If an error occurs in the subsequent processing of a COMMIT, you cannot perform a complete ROLLBACK because the data up to the COMMIT has already been written to the database. In the other case, if no error occurs after the ROLLBACK statement, the part that is then transferred to the update is also written to the database.

This may result in an inconsistent state (for example, a material document without an accounting document or an accounting document without a material document), which can only be repaired with considerable effort and costs.

Inconsistencies that are the result of an incorrect implementation must be corrected by SAP according to SAP Note 83020 at an additional charge.

Procedure
Immediately remove the critical sections of the source code from the customer enhancements, for example, MB_DOCUMENT_BADI. For further information about this error and its prevention, refer to SAP Note 1776835.

Read only

Former Member
0 Likes
905

Hi Neeraj

Inside BADI somewhere one more commit is getting triggered. Look for it and it will resolve your issue.

Read only

Former Member
0 Likes
905

Hello,

Problem is solved.

I just created a wrapper function and call that function in background.

And its working fine.

Thanks to all.

Read only

0 Likes
905

Hi Neeraj Tiwari,

Would you please give the code of your wrapper funcation to look at?

Thanks

Read only

0 Likes
905

Hi Wang,

I just created a fm rfc enabled and call that bapi inside that fm.

and the parameters are same.

Regards

Neeraj

Read only

0 Likes
905

can u please ellaborate? I am facing similar issue.