Number Range Gaps
Skip to end of metadata
Created by Former Member on Oct 06, 2016
Go to start of metadata
Gaps in Number Range for Accounting Documents
Purpose
The purpose of this page describe the primary tasks that can be checked to identify a number range gap in Accounting Documents providing a description about the possible causes and linking with the available SAP notes available.
Overview
Function NUMBER_GET_NEXT is responsible for generate the next number range. If this function is called and a commit work is not performed in the database this number is lost.
For these reason an unexpected update termination or dump before the commit work can results in number range gaps.
Custom codes should avoid call Function NUMBER_GET_NEXT without commit work or rollback.
Steps to identify gaps in number range:
Check Update Terminations in SM13: This is the most likely cause of number range skipping. If an update termination occurs before the number is already assigned (commit work already performed) and the accounting document was not stored in FI tables, this document number will be lost. In this case the SM13 will display the update termination for analyzing. For more details please check SAP note 1513587. Please check also transaction ST22 to check whether short dump occurred.
Custom Code:
-> If inside a custom code NUMBER_GET_NEXT is called and after this a commit is performed the number range cannot revert anymore in a rollback a scenario.
-> A common use of this is User exit USEREXIT_NUMBER_RANGE in program RV60AFZZ. Other point to be checked is source codes in BTE 00001030.
-> If document number gap occurs because of an implicit COMMIT between the document number assignment and COMMIT WORK. Please check the source codes between document number assignment and COMMIT WORK for finding if an implicit COMMIT is triggered. For preventing an implicit COMMIT triggered after document number assignment before COMMIT WORK in SAP standard program, all E-messages between document number assignment and COMMIT WORK have been changed to A-messages via standard correction in SAP notes: 428391, 1259205, 1420715
Buffering:
If you have activated buffer. You can check if you have buffer activated in SNRO transaction.
-> If a buffering type is activated and year-dependent number ranges are defined, the document number gap may occur at the end of a fiscal year. In this case Please check the values in To number field and current document number field of the table(NRIV_LOKAL or NRIVSHADOW) for finding last buffered document number, and the current document number, then check the document numbers updated in table BKPF via transaction SE16 for judging whether the gap occurred at the end of the fiscal year. If yes, the document number gap occurred is a standard system behavior.
*NRIV_LOKAL: local buffer
*NRIVSHADOW: parallel buffer
-> If 'Main memory buffering' is used check whether you have shut down the system. In this case the buffered numbers that were not used will be lost.
If the document number buffering type is switched you can check whether buffering type was changed and who changed it via Tcode SNRO-> Object RF_BELEG-> Goto-> change documents. Check which value is saved in field 'old value' and field 'New value' (space means 'No buffering', 'P' means 'Local buffering with process ID', 'S' means 'Parallel buffering').
4. Check System Logs:
Check the system logs for all servers in Tcode SM21 via menu: System log ->Choose->Central system logs. Here you can try to find the information which might be relevant for the document number gap.
For example, whether a dialog or a background work process was cancelled, whether a update termination occurred etc. Then you can analyze this dialog work process log in Tcode ST11, the background work process log in SM37 and the update termination in Tcode SM13.
5. SAP Modification Note:
If the document number gap occurs regularly in your Production system without any helpful information, such as NO short dump, NO update termination, NO system log, and you even don't know in which transaction code the document number gap occurs. SAP offer a modification Note 1259909 to collects some header information which are used for restricting the concerned transactions, programs, users, time intervals. The note's results should shows where you have to check the program logic. But as it is a modification note, SAP should release it to the customers.
Reports to Identify Gaps in Number Range
- RFBNUM00N: This report displays these document number gaps for the number range object RF_BELEG.To make documentation more secure you could run RFBNUM00 once a month.
- RSSNR0A1: Local buffering with process ID". For more details please check SAP note 179224
- RFVBER00: document number gap caused by update termination
Related Documents
Number Range Buffers in Financial Accounting
Number Range In Financial Accounting
Related SAP Notes/KBAs
SAP Note 1522367: Document number gap reason and analysing method SAP Note 1513587: How to analyze an update termination SAP Note 428391: Inexplicable document number gaps in FI (II) SAP Note 1259205: FI: Document number gaps in FI documents due to error msgs SAP Note 1420715: FBV1: Gaps in doc number assgmt in parking due to error msg SAP Note 179224: Doc.no.assignment for unbuffered number ranges SAP Note 175047: Causes for FI document number gaps (RF_BELEG)
175047 - Causes for FI document number gaps (RF_BELEG)
Version 62 from 06.11.2018 in English
Show Changes
Component:FI-GL-GL-X
Priority:Recommendations / Additional Info
Category:Help for error analysis
Release Status:Released for Customer
Corrections:0
Manual Activities:0Entry successfully validated
Prerequisites:0
DescriptionSoftware Components
References
AttributesLanguages
Activate item to go to section in page
Symptom
Report RFBNUM00 (as well as new Report RFBNUM00N) has document number gaps for the number range object RF_BELEG. However, due to legal requirements, FI document numbers must be assigned continuously (but not necessarily in ascending chronological order, for example in Germany).
An FI document cannot be displayed - the message: 'Document has already been archived' is generated. However, archiving did not occur. The document header and the line items are not displayed. If only the document header is displayed, another problem exists (see Note 144487, for example).
An actual document number gap only exists if no other data has been updated except for the document number. If document data is partially available, this is caused by a different error (partial update termination, and so on). In this case contact SAP Support by quoting the internally released Note 202308.
Other Terms
Data base inconsistency, document number gap, number range, missing documents, SNUM, SNRO, RV_BELEG, FIINCON
Reason and Prerequisites
******************************************************** Technical view of internal document number assignment ******************************************************** The internal assignment of FI document numbers is carried out in the online part of an SAP transaction (for example FB01) before the asynchronous update is started. To assign document numbers, call up function module RF_GET_DOCUMENT_NUMBER in SAPFF001 and simply count up by 1 the current number level (NRLEVEL) of table NRIV (which is called in the following with they synonymous expression NRIV_LOKAL) - (in the case of the non-buffered document number assignment of the central resource NRIV, see below). Already before the document is updated on the database, you receive the message 'Document 0815 was created'.Document number 0815 is now reserved and a lock is kept on the document number table NRIV. As the transactions progress there are 2 possible scenarios:
There is no longer an error in the online part of the transaction, the document number assignment is completed (COMMIT WORK) and the lock on table NRIV is removed (other transactions now use the subsequent numbers). Immediately after the COMMIT on the document number, the asynchronous update is started.If it runs without errors, document 0815 then exists in the database afterwards. An update termination is created in the case of an error (Transaction SM13) and the database changes of the update tasks already made are reversed (ROLLBACK WORK).Document 0815 does not exist in the database, however, the number is assigned.
If the error can be corrected in the update and the update can be repeated, document 0815 is created in the database and no document number gap remains.
If the update cannot be repeated, document 0815 is not posted but the document number 0815 remains assigned. A document number gap has been created. You can use report RFVBER00 to document gaps which are due to terminated updates. However, take into account that update terminations are deleted by default after 50 days. This can be controlled via system parameter 'rdisp/vbdelete' (to be checked via report RSPARAM or RSPFPAR or Transaction RZ11). If the update terminations no longer exist in the system these can also not be reported by report RFVBER00! Update terminations are also documented in the central/respective local syslog (Transaction SM21). You must not / may not subsequently update
Documents from batch input sessions (posting status NORE = 'NO RETRY'; to be recognized by BKPF-GRPID <> '' or VBHDR-VBCLIINFO with set bit 2). These must be updated later via batch input administration.
Update modules which cannot be subsequently updated (see Transaction SE37)
Update requests for problems in update which cannot be solved It is necessary that these update terminations are documented before the 50 days expire. The subsequent updating of terminated updates should only be carried out by experienced employees after a thorough analysis. General notes on subsequent posting:
Note 70085 : Re-processing failed update records with SM13 : References to many other useful notes !
Note 125287 : Updates in the status INIT, RUN or AUTO
Note 129085 : Subsequent posting of CALL TRANSACTION...USING
Note 102353 : Update control (Status NORE, ENQR, RUN, DEL) : Not subsequent posting of batch input sessions
An error occurs in the online part of the transaction. Document number assignment is rolled back and the lock on NRIV is deleted. Document number 0815 can now be assigned by the next transaction. No document number gap is created.
Conclusion: Document number gaps which are created by update terminations can be documented and explained by report RFVBER00 within (in most cases) 50 days. Gaps without update terminations cannot be easily explained. Check, whether one of the other causes for the occurence of document number gaps applies: ******************************************************************** Other known causes for the occurrence of Document number gaps: ******************************************************************** Handling / Customizing: -----------------------
Main memory buffering of number range objects: Not relevant for RF_BELEG; RF_BELEG must not be buffered. For RF_BELEG, only 'no buffering' (central number assignment from table NRIV for all R/3 instances) or a 'local buffering'(local assignment of document numbers for every instance from table NRIV_LOKAL)' is allowed.
Note 62077, 37844, 23698
Switching document number assignment from 'No buffering' (NRIV) to 'Local buffering' (NRIV_LOKAL) and back.The remaining numbers from NRIV_LOKAL are no longer assigned. (Note: In addition ot 'local' buffering, buffering at work process level is also possible. Please see Note 179224).
Note 62077, 37844
Error in application source code: ---------------------------------
MM / SD / FI documents:
Note 127565: Commit error in online part of a transaction - all applications, in particular FI
Note 86447 : Incomplete documents via FI/CO interface - exception not trapped in SD/MM
Note 74096 : Gap which cannot be reconstructed due to locking problems
Note 74963, 64725 : Double update in MM
Note 92592 : Missing billing documents for FI documents
Note 95317 : Analysis:Billing documents available / accounting documents missing
Note 95614 : Correction program:missing FI documents for billing documents
Note 77419 : VF076 for billing documents with net value unequal zero, FI document is missing.
Note 75797,24279,23835,19050 : Gaps in document numbers with Update termination in SD - only plays a role in external document number assignment and if it is set that FI document number = SD document number.
Note 144779: RFBIBL00 'D': F5312 but no document display possible The latest known causes are fixed by the following notes:
Note 304889: FBV4: Gap in document number after "Back"
Note 318782: Gap in document number assignment for FS215/FS216
Note 324195: FB60:RW012 'Error when...'after one-time processing
Note 363790: Gaps in MR01 postings
Note 365093: Inexplicable document number gaps in FI
Note 418239: I-message F5312 when transaction in the call mode
Note 428391: Inexplicable document number gaps in FI (II)
Note 426178: Incorrect update return codes after server restart (Documents from batch input sessions missing!) The latter note is the latest cause for document number gaps known.
Batch input:
Note 84926 : Transaction is lost; document is not posted.
Note 136482: Missing documents when updating in batch input
Note 119350: Problems with local update, document not posted
Note 426178: Incorrect update return codes after server restart
Apply a COMMIT WORK (ABAP or Native SQL) in a user exit or a customer modification which is after the document number assignment but before the start of update.If an error occurs online after the COMMIT WORK, the document number assignment cannot be rolled back and a gap is created.An implicit Commit (for example RFC CALL) may also generate corresponding errors.
Error of update control: -----------------------------------
Note 154411 : Disappearing update requests
Note 102353 : Update control (update records disappear without having been executed when restarting the update server, if these are from batch input sessions; implementing status NORE for these records)
Note 426178: Incorrect update return codes after server restart (Documents from batch input sessions missing!)
Other rare causes: ------------------------- Termination of the work process after document number assignment and before starting the update (for example, by coincidental crash of the front-end at that time; this can occur in connection with Note 127565). Update is not triggered, only the document number is assigned on the database. Examples Not(!) to be followed: ------------------------------
The receipt message of the document number assignment (message F5312 "Document 0815 was posted in company code 4711") is changed from "S" (no implicit database commit) to "I" (triggers an implicit database commit on the basis of screen changes) in a customer modification. Following each documnet number assignment, there is an implicit commit performed by the dialog box which confirms the posting of the document (Document number is now committed!). The update is not triggered until you confirm the dialog box with ENTER. If the dialog box remains on the screen and the link to the application server is cut off during this time (mesesage Q04 in the system log), the update is not triggered and the document data is lost.
After planning the update modules but before the receipt message, the following modification is implemented:
CALL TRANSACTION 'FB02' MODE 'E' This updates the linked invoice items (BSEG-REBZG). If an error occurs and if the transaction is terminated, then the update is not triggered, but the document number remains assigned.
At OPEN FI callup point 00001030 (Publish & Subscribe Event), a 'perform on commit' routine is called; within this routine, an error message is displayed, or a new dynpro is called. These two actions commit the document number in the database. Under unfavorable circumstances (mode termination, etc.), however, no update is started. The update data are completely lost, no entry can be found in SM13 either. At OPEN FI callup point 00001030 (P&S), a dynpro must NEVER be sent! At the same time, no 'perform on commit' routinen should be planned where an error message might occur.
----------------------------------------------------------------------- Other possible causes in the SAP standard system or in customer modifications: ----------------------------------------------------------------------- Possible program flow within a transaction:
....Application logic....
....Document number assignment....
After this, update function modules (POST_DOCUMENT, and so on) are planned oder not; this is no longer important for the scenario (this will become clearer further below).
A 'leave screen', 'call transaction', 'leave to screen' and so on is now transmitted at some point, which restarts the transaction. The program can no longer escape the actual ABAP COMMIT WORK, this is an imperative prerequisite for the scenario (COMMIT WORK could also be nested by non-fulfilled If conditions so that it is ignored: COMMIT WORK should, as a rule, always be run).
'Leave screen' and so on has been committed, however, it does not start the potentially scheduled update tasks which are lost as a result! It is unimportant whether or not update tasks have been scheduled. The quintessence of this is that you cannot draw an a priori conclusion as to when 'leave' and so on actually took place. It could have taken place before or after the scheduling of update tasks.
The transaction does not show any abnormalities for the user. The system generates, for example, the message that a document has been updated successfully (the receipt message is usually issued shortly before COMMIT WORK).
Analysis help (watchdog program) -------------------------------- If it cannot be ascertained without doubt whether or not the update is (or was) triggered after the document number assignment you need to implement one of the following watchdog programs: ....Application logic.... ....Document number assignment.... ....Additional source code.... ....Commit work ....Implementation of the watchdog program directly after Commit Work: { In the watchdog program the key fields of the documents to be updated should be written into a separate table Z_CHECK_BKPF in the dialog WP: ( insert z_check_bkpf from t_bkpf ). ( CALL FUNCTION DB_COMMIT. ) } ....other source code. With this you can determine any time whether or not the update has actually been started for missing documents. If the document numbers are also missing in table CHECK_BKPF, the update has not been started. 'False' document number gaps in RFBNUM00 -------------------------------------------- RFBNUM00 displays wrong gaps in document numbers:
Note 148757 : RFBNUM00 displays wrong gaps in document numbers
Note 44978 : Problems with RFBNUM00
Note 115222 : RFBNUM00 does not select clearing documents
Note 390658: New Report RFBNUM00N
RFVBER00 (list of terminated updates) does not show all terminated updates
Note 63702, 142922: Terminations for clearings without documents
Document number gaps through missing document headers -------------------------------------------------------- If the document header (table BKPF) is missing for documents, report RFBNUM00 displays the document as missing and cannot be displayed using 'Document display' (Transaction FB03). However, document line item information (table BSEG) exists. In this case, contact SAP for correction of the documents.
Note 105322 : FI: Document headers are missing
Document number gaps caused by repairs by SAP Support (missing line items) ----------------------------------------------------------------- In R/3 kernel Release 3.1I (patch level <237) problems occurred with incorrect/missing documents in table BSEG (Note 144487). Within the framework of correction works, documents may have been deleted by SAP support (these documents were entered later with a new document number so that no information was lost). Check whether the error described in Note 144487 occurred in your system in the past and whether documents were deleted by SAP support (source: your SAPNet - R/3 Frontend message). Check also whether documents were deleted within the framework of messages in SAPNet or R/3 Frontend that did not relate to Note 144487. Related subject: Document number assignment ------------------------------------------------ In case of persistent performance problems (blocking on NRIV_LOKAL) during local document number assignment, you can change to document number assignment at work process level. The required source code is supplied in Note 179224. This note is not contained in all Hot Packages. If suddenly no document numbers are assigned after the upgrade, you need to implement the note again.
Solution
Check the attached notes. Document gaps and their causes for the external auditor.
Software Components
References
This document refers to
More
[ 20 / 51 ]
This document is referenced by
More
[ 20 / 48 ]
Attributes
Languages
日本語
Deutsch (Origin)
Português (Machine Translation)
Español (Machine Translation)
中文 (Machine Translation)
Français (Machine Translation)
Italiano (Machine Translation)
Русский (Machine Translation)
한국어 (Machine Translation)
| Software Component | From | To | And Subsequent | |||
|---|---|---|---|---|---|---|
| This document is not restricted to any software component | This document is not restricted to any software component | This document is not restricted to any software component | This document is not restricted to any software component | This document is not restricted to any software component | This document is not restricted to any software component | This document is not restricted to any software component |
| Number | Component | Title | |||
|---|---|---|---|---|---|
| 95614 | SD-BIL-IV | Correction program:missing FI documents f. invoices | |||
| 95317 | SD-BIL-IV | Analysis: Billing docs available/accounting docs missing | |||
| 92592 | |||||
| 86447 | CA | RWIN: Incomplete documents | |||
| 84926 | FI-GL-GL-I | RFBIBL00: transaction is lost | |||
| 810757 | |||||
| 77419 | SD-BIL-IV | VF076 for billing docs. w. net value unequal zero | |||
| 75797 | SD-BIL-IV | VF04: Gaps in doc. nos. after update termination | |||
| 74963 | MM-IV-FIV | Double update in invoice verification | |||
| 743744 | MM-IV-LIV | MIRO, MR1M: FI follow-on documents or MM documents are missing | |||
| 74096 | FI | SAPFF001 & LFACIF05: F5302 document is locked | |||
| 70085 | BC-CST-UP | Subsequently processing canceled update records via SM13 | |||
| 64725 | MM-IM-GF-DTF | Double material documents | |||
| 63702 | FI | RFVBER00: Functionality / list range | |||
| 62077 | BC-SRV-NUM | Info: Internal number assignment has gaps | |||
| 585513 | FI-GL-GL-A | Inexplicable document number gaps in FI (III) | |||
| 486103 | PS-CAF-ACT | (FI+MM) Change parked document header: Performance | |||
| 450520 | FI-AP-AP-A | FBZ4: Paymt doc. missing for outgoing paymt w/ check print | |||
| 44978 | FI | Problems with RFBNUM00 | |||
| 428391 | FI-GL-GL-A | Inexplicable document number gaps in FI (II) |
| Number | Component | Title | |||
|---|---|---|---|---|---|
| 2126782 | FI-SL-SL-A | Update termination/gap in document number assignment in FI when using Sybase ASE database | |||
| 743744 | MM-IV-LIV | MIRO, MR1M: FI follow-on documents or MM documents are missing | |||
| 1265329 | XX-CSC-JP | Inconsistencies between table isjpinvsumit and table BSEG | |||
| 70085 | BC-CST-UP | Subsequently processing canceled update records via SM13 | |||
| 1513587 | FI-GL-GL-A | How to analyze an update termination | |||
| 1522367 | FI-GL-GL-A | Document number gap reason and analysing method | |||
| 95614 | SD-BIL-IV | Correction program:missing FI documents f. invoices | |||
| 1420715 | FI-AP-AP-W | FBV1: Gaps in doc number assgmt in parking due to error msg | |||
| 95317 | SD-BIL-IV | Analysis: Billing docs available/accounting docs missing | |||
| 1259205 | FI-AR-AR-A | FI: Document number gaps in FI documents due to error msgs | |||
| 1315217 | XX-CSC-JP | Number gaps in FI-documents and Invoice Summary active | |||
| 102353 | BC-CST-UP | Update control | |||
| 179224 | BC-SRV-NUM | Doc.no.assignment for unbuffered number ranges | |||
| 62077 | BC-SRV-NUM | Info: Internal number assignment has gaps | |||
| 24279 | SD-BIL-IV | Missing billing document numbers in VBRK | |||
| 792493 | FI-GL-GL-W | Reasons for FI document number gaps when parking | |||
| 19050 | SD-BIL-IV | Gaps in document number sequence for billing docmts | |||
| 23835 | SD-BIL-IV | Buffering RV_BELEG/number assignment in SD | |||
| 450520 | FI-AP-AP-A | FBZ4: Paymt doc. missing for outgoing paymt w/ check print | |||
| 585513 | FI-GL-GL-A | Inexplicable document number gaps in FI (III) |
| Name | Value | |||
|---|---|---|---|---|
| Other Components | FI-GL-GL-A Posting/Clearing | |||
| Other Components | MM-IV Invoice Verification |