Hi,
we're working a lot with barcodes. Generating is easy and we print a lot of documents with barcodes. Also we scan our own barcodes and can use it within NAV.
Now we want to read barcodelabels from our suppliers. They use the standard GS1-128 Barcode with severel information. E.g. itemno, weight, bbd etc.
Every information has it's own identifier.
Does anyone have a NAV programmcode to "interpret" or "parse" the GS1-128 Code and separate it into the different information? We have a lof of suppliers and the information in the barcode is not the same all the time.
The NAV programmcode should'nt be too difficult but it is a lot of work to look for all possibilities. Maybe someone can help me not to reinvent the wheel again.
Thank you
Jörn
0
Comments
I cannot provide you with code, but it's not that much code to write either, at least to handle conforming barcodes. What you need is a table with field definitions (AI, description, length, Type, variable length Y/N) and most likely a buffer table to hold the recognized AI/value pairs.
The two main challenges are
Barcodes like for example UNH+647016597422895+IFTMIN:D:96B:UN+DHL3.1/BMF1.01'BGM+787+64701659+9'DTM+186:20071016:102'TSR+++01'TOD+Z01++CPT:::etc.,etc.,etc.
are recognized with below commands:
=IFT(1;TSR+;3;1)=POS(1;10) ----> (first TSR+, third field, element 1) -> (Position 1 t/m 10)
=POS(1;5)
=HNO(Length)
=STR(Value)
=EQU(Value)
=TRM(Value;Type) Type=0=Left, 1=Right, 2=Left and Right, 3=All
=LEF(Length), =LEF(StartPosition, Length)
=RIG(Length), =RIG(StartPosition, Length)
It took us a few days to create it but with more then 60 different definitions to handle it saved the customer from a lot of developer hours with every change.