Generate Document numbers without Gaps / Number Range Buffering

...Previous

Deactivating the Number Range Buffering

If you need to make sure that there are no gaps in the document numbers in certain areas of Sales and Distribution then you have to deactivate the number range buffering in the user exits USEREXIT_NUMBER_RANGE (for example, country-specific deactivation of the number range buffering).

Processing steps:

Step 1: Creation of a Z table

Create a table ZTAB with the following fields:

(Number ranges per Company Code/Plant/billing type)  

Field

Key

Data Element

Data Type

Length

Decimal

Short Description

CLIENT

X

MANDT

CLNT

3

0

Client

BUKRS

X

BUKRS

CHAR

4

0

Company Code

WERKS

X

WERKS

CHAR

4

0

Plant

FKART

X

FKART

CHAR

4

0

Billing Type

NRRANGENR

 

NRNR

CHAR

2

0

Number range number

 Step 2: Maintain data in Z table

Maintain the Number ranges per Company Code/Plant/billing type into this table (for those we don’t want to require gap).

Step 3: Modify User Exit

For a specific deactivation of the number range buffering (for example, for a certain country, company code or sales organization), you can set the NO_BUFFER parameter in the USEREXIT_NUMBER_RANGE user exit to value X.

SELECT SINGLE *
    
INTO wa_ztab
    
FROM ztab
    
WHERE bukrs EQ vbrk-bukrs
      
AND werks EQ vbrp-werks
      
AND fkart EQ vbrk-fkart.
IF sy-subrc EQ 0                                

    IF wa_ztab-nrrangenr is NOT INITIAL.                    “If range number maintained
      TVFK-NUMKI              = wa_ztab-nrrangenr.         
Assign Number Range
      US_RANGE_INTERN = TVFK-NUMKI.

      NO_BUFFER              = 'X'.                                   “Clear the buffer
    ELSE.
      MESSAGE E001(ZPKG).                                        “Maintain Number Range
    ENDIF.
ENDIF.

After setting this some entries in VBRK

 

These user exits are available:

  • In sales, in include MV45AFZZ,

  • In delivery, in include MV50AFZ1,

  • In billing, in include RV60AFZZ.   

As a prerequisite for this solution, make sure that a separate number range interval is used for the selected country or sales organization.

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image