cancel
Showing results for 
Search instead for 
Did you mean: 

Change Number Range Interval for Transaction Type

Former Member
0 Kudos

Hi,

We have a requirement to change number range interval for the same transaction type. Example:

Transaction Type Z100 to which in Transaction Config Master CRM_SALES / 01 is assigned. But there are also 02,03,04... created for CRM_SALES.

Now during creation of Z100 we want to change 01 NR interval to 02.

Is there a standard way(badi/user-exit/enhancement) to replicate above behaviour?

THanks

Accepted Solutions (1)

Accepted Solutions (1)

VishnAndr
Active Contributor
0 Kudos

Hello Maksim and other participants of this discussion.

As an SCN Moderator I would strongly advise all of you to talk about the question and not about "useless replies" or "basic questions". Thank you.

Coming back to the topic starter's question. As far as I understand: Maksim wants to assign different transaction ID (from different number ranges) to new documents of the same transaction type based on some criteria dynamically during the save process. Switching to a new number range is not sufficient for his requirements because it changes number range permanently.

What I would suggest to try is:

1. Create external number range which covers CRM_SALES01, CRM_SALES02, CRM_SALES03 etc. number ranges.

2. In transaction type customizing maintain both "Int.No.Range No" (as far as it is mandatory) and "Ext.No.Range No". The last one is an external number range from point 1.

3. In BAdI ORDER_SAVE in method CHECK_BEFORE_SAVE check your criteria and if so fill in object_id with next number from appropriate number range you chose (NUMBER_GET_NEXT function module).

4. If you won't fill the transaction id (object_id) "externally" the system will assign the next number from internal number range maintained for your transaction type.

Answers (3)

Answers (3)

former_member365335
Discoverer
0 Kudos

Hi Maksim,

I hope you were able to find a proper solution for this. We have a similar kind of requirement where we want to have different number range for same type of transaction based on Country.

Let's say if it is Country1 - Number Range would be 51xxxxx for transaction ABC,

and if it is Country2 - Number Range would be 61xxxxx for the same transaction ABC and so on.

I was able to find the place, changing where changes our OBJECT_ID i.e transaction number.

FM - CRM_ORDERADM_H_OBJECTID_DET_OW

This FM is called while saving transaction for the first time only and output variable  ls_orderadm_h_wrk-object_id contains the transaction number i.e object_id field.

If we change this value to whatever number that number results in our transaction number.

My query is how we can use other internal number range in our scenario. Where exactly you applied the code to achieve this scenario.

Thanks,

Amit Chaudhary

Former Member
0 Kudos

Hi Amit, as I understand for you the whole point to separate number ranges per country is to have a unique prefix for each country. I do not recommend going for any enhancements on number range swapping for the same transaction type. We have looked at this option but then gave up. Its quite tricky and also risky to change this core functionality.

you should consider creation of multiple transaction types with 1 tr for 1 country or give up on the prefix strategy.

Thanks

max

former_member365335
Discoverer
0 Kudos

Hi Maksim,

Thanks for your valuable input.

As transaction type is already attached to an internal number range so while creating same transaction for other country(sales org) it will pick the same internal number range and related data like object type and which should also be same for other sales org as well. Only thing that is changing is number range.

If our transaction type is TXN and number range assigned to it is XX and sales org is ABCD, so for sales org EFGH number range should be changed to some other number range.

Here what I am doing is when it is going for different sales org for the same txn type, I am checking sales org and number range(we will already have this value with us, here XX).

Let's say I want to change number range XX to YY for sales org EFGH for same txn type TXN.

XX will always come whenever somebody is creating TXN transaction.

I am adding an enhancement to the FM NUMBER_GET_NEXT and changing this parameter NR_RANGE_NR.


This FM will have input parameter XX as number range ( NR_RANGE_NR) for TXN transaction.

So based on these criteria : What is present sales org(EFGH), what is present number range(XX), what should be the changed number range(YY) we are changing the number range.

e.g


IF Number range = 'XX'.

and sales org = 'EFGH'.

then only change number range to 'YY'

otherwise no changes should be done to this FM.

It is working fine at the moment.

Please provide your valuable feedback on this if it seems a solution for it.

Former Member
0 Kudos

Hi,

This can be done via customizing.

Go to SPRO->Customer Relationship Management->Transactions->Basic Settings->Define Transaction Types

In the next screen of Define Transaction Types, open the transaction type Z100.

Look at the section "Transaction Number" towards bottom of the screen. There will be a number range and interval assigned to it.

You can change this according to your requirement.

I don't think you can have multiple intervals assigned for same transaction type. You can create different transaction types by copying the Z100 transaction for different numbering.

Hope this is useful.

Regards,

Naresh

former_member182421
Active Contributor
0 Kudos

I'm quite shock about someone has come with an answer after the our little discussion, it's not only the OP who should follow the ROE, all members should follow it. You are not a new member as you have already have the gold level, don't you wish for a better content on scn? do you want the same basic questions ask again and again and again? I'm sorry but I don't understand...

Cheers!

Luis

Former Member
0 Kudos

Luiz, so what you are saying is that dynamic change of number range interval for the same transaction type is a basic question? Even if something is impossible from functional point of view a lot of the time its possible technically. My question is for technical consultants who have faced similar requirements in the past.

former_member182421
Active Contributor
0 Kudos

I don't get your query, you can change the number range on the corresponding customizing for business transaction, you shouldn't need to use any enhancement.

Cheers!

Lluis

Former Member
0 Kudos

we have a requirement to dinamycally change number range intervals for the same transaction type. if you dont get my query please dont reply.

former_member182421
Active Contributor
0 Kudos

Maybe we got lost in translation in some point. I didn't understand your query I asked for further explanations, otherwise I can't help you, I guess you are here asking for help, right?

Once I understood what are you whilling to do, I'm afraid you are asking a basic question which answer can be found searching or reading the help sap documentation.

Cheers!

Luis

Former Member
0 Kudos

Luis, if its so basic. please provide an answer instead of posting useless replies.

former_member182421
Active Contributor
0 Kudos

Oh! I just forgot about that, you are absolutely right: