Barcode 128 interpreter in NAV Classic Client

frytachfrytach Member Posts: 8
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

Comments

  • vaprogvaprog Member Posts: 1,141
    Hi Jörn,

    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
    • geting the barcode reader to send the FNC1 code (variable length field terminator) is such a way that you can see it from within NAV
    • handling barcodes that do not adhere to the standard, e.g using wrong field lengths, not using an FNC1 symbol where one was required, using wrong AIs ...Usually you need a table with field compositions to handle those illegal codes (something like: if the value with AI xx is equal to xyz then the length of AI yy is z), unless you can either ignore them or force your vendors to send you correct codes.
  • mdPartnerNLmdPartnerNL Member Posts: 802
    For a transport customer we created a special definition file to recognize barcodes from suppliers, some kind of IFTMIN it is called:

    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.
Sign In or Register to comment.