Search
Search

# External Number Range

ExternalNumber Range

Is it possible to have both figure and letter in one material number? Is it possible to
restrict manual number entering into each letter or figure? Do you ever have this kind
of doubt?

SAP system. Maybe this is a very general topic which can be applied to not only CRM
area. Along with the theoretic discussion, I will use the real life coding from SAP systems to demonstrate in detail. Codings might be from material master data in ECC system (component LO-MD-MM) and business partner master data in CRM system (component CRM-MD-BP).

And to make the analyzing simplified, I will exclude special characters in the iscussion, for example – / * .

range has to be defined as . Give number as 2008OR1,

Lower        0000000          3030303030303020202020202020202020202020
Higher        ZZZZZZZ         5A5A5A5A5A5A5A20202020202020202020202020
Number      2008OR1         323030384F5231202020

Thus this is an allowed number.

Realize 8 formats

With the logic described above, we can define different number range to realize 8
formats as following:

 ` ` `Example` `Number range example` `Format1Y` `100000, ...100013, ...` `[100000, 99999]` `Format1N` `1, 2, ..., 11, 12, ..., 101, 102, ...` `[1, 99999]` `Format2Y` `TRUCKA, TRUCKB` `[AAAAAA, ZZZZZZ]` `Format2N` `TRUCKA, BUSC` `[A, ZZZZZZ]` `Format3Y` `PHONE80, PHONE85` `[A, ZZZZZZZ]` `Format3N` `PHONE80, PHONE80i` `[A, ZZZZZZZZ]` `Format4Y` `2008OR1, 2008OR2` `[0000000, ZZZZZZZ]` `Format4N` `2008OR1, 2008OR2i` `[00000000, ZZZZZZZZ]`

We can find that some of the number range might be the same while realize different
format. This reveals that we might need extra control to make the number range strictly follow the requirement. As the number range itself only offer higher and lower limit for the control, it is not enough for more complex numbering requirement. We will try to investigate into this in the next part.

Open questions

One of the more complex numbering requirement. Number range defined as
[A0000C0000, A9999C9999]. This number range would like to fix the first position as a letter A, and the sixth position as a letter C. And for all others use figures.

But when using it, you will find it cannot achieve the requirements.

* Give number as A0000C000A

Let’s transform it into ASCII

Lower        A0000C0000   4130303030433030303020202020202020202020
Higher       A9999C9999   4139393939433939393920202020202020202020
Number     A0000C000A   41303030304330303041

As “0” < “9”, start from the second position of the number given, it fulfils requirements higher than the lower limit, and lower than the higher limit. But this given number is out of my numbering requirements.

Within this article we didn’t find a good solution for this case. We have to consider enhanced number range control to realize this.

Enhancing number range control

Take Format3Y and Format3N for example, their number ranges are defined in the same pattern. We might have to use extra control to fix the length for example.

In ECC system, material master data, enhancement MGA00003 in transaction SMOD is provided to enable more complex external number range control.

In CRM system, business partner data, we can use event handler to enhance the control. Transaction is BUPA_EVENTS, under event BPNUM or BPNEX, you may define your own function module and add the logic needed.

In CRM2007 system, web ui, we have badi BADI_CRM_BP_UIU_DEFAULTS, which can be used to default number ranges, by using this we can enable external number range to be used as internal number range. As internal number range is always numeric, figure letter combined number has to be defined using external number range. By using badi BADI_CRM_BP_UIU_DEFAULTS, we may use coding to auto pop up the next number, for example numbering like this:

20081208TA001

-date-type-sequence number-

Ending

The above discussion might not cover all the possible business requirement for numbering. It tried to present the logic and enhancement interface. Hope these could help to shed some light in your next project regarding number range. And welcome to input your commends on all the above. Thanks.

You must be Logged on to comment or reply to a post.
• All this is well known. Why do you repeat these facts in a new blog entry? A quick SDN search will reveal many articles on this topic. What is the new point?
• Hongyan Shao Post author
Hi, thanks a lot for the comment.
Yes, the external number range itself is well known, maybe it is more than well known.
But have you ever found an article talking about how to define a number range, if you want to use an external number starting with figure and combined with letter?
And this article would like to make a summary for some of the number range format, instead of only talking about the starting with figure and combined with letter scenario.
And how about the “Enhancing” part? Is it also can be easily found?
• Hongyan Shao Post author
Hi All,
Thanks for reading this blog. This is a blog which present an ‘easy topic’ to some extend.
But I am trying to list out some possible complex requirement and realization method hidden in this ‘easy topic’.