My requirement is that Once you create Sales order in VA01, that Sales order number range interval should be different for different Company codes, Sales organization and Document type.
for that I have created 1 custom table(ZSD_va01) with 4 fields
2 Company code
3 Sales org
4 Document type
and assigning value to above declared field like
Company code Sales organization Document type Num_range
1000 1000 OR 26
Created Number range interval in t code 'VN01'
Num- From value To value
26 4100000 510000
Assigned number interval to SD document type in 'VOV8'
Sales document type- 'OR'
Sales document Category- 'C'
Number range internal assignment- '26'
and saved it
Open include MV45AFZZ in SE38 editor
and clicked on enhancement then clicked on show implicit enhancement after that created enhancement
User_exit_num_range using number_range_intern
Enhancement 340 Znum_range
Select single * from Zsd_va01
where bukrs = vbak-bukrs,
vkorg = vbak-vkorg
auart = vbak-auart
if sy -subrc = 0.
if not zsd_va01-num_range is initial.
us_range_intern = zsd_va01-Num_range.
finally activate the enhancement,
but my problem is that whenever I am crating a sales order for OR, 1000(sales org) then sales order is creating between interval 41000001 whatever value I assigned above but while I am changing Sales org(3000) in Va01 and try to create another order then order range interval is same 4100002,
for that I checked in SNRO, one object is there, RV_BELEG, this object hold all the number range internal for Document type 'OR'.
Could you guide me, how number range will be change for different sales organization.
Thanks and regards