WMS ZPL Functions

The functions of codeunit 11154840 "WMS ZPL Functions" are available in the Value Function Set of a ZPL layout line. They retrieve or calculate the value that is printed on the label, based on the source record of the layout (for example a WMS document detail line or a handling unit).

Note

The site uses the term Handling Unit for what the function codes and parameter descriptions below still call Carrier (table WMS Carrier).

IDENTIFIER

Returns a GS1 Application Identifier (AI) with its value, for example (00)387123456789012345, for SSCC and GS1-128 labels. The source record can be a WMS document header, document line, document detail line, handling unit (WMS Carrier) or document carrier number reservation; other source tables are not supported.

Supported identifier codes:

  • 00 SSCC: the NVE/SSCC-18 No. of the detail line or handling unit; with SSCC or CARRIER = 1 the Carrier No. is used instead. From a carrier number reservation, its Carrier No.; from a document header, the header field selected with FIELDNO.
  • 01, 02 GTIN/EAN: the detail-line field selected with FIELDNO when set; otherwise, when USEORDERUOM is on, the EAN Code of the order unit of measure (see below); otherwise the EAN Code of the customer item's unit of measure of the line. The value is left-padded with zeros to 14 positions. When no EAN code is found, the error "EAN is empty for customer item ..." is raised.
  • 10 Batch: the field selected with FIELDNO, otherwise External Batch No..
  • 11, 13 Production Date and 15, 17 Expiration Date, formatted with FORMAT (default <Year,2><Month,2><Day,2>).
  • 20 Product Variant of the customer item's unit of measure, 2 positions.
  • 21, 90, 91, 92, 93, 99, 240, 241: the detail-line field selected with FIELDNO.
  • 37 Count of trade items: the Quantity of the line, or the quantity converted to the order unit of measure when USEORDERUOM is on (see below).
  • 3100-3105, 3200-3205 net weight and 3300-3305, 3400-3405 gross weight (kg/lb); the last digit is the number of decimals.
  • 400 Customer purchase order number: the External Reference of the document header when USE_EXT_REFERENCE is on, otherwise its External Document No., otherwise the document number.
  • 421 Ship-to postal code, prefixed with the ISO numeric country code: from the Ship-to Address No. of the document line, or of the document header when USESHIPTOFROMHEADER is on or the line has none.
  • 422 Country of origin: the field selected with FIELDNO, otherwise the Country of Origin Code of the document line or of the customer item.
Parameters
  • CODE: Code - Identifier code (lookup on the GS1 label codes), default 00.
  • INCL. IDENTIFIER: Boolean - Include the identifier code in the result, e.g. (00); default true.
  • INCL. GS: Boolean - Include the group separator (>8) after variable-length fields; default true.
  • FIELDNO: Integer - Optional: field number of the source record whose value is used instead of the default field; default 0.
  • FORMAT: Text - Optional: format for date fields, default <Year,2><Month,2><Day,2>.
  • FILLCHAR: Text - Optional: fill character used to pad the value on the left.
  • FILLPRE: Integer - Optional: length to which the value is padded on the left with FILLCHAR.
  • SSCC or CARRIER: Integer - For AI 00: 0 = SSCC number, 1 = handling unit number (Carrier No.).
  • COPYSTR: Integer - Optional: start position from which the value is copied.
  • USE_EXT_REFERENCE: Boolean - For AI 400: use the External Reference of the document; false (default) uses the External Document No.
  • USESHIPTOFROMHEADER: Boolean - For AI 421: use the Ship-to Address of the document header instead of the document line; default false.
  • USEORDERUOM: Boolean - Use the order unit of measure for the EAN code (AI 01/02) and the quantity (AI 37); default false.

Order unit of measure (USEORDERUOM)

With USEORDERUOM = true, AI 01/02 and AI 37 are based on the order unit of measure of the shipment line instead of the unit of measure of the detail line. The order unit is taken from the Order Unit of Measure Code of the detail line; when that is empty, from the VAL process line the detail line belongs to; otherwise from the document line the detail line belongs to.

The conversion is applied only when all of the following are true; otherwise the function behaves as if the parameter were off:

  • An order unit of measure is found and it differs from the Unit of Measure Code of the detail line.
  • The detail line has a Customer Item No. and the order unit exists as a unit of measure of that customer item.

Result:

  • AI 01/02: the EAN Code of the order unit, left-padded with zeros to 14 positions. A FIELDNO value takes precedence. When the order unit has no EAN code, the EAN code of the line unit is used as before.
  • AI 37: the base quantity of the line divided by the Qty. per Unit of Measure of the order unit. The base quantity is Quantity (Base) of the line; when that is 0 it is calculated as Quantity times the Qty. per Unit of Measure of the line unit. A line with quantity 0 prints 0. Example: 60 PCS shipped for an order of 5 BOX (12 PCS per BOX) prints 5.

When the label is printed from a handling unit, the function looks up the shipment detail line of that handling unit with the same customer item and unit of measure as the handling unit content, and uses its order unit, base quantity and quantity per unit. Handling units that hold several customer items or units therefore print the values of the matching item. Only shipment detail lines are considered; receipt and transfer lines are not.

DESCRIPTION

Get Field Value from Customer Item table.

Parameters
  • FIELDNO: Integer - Field number of the Customer Item table.

UOMSTRING

Get Unit of Measure String. This function has no parameters.

MONTHSTRING

Get Month Expiration String. This function has no parameters.

MONTHSTRDDMMYY

Get Month Expiration String DD MM YY.

Parameters
  • SEPERATOR: Code - Separator between day, month and year; default /.

MONTHSTRPRODDDMMYY

Get Month Expiration String DD MM YY (same description as MONTHSTRDDMMYY in the function list); this variant returns the Production Date of the line instead of the expiration date.

Parameters
  • SEPERATOR: Code - Separator between day, month and year; default /.

CONSTANTE

Set Constant Value.

Parameters
  • CONSTANTE: Code - The constant value to return; default |.

GETATTRIBVALFROMDH

Get Attribute value from document header.

Parameters
  • ATTRIBCODE: Code - Attribute Code.
  • ERRORIFEMPTY: Boolean - Error if no value found; default false.

GETZPLFORADDRESNO

Get ZPL Code for Address No.

Parameters
  • ADDRESSNO: Text - Returns the ZPL code for this address.

GETZPLSHIPTOADDRESS

Get ZPL Code for Ship-to Address.

Parameters
  • ONLYCODE: Boolean - Returns only the code of the address; default false.
  • ADRESFROMLINE: Boolean - Returns the address from the document line and creates the address; default false.
  • USEDOCLINE: Boolean - Get the Ship-to address from the document line; default false.
  • PRIOWHSEACT: Boolean - Priority on warehouse activities first; default false.
  • USECONSIGNEE: Boolean - Use the Consignee address if it exists; default false.
  • USEDOCADDRESS: Boolean - Use the document address if it exists; default false.

GETZPLFROMADDRESS

Get ZPL Code for From Address.

Parameters
  • ONLYCODE: Boolean - Returns only the code of the address; default false.
  • INCLPOSTED: Boolean - Search also posted documents (warning: can cause performance issues); default false.

GETAWBSTRING

Get String with AWB + Qty for ZPL. This function has no parameters.

GETDOCNO

Get Document header Number.

Parameters
  • DOCTYPE: Integer - Document Type; default 1.
  • INCLPOSTED: Boolean - Search also posted documents (warning: can cause performance issues); default false.

GETEXTERNALDOCNO

Get External Document No. This function has no parameters.

GETEXREFERENCE

Get External Reference. This function has no parameters.

GETSHIPTOADDFROMLINE

Get ZPL Code for Ship-to Address From Line (X-Dock).

Parameters
  • ONLYCODE: Boolean - Returns only the code of the address; default false.

GETFVDOCHEADER

Get Field Value From Document Header.

Parameters
  • FIELDNO: Integer - Field No.
  • PRIOWHSEACT: Boolean - Priority on warehouse activities first; default false.
  • POSTEDFILTER: Integer - 0 = All, 1 = Unposted, 2 = Posted.
  • DOCTYPEFILTER: Text - Filter on Document Type.

GETTOTALCC

Get Total Quantity Carrier Content. This function has no parameters.

CHECKMIXEDCARRIER

Check if carrier contains mixed content.

Parameters
  • ON TRUE: Same type as the line value - Return value if Mixed = TRUE.
  • ON FALSE: Same type as the line value - Return value if Mixed = FALSE.

GET1OFXLABELS

Get text-string X-of-N, based on labels. Returns Text on a text line and Boolean on a boolean line.

Parameters
  • SEPERATOR: Text - Optional: separator sign.
  • PER DOC LINE: Boolean - Optional: per document line.
  • NOT ONLY GRND CARR: Boolean - Optional: not only ground carriers.
  • TOTALFROM: Boolean - Optional: take the total quantity from the document header (expected ship carriers).

LABELNO

Get Label No., based on the number of copies set using ^PQ. This function has no parameters.

GET1OFXLABELSINTRIP

Get text-string X-of-N, based on labels in Trip.

Parameters
  • SEPERATOR: Text - Optional: separator sign.
  • NOT ONLY GRND CARR: Boolean - Optional: not only ground carriers.

GETZPLADDRESSFORCUST

Get ZPL Code for Customer.

Parameters
  • CUSTNO: Text - Returns the ZPL code for the address of this customer.

GETNOOFXPRINTS

Get Label No., based on the number of copies.

Parameters
  • SEPERATOR: Text - Optional: separator sign.

GETDATETODAY

Get date TODAY. This function has no parameters.

GETDAYNUMBER

Get Day Number.

Parameters
  • INPUTDATE: Same type as the line value - Input Date.
  • DAYOFFSET: Same type as the line value - Day offset 0 - 6.

GETZPLFORCOMMENTCODE

Get ZPL Code for Comment Code.

Parameters
  • COMMENTCODE: Text - Returns the ZPL code for this comment code.
  • ITEMNO: Text - Returns the ZPL code for this item number.

GETXFROMYINSHIPMENT

Get text-string X-of-N, based on warehouse activities and detail lines.

Parameters
  • SEPERATOR: Text - Separator sign.
  • BEFOREPOSTING: Text - Before posting the warehouse activity.
  • ACTFILTERDETLINE: Text - Filter activities with a detail line with this detail line number.

GETZPLCODESPLITTED

Get ZPL Code Splitted.

Parameters
  • INPUTTEXT: Text - Text to split.
  • LENGTH: Integer - Maximum length per word.

GETNOFXCARRIERNO2

Get text-string X-of-N, based on labels.

Parameters
  • SEPERATOR: Text - Optional: separator sign.
  • NOT ONLY GRND CARR: Boolean - Optional: not only ground carriers.

GETSECTIONVIA

Get VIA 1 or 2 (AWB label).

Parameters
  • VIA: Text - 1 = Via 1, 2 = Via 2; default 1.

GETXFROMDOCPACKLINE

Get X of Document Package Line.

Parameters
  • UNIQUEFIELDNO: Integer - Field No. for the unique value.
  • SEPERATOR: Text - Separator sign.
  • DISTINCT COUNT: Boolean - Count unique records for the unique field number.

GENERATESAVELABELS

Generate and Save Labels.

Parameters
  • LAYOUTCODE: Code - ZPL Layout Code (lookup on ZPL layouts).
  • OBJECTID: Integer - Object ID to save the file.
  • OUTPUTFORMAT: Integer - 0 = PNG, 1 = PDF, 2 = IPL, 3 = EPL, 4 = DPL, 5 = SBPL, 6 = JSON.
  • FILENAME: Text - File name for the saved file.
  • INDEX: Integer - Label number to return; -1 is all labels.

GET1OFXTRANSINSHIP

Get X of Transfers in Shipment.

Parameters
  • SEPERATOR: Text - Separator sign.

GETZPLREPOSITORY

Get ZPL text from ZPL Repository by entity (item, customer or source record) and code. Returns the complete ZPL string that is stored in the ZPL Repository for the record determined by ENTITY and the code given in CODE, for example a ^GFA graphic block. Intended for layout lines of type Image, where the result is printed at the X and Y coordinate of the line. The stored text is returned unchanged.

The record is determined as follows:

  • ITEM (default when ENTITY is empty): the customer item. With NO filled, that customer item number is used. Otherwise the customer item is taken from the source record: the Customer Item No. of a document detail line or handling unit content, the No. of a document line, the first content of a handling unit (WMS Carrier), or the customer item itself.
  • CUSTOMER: the customer. With NO filled, that customer number is used. Otherwise the customer is taken from the source record: the Sell-to Customer No. of a document header or document line (for a detail line via its header, falling back to the Customer No. of its customer item), the Customer No. of the customer item of a handling unit or handling unit content, or the customer itself.
  • SOURCE: the source record of the layout itself, whatever its table. NO is ignored.

When the entity value is unknown, the record cannot be determined, no repository entry exists for the code, or the entry has no ZPL text, the function returns an empty value without an error.

Parameters
  • CODE: Code - ZPL Repository code, e.g. FRONT.
  • ENTITY: Text - Entity: ITEM (default), CUSTOMER or SOURCE (the record the label is printed for).
  • NO: Text - Optional: customer item no. (ITEM) or customer no. (CUSTOMER); empty = taken from source record. Ignored for SOURCE.