SCENARIO DESCRIPTION:
Automatic generation of Batch and serial numbers for Goods Receipt PO
SOLUTION
Main definitions are done in the Beas Configuration Wizard. If a serial number is to depend on a Work Order, this can be done automatically with a Beas script (function call) at runtime.
Configuration Wizard
In the Configuration, the structure of the batch or serial number for an automatic generation can be predefined.
1. Batch Numbers
The Automatic batch determination option in the item master data must be activated for the functionality.
Batch Number Assignment
A template is available to determine the format of the generates the next batch number. This template has several configuration options. Using:
- simple decimal (0-9) or alphanumeric (0-9 A-Z) counter systems
- placeholders in the counter system
- free configuration with the extended setup
- a Beas script function
Simple decimal (0-9) or alphanumeric (0-9 A-Z) counter systems
Determines the template for the batch number structure.
- xxx: Continuous number.
- XXX: Alphanumeric number. This is the default setting.
- aaa: Numeric without truncating the number.
The counter type is determined, by searching the letter x, then a, then X. If an x is found, an a or X would be ignored.
The number of letters determines the number of displayed digits. The characters xxx means 3 digits. Shorter numbers are filled with initial zeros, longer numbers are truncated, except when "XXX" is used. in this case. The minimum amount is determined, but longer numbers are not truncated.
The structure can be combined with other characters:
ABX2009-xxxx-V -> will generate: ABX2009-0001-V, ABX2009-0002-V
Placeholders in the counter system
Placeholders can be used in the template, which are then replaced during run time.
The following variables are available:
e_ItemCode: Itemcode
e_DocEntry: Work order document number
e_LineNumber: Work order position
e_LineNumber2: Bill of Material position (example negative quantity produce receipts...)
Example:
ABX-< e_DocEntry>-< e_LineNumber>-<today,yymm>-xx
Placeholders are replaced by work order and the current date.
The work order document is 123, the Position is 10, today is October, 20th 2012 and the next counter is 5:
Generated Number: ABX-123-10-1210-5
Free configuration with the extended setup
In the extended settings, the counter system can be freely configured. It is also possible to insert multiple counters after each other.
As the counting system does not have to be decimal and it may not be possible to convert from decimal to the counter, the default counter statuses cannot be used.
For more information see Beas F1-Help
A Beas script function
The Beas script language will be used to create batch numbers. Therefore the “user events“ concept from Beas is taken.
You need the function “GetBatchNumber” in the Stockmanagement.
The new Batch Number will be defined in variable “e_DistNumber”.
If this this variable is not set/defined, the system use the settings in Configuration Wizard.
Example:
// DistNumber = today (yyyy/mm/dd) + "-" + new counter for every day
// Example: 20200501-0001, 20200501-0002, 20200501-0003 ...
function GetBatchNumber
// get my previous Batch Number
select coalesce(max(substring("DistNumber",10,4)),0) into myCounter &
from "OBTN" &
where left("DistNumber",9) = '<today,yyyymmdd>-'
// prepare the result
setvar=myCounter=%numadd(myCounter,1)
setvar=myCounter=000<myCounter,#0>
// write the new generated Number into the batch number variable
setvar=e_DistNumber=<today,yyyymmdd>-<myCounter,right 4>
end function
Batch counter
This option defines which batch counter should be used. This will only work if no function in the stockmanagement is defined for the batch generation.
There are 3 counters available. The current value of each counter will be stored in the
table BEAS_SYS_SETUP and line with variable_id:
- Counter 1: chargenzaehler1
- Counter 2: chargenzaehler2
- Counter 3: chargenzaehler3
2. Serial Numbers
The Automatic serial determination option in the item master data must be activated for the functionality.
Serial number assignment
It’s the same logic as for Batches. But it is still described here.
A template is available to determine the format of the generates the next serial number. This template has several configuration options. Using:
- simple decimal (0-9) or alphanumeric (0-9 A-Z) counter systems
- placeholders in the counter system
- free configuration with the extended setup
- a Beas script function
Simple decimal (0-9) or alphanumeric (0-9 A-Z) counter systems
Determines the template for the batch number structure.
- xxx: Continuous number.
- XXX: Alphanumeric number. This is the default setting.
- aaa: Numeric without truncating the number.
The counter type is determined, by searching the letter x, then a, then X. If an x is found, an a or X would be ignored.
The number of letters determines the number of displayed digits. The characters xxx mean 3 digits. Shorter numbers are filled with initial zeros, longer numbers are truncated, except when "XXX" is used. in this case. The minimum amount is determined, but longer numbers are not truncated.
The structure can be combined with other characters:
ABX2009-xxxx-V -> will generate: ABX2009-0001-V, ABX2009-0002-V
Placeholders in the counter system
Placeholders can be used in the template, which are then replaced during run time.
The following variables are available:
e_ItemCode: Itemcode
e_DocEntry: Work order document number
e_LineNumber: Work order position
e_LineNumber2: Bill of Material position (example negative quantity produce receipts...)
Example:
ABX-< e_DocEntry>-< e_LineNumber>-<today,yymm>-xx
Placeholders are replaced by work order and the current date.
The work order document is 123, the Position is 10, today is October, 20th 2012 and the next counter is 5:
Generated Number: ABX-123-10-1210-5
Free configuration with the extended setup
In the extended settings, the counter system can be freely configured. It is also possible to insert multiple counters after each other.
As the counting system does not have to be decimal and it may not be possible to convert from decimal to the counter, the default counter statuses cannot be used.
For more information see Beas F1-Help.
Comments
0 comments
Please sign in to leave a comment.