Customizing the LIN Segment
The LIN segment contains the details of the items on the invoice. For some of the elements in the LIN segment, you only need to add Help text and rename the field labels so they more accurately reflect your company’s needs. With other elements, you need to change the maximum lengths for some of the fields, use accumulators to calculate the number of line items, or define a constant value.
The LIN group is subordinate to the Invoice Message frame, so Sterling Gentran:Server® creates a separate frame (the Line Items frame) to contain the group data (the line item details). The system also creates a list box (the Line Items list box) on the Invoice Message frame to allow you to access the items in the list box. Each set of data is displayed as a row in the list box. After you customize the line item fields, the Line Items list box contains these four columns of data: Item No., Product Code, Quantity, and Price.
The LIN01 element (in the LIN group) contains the Line Item Number for each item in the invoice. You use the Line Item Number field to identify sequentially each line item in the invoice. You use the Use Accum function to obtain an incremental count of the number of line items. This number is used in the Control Value field (CNT02 element).
You create a list box definition for the LIN01 element to include the line number in the list box, and rename the field label to more briefly label this field. Also, you know that your users will enter no more than 99,999 line items per invoice. Each line item is numbered sequentially, starting with one so you need a maximum length of only five digits for this field. You need to change the maximum length for this field to five.
Use this procedure to count line items in the LIN segment and generate a control total in the CNT02 element of the number of line items, rename the LIN01 field label, change the field and element lengths and create the list box definition for the Line Item Number field.