cancel
Showing results for 
Search instead for 
Did you mean: 

how to determine number range for billing document based on company code ..

former_member186390
Participant
0 Kudos

Hi Friends!!

can anybody tell me how to determine number range for billing document based on company code & tax departure country if required??

Amit...plz help me!!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Amit,

I think what Mandar is trying to tell you is that this can not be done with standard SAP functionality. He is telling you how to do it with customization.

Number ranges are created independently of Sales Org. and Company Code etc. and assigned directly to sales/billing/delivery types. So they are used whenever that sales/billing/delivery type is used.

To see what I'm talking about look at object RV_BELEG in t.code snro. This is the number range object for SD Documents. Click on Number Ranges and then Intervals to view the different number ranges and associated intervals. Now look at t.code 0vlk, which is Define Delivery Type. If you double-click on a delivery type BV it goes to more detail. See the field: "NR int. assgt."? This is the number range for delivery type BV. This number range will be used in any company code or tax departure country that this delivery type is used in.

Hope that helps,

Johnny

former_member186390
Participant
0 Kudos

Hi!!

Can u clarify that ,how to code the logic ur suggesting..?

Thanks for ur help...

@mit

Answers (1)

Answers (1)

mandar_shete
Active Participant
0 Kudos

Hi Amit,

We have the similar requirement, but only based on Sales Org.

What we did is,

1. Created the Z-Table with Sales Org, Billing Type and Number range (e.g. A1, A2).

2. In User exit RV60AFZZ (USEREXIT_NUMBER_RANGE) we populate the variable us_range_intern using the z-table entry for the Sales Org and Billing Type.

Thanks,

Mandar

former_member186390
Participant
0 Kudos

Hi!!

Thanks for your reply ...

can u clarify me a little as per my requirement that what should i do to determine number range for billing document based on company code and if required the tax departure country...

please help..

Amit.

mandar_shete
Active Participant
0 Kudos

Hi Amit,

1. Define different Billing Document number ranges in SPRO -> Sales & Dist -> Billing -> Define number ranges for billing docs. (VN01). Make sure that all are internal number ranges.

e.g.

NO. From number To Number Current number Ext

A1 0930000000 0930999999

A2 0940000000 0940999999

A3 0950000000 0950999999

2. Define a Ztable ZNUMB_RANGE as follows

Comp. Code | Tax departure country | Billing Doc Type | Number Range

100 IN F2 A1

200 IN F2 A2

200 US F2 A3

3. In user exit RV60AFZZ (USEREXIT_NUMBER_RANGE)

Read table ZNUMB_RANGE for Number Range with Comp. Code, Tax country and Billing Doc.

If found pass this number range value to us_range_intern.

us_range_intern is a standard SAP variable which tells program which number range use to create the current document which is under process.

Let me know if you are clear.

Thanks,

Mandar