cancel
Showing results for 
Search instead for 
Did you mean: 

batch nos and serial nos

Former Member
0 Kudos
312

hi all,

i would like to know if there is any to make the serial nos and batch nos sequetial?

i.e.

i make a grpo for an item today, i create batch nos or serial nos for the entire quantity. and the next time i get the same item i want to know wat was the last batch or serial no assigned for that particular item.

eg : if for item A the last batch created was batch no 78 , can that be displayed while i am creating a new batch for 'A' ,so that ill know that this new batch should be numbered as 79? or better can the next new batch number or next new serial no be made to automatically suggest while i creating a batch or serial no for a newly recieved qty.

hope someone can help me out.. thank u

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Another option is to check the last (if your serials are incrementing numbers) SN with this quick query:

SELECT max(T0.IntrSerial) from OSRI T0 where T0.ItemCode = [%1\]

Former Member
0 Kudos

HI Ujlaki Natalia ,

THANKS YOU UR REPLY.. I TRIED UR QUERY.. BUT ITS RETURNING SOME RANDOM SERIAL/BATCH NO OF THE PARTICULAR ITEM.. EVEN THOUGH I CREATED NEW SERIAL NOS AND BATCH NOS .. THE NEXT LAST SERIAL OR BATCH NO IS NOT SHOWN ..WHEN I PRESS SHIFTALTF2.. I WANT THE VERY LAST SERIAL OR BATCH NO TO BE DISPLAYED OR RETURNED SO THAT I CAN CREATE THE NEW BATCH NO OR SERIAL NO WITH LAST BATCH NO OR SERAIL NO +1.. CAN U HELP?

Former Member
0 Kudos

Hi,

This query should not be used as a formatted search. It is a query you can run separately at the stage of serial number setup and it will only give you information on the last used serial number so you will know which one should be used next. I don't know if there is a way to create them automatically with a FS.

Also bear in mind, that the query works only if you have added serials of incrementing numbers otherwise it will retrieve the maximum number from all of your serials.

Nat

former_member583013
Active Contributor
0 Kudos

The Formatted Search can only get the Last Serial number OR Batch number saved in the Database.

Example:

If the Last Batch Number saved in the DB for 480, When you use the formatted seach you would get 481

BUT, in a multi use environment, if 2 people are receiving the same Item, both the users will get the same batch number 481, Who ever commits the transaction first will use up 481 and when the second user Add the transaction the Duplicate Batch number message would appear.

There is not really a perfect solution to this. But, using Formatted Searches is definitely an option.

Suda

Former Member
0 Kudos

HI SUDA,

But the above query is not showing any result in the query generator.. if i still save it and usE it in the formmatted search ... its showing a number but not the last serial number saved in the DB... For ex.. item 01's last serial no is B-800.. But the system gives B-99 in the FMS.. ANY IDEA Y?

Hey.. i created a query to show all the serial nos item 01..

In the result the serail nos are jumbled up.. and the B-800 is shown some where among all the numbers where as B-99 is the 800th serial no .. so this jumbling of serial numbers is wat is not retriving the last serial no.. can u help me out with that?

Edited by: PINKY N on Mar 19, 2008 8:40 AM

former_member204969
Active Contributor
0 Kudos

If you want to get the last assigned serial number in an FS, you can use the query:

SELECT top 1 T0.IntrSerial
 FROM OSRI T0
 WHERE T0.ItemCode = $[OSRI.ItemCode]
ORDER BY T0.SysSerial desc

former_member583013
Active Contributor
0 Kudos

Pinky,

Let me know if using the B- suffix is a standard for all Serialized Items.

Suda

Former Member
0 Kudos

hey suda...

no B is not standard.. the suffix keeps changing... i also found out that the MAX function does not consider null or 0s and it is comparing the numbers bit by bit .. hence the system thinks 99 is higher than 100 ,999 is higher than 1000 and so on...

natalia_katunin
Advisor
Advisor
0 Kudos

I would suggest using the following queries to fetch next number to use:

For serial numbers:

SELECT MAX(cast(T0.IntrSerial as int)) +1

FROM OSRI T0

WHERE T0.ItemCode = "itemCode"

For batches:

SELECT MAX(cast(T0.BatchNum as int)) +1

FROM OIBT T0

WHERE T0.ItemCode = "itemCode"

Edited by: Natalia Katunin on Mar 20, 2008 1:43 PM

Edited by: Natalia Katunin on Mar 20, 2008 1:43 PM

Answers (1)

Answers (1)

former_member1190345
Active Contributor
0 Kudos

Hi Pinky,

Unfortunately thereis no way in SBO to know the previous batch no. or Serial no. created during the creation of new batch or serial no.s. The only way hoever to know would be by going into Serial No. Transaction report or the btach no. transaction report and checking out the last created no. before creating teh new numbers. Maybe this can be achieved vide SDK or FMS...I am not sure about that.

Nagesh