Label File Interface

Label System File Interface

The generic labeling system has the ability to read a SYSPRO table record, position a table at  a starting record and loop through records in a table.

Note: The file interface exists only in releases after 1/30/2013

Note: If the [DELIMITERS] statement is used to change the default token delimiters to { and }, expand the delimiters statement with two additional characters to use for the PARAMETERS token delimiters such as < and >. Example is [DELIMITERS] {}<>.

The <START> token

The START token is used to specify where to start reading a SYSPRO table. The token requires a "Table=" parameter and optionally a "Key=" parameter.  The Table= parameter is used to specify the SYSPRO SQL table name.  The Key= parameter is use to set the table key information.  The Key= requirements are different for each table as specified below.  If the Key= parameter is not supplied the label system will use the current information it already knows. See the table below for a list of the tables and keys. A Filter= parameter may also be supplied to filter the records being returned.  See below for details on the Filter= parameter.

An example to start the sales order detail file at the first record for the sales order being processed by the label system.<START(Table=SorDetail,Key={SalesOrder})>

The <LOOP> Token

The Loop token is used to return the label file to the point of a Start token, move to the next record in the table and repeat the section.  This will continue until either the end of the table or the main key information changes (for example, the record in the sales order detail file moves to another sales order).  The Loop token will not produce any output.

Example of <Start> with a <Loop>.  The following will list the stock code one per line. 

Loop through SorDetail
<START(Table=SorDetail,Key={SalesOrder})><skip>
<MStockCode><LOOP>

Note the use of the <skip> token to tell the labling system to not output the blank line created by the <Start> token.

The <NEXT> Token

The Next token is used to move to the next record in a table.  No looping in the control file is done.  Optionally a "Table=" parameter can be supplied to specify the table to read.  If the Table= parameter is not supplied the last table used in a Start token is read.  If the end of the table is reached, the information in the table tokens will be blank.

Read through SorDetail using Next instead of Loop.
<START(Table=SorDetail,Key={SalesOrder})>
<MStockCode><Next>
<MStockCode><Next>
<MStockCode>

The Filter= Parameter

The Filter= Parameter can be added to a read or start token to filter the results.  The filter takes the form of a "IF" type statement.  In order to avoid confusion with other special token processing characters it is recommended to use the following two character codes in the IF test.  The test can only be a simple single test.

EQ = Equal
NE = Not Equal
LT = Less than
LE = Less than or equal
GT = Greater than
GE = Greater than or equal

For example  the following start token will read the EDIShipmentItem table and only return the records where the stock code is A100.

{START(Table=EDIShipmentItem,Filter=<EDIShipmentItem.StockCode> EQ A101)}

Table of tables and keys

Table Keys
SorDetail Sales Order, Line Number
EDIShipmentOrder Shipment Number, Order Number
EDIShipmentItem Shipment Number, Item Number
EDIShipmentTare Shipment Number, Tare Number
EDIShipmentPack Shipment Number, Pack Number
EDIShipmentAdd Shipment Number, Order Number, Address Number