Go through the below process and check the SAP note also.
SAP Note # 83731
<u><b>(Solution for Express document update termination problem)</b></u>
First reset the number range buffer of the application server. Start Transaction SM56 and choose 'Number range buffer -> Reset'. Fill the fields of the following dialog field as follows: Client <current client>
Sub-object <controlling area>
Global Reset X
Start report RKANRCHK for the controlling area in question. All number intervals with internal number assignment are listed, for which CO documents already exist between the current number level and the upper value of the interval. Use the appropriate maintenance transaction in Customizing to set the current number level of the interval to the highest document number so far assigned, or assign a new number interval to the respective business transactions.
You can find the maintenance transaction in Customizing, under the path 'Controlling -> Controlling General -> Organization -> Maintain Number Ranges for Controlling.
If your current release is earlier than 4.0A, you must first create the attached report RKANRCHK in your system.
Hope it helps.
have you checked in SM13 on why your update failed ?
one of the possible reasons -> popup shown in background will cause termination... when you test in debug - you are processing in foregorund and no issues with popups, in background - it fails.
I would start from SM13 and if you need any futher help - provide the exact message your update failed with.