cancel
Showing results for 
Search instead for 
Did you mean: 

MDM number generation with length limitation

Former Member
0 Kudos

Dear experts,

I'm currently working on an MDM project, and creating a repository that will auto-generate Project Master number.

The tricky part is that the project number is alphanumeric: it is a combination of AABBCCCC.

AA = Site code (like CZ, XJ, etc)

BB = year (like 14)

CCCC = 4 digits auto ID (0001, 0002, ...., 9999)

I'm thining of using calculated fields, but I'm not sure how I can control the length of auto-id.

Any suggestions?

Thank you!

Best regards,

AZ

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member196156
Participant
0 Kudos

Hi AZ,

You can't control the length of auto-d, because its automatic generated unique integer key repersenting the count of the record in the table. The autoid is non editable and once deleted you can not get the code back for other records.

Kindly note there is no limitation for Autoid, as much records get created in the MDM table where autoid field is called,that much Autoid will get generated.

the below calculation you can use to achive your result.

Note:In the calculation field Right (Autoid,4) is holds value 4 so the autocodes will only generated till autoid9999. If you want to increase you can increment the value to 5, by that you can get the autocode till 99999.....

As you know any modification to the calculation field you require to stop the repository, to avoid this you can achieve this by using Assignment.

the below thread will explain and give you some idea regarding calling the assignment in the workflow.

http://scn.sap.com/thread/3521976

Regards

Former Member
0 Kudos

Hi Rahul,

Thanks so much for your response!

I tried the calculation you suggest, and I'm having 2 more questions:

1> The “CCCC” part is expected to always be 4 digits long in the "AABBCCCC" format. But when I try the expression using "Right(autoid,4), it starts with 1 and there's no leading zeros. Thus the project number length is not consistent.

2> I understand that the auto ID is cumulated one by one within the whole table. However the requirement is, to generate numbers under each AABB range. For example I have 2 sites (SC and SH), and in year 2014, the number should be like:

SC140001, SC140002, SC140003, SC140004, ....,SC149999

SH140001, SH140002, SH140003, SH140004, ...., SH149999

If I use the auto-ID field to generate the number, it seems that I cannot generate in above sequence because each ID is unique....do you think there's some way of doing this?