cancel
Showing results for 
Search instead for 
Did you mean: 

Refined query for customized numbering

Former Member
0 Kudos

Hi,

Below is the query that used to generate a customized number for service call

It was set to auto generate when user select the customer code.

The number will increment only if the service call is created.

Before it has no issue  if one user create a service call at one time.

However, I found a issue when A user open a service call and number was generated (ABC0001), user haven't create the service call.

At the meantime, B user also opening a service call and number was generated (ABC001), B user  created the service call, following by A user.

So when I run a report, there will be two ABC001.

So wonder is this issue due to query or some other setting ?

Declare @fmt_num as Integer

Select @fmt_num=count(OSCL.CallID) from OSCL

SELECT 'ABC'+ replace(str((@fmt_num)+1,7,0),' ',0)

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

As explained in your previous thread, its due to call id.

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

Thanks & Regards,

Nagarajan

Former Member
0 Kudos

Hi,

But this is a customized numbering format, is it possible to make it same effect as call id?

Thanks

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Checked above query with two user. For example, if user B created service call with number 4, then user A not possible to add same number. System throws an error message,

"Enter valid number; document number already exists"

Thanks & Regards,

Nagarajan

Former Member
0 Kudos

Hi,

Are you sure the above query will generate the message if meet the condition mentioned?

Because I used the query on the user defined value - setup

It will still allow user to create the service call and end up with duplicate number.

Thanks

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Tested conditions are:

1. Above query is added in document number field user defined setup.

2. Manual series selected for this case.

3. There is no other series or document number for service call in document numbering settings

4. 8.81 PL10

Thanks & Regards,

Nagarajan

Former Member
0 Kudos

Hi,

Do you add the query to the field below? Is that what you mean?

I try that, but it will not work because the query include the alphabetic, which systems not allow.

Correct me if I am wrong

Thanks

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Yes you are correct, just neglected alphabets to check whether system allows same number or not.

Thanks & Regards,

Nagarajan

Former Member
0 Kudos

Hi,

it will work if without the alphabets, but what if I want to keep the alphabets, is there any alternative other than this method?

Thanks

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

1. Create header UDF

2. Assign your query to get customized number ( ABC0000005)

3. There is no message if two users are open service and update.

Thanks & Regards,

Nagarajan