Number Range Gaps

作者:郑德鼎 约 6 分钟阅读 更新日期:2024-02-22 2 年前更新 标签:ABAP, CO, FI, 开发, 财务
目录

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

...

郑德鼎

关于作者:郑德鼎

企业信息化与 SAP 技术顾问,长期专注 SAP ABAP、FI/CO、MM、SD 等模块的技术分享与实战经验总结。查看更多介绍

来源说明:本文内容由「Number Range Gaps.docx」整理生成,仅用于内部技术分享与学习交流。