Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

External number range for Sales Document

Former Member
0 Likes
2,222

hi,

I have a requirement to generate external number range for sales document. I tried this user exit (MV45AFZZ) to generate external number.

FORM USEREXIT_NUMBER_RANGE USING US_RANGE_INTERN.

Endform.

between these form and enform i written my logic and passing to US_RANGE_INTERN. But can one suggest where to write to generate external number range.

Can any one help me out.

Thanks and regards,

Vijay.

hi,

I have a requirement to generate external number range for sales document. I tried this user exit (MV45AFZZ) to generate external number.

FORM USEREXIT_NUMBER_RANGE USING US_RANGE_INTERN.

Endform.

between these form and enform i written my logic and passing to US_RANGE_INTERN. But can one suggest where to write to generate external number range.

Can any one help me out.

Thanks and regards,

Vijay.

9 REPLIES 9
Read only

Former Member
0 Likes
1,635

Vijay,

As far as my knowledge goes, external number range means, you can manually key in the Sales order number.

Regards,

Ravi

Note : Please mark the helpful answers.

Read only

0 Likes
1,635

If you have explicitly use a Serial number range, create one in SNRO, get the next number using function NUMBER_GET_NEXT and use that number.

Regards,

Ravi

Read only

0 Likes
1,635

hi ravi,

Yes ur right. But i unbale find and to put my logic in User Exit. Here i need pass external number in runtime. I want to generate external according sales organization and year.

Ex: if sales org = 'SG0' and 2 last charecter of year 06. Then external number is 'SG00600001'. Then for the next sales document 1 wil be get added. Then external number will be 'SG00600002'.

charecters total <b>10</b> divide like this.

Sales organization SG0 3

Year 06 2

Number 00001 5

-


TOTAL 10

-


So pls anybody know about how to generate external number according based some custom logic.

Thank u.

Vijay.

Read only

0 Likes
1,635

Vijju,

Assume, ORDER is a variable for the Order number.

Get what ever data you want to concatenation like Sales Org, Year and use NUMBER_GET_NEXT for getting the serial number.

CONCATENATE SORG YEAR NUMBER INTO ORDER.

Now you this value to the variable in the user exit.

Hope this helps you.

Regards,

Ravi

Read only

0 Likes
1,635

Dear ravi,

This function module NUMBER_GET_NEXT checking in internal number range. So it's saying Number range not find. So another solution. If i am making u any trouble pls don't mind.

Thanks a lot friend.

Read only

0 Likes
1,635

Vijju,

For that have you created a Number range object in SNRO transaction, there you will specify what is starting and ending number of the range and by what number it will increment.

Once that is done, your function will give you back a number from that range.

Regards,

Ravi

Read only

Former Member
0 Likes
1,635

Hi

Here you can assign a different number range for your sales order.

The number range is linked to the order type (field VBAK-AUART), this link is done in customizing.

It usually uses this routine if it can't assign the range in customzing because (for example) for different sales area it need have different number ranges for the same order type.

So you should create an external range by trx SNRO and then assign the number before entering in the main screen of va01 or saving the document.

When you need to assign the number depends on how you want to manage your range.

If you assign the number in entering you has to make sure to not assign the same number document to severals order to be created in the same time by several useers.

Max

Read only

0 Likes
1,635

hi,

Thank a lot.

Exatly these problems i am facing. So can u tel which userexit can we use for generating external number.

Read only

0 Likes
1,635

Hi

You could use userexit_save_document or userexit_save_document_prepare (MV45AFZZ).

These exit are called before saving the document, I think you should generate the number in this step, in this way you don't miss a number if the user don't save document.