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.

  1. Double-click the LIN01 element.
  2. On the Validation tab, enter 5 in the Max box to allow a five-digit number in this element.
  3. On the Standard Rule tab, do the following:
    • Select Use Accumulator from the list.
    • Click New to access the Edit Accumulator Entry dialog to create a new calculation using this element.
  4. From the Primary Accumulator list, select 0. Before any calculations are performed on an accumulator, its content is 0. When you use this accumulator, the system adds a new accumulator to the bottom of this list.
    Note: There is only one set of accumulators for each form. This means that accumulator 0, whether it is used in the Primary Accumulator or Alternate Accum box, is the same accumulator with the same content. If you assign calculations to accumulator 0 at the beginning of the form and then use accumulator 0 again later in the form, the content of that accumulator will be the result of the earlier calculation. Any additional calculations you assign to that accumulator will be performed on the content resulting from an earlier calculation.
  5. In the Name box, enter Item Number to give the accumulator a descriptive alias that enables you to distinguish it from other accumulators you create.
  6. From the First list, select Increment primary to specify that the system increments the value in this accumulator by one for each iteration of the LIN group. This operation is the first operation that the system performs.
  7. From the Second list, select Use primary to specify that the system loads the current value of the accumulator into the LIN01 (Line Item Number) element. This operation is the second operation that the system performs, after the first operation is completed.
  8. Click OK to add the accumulator and exit the Edit Accumulator Entry dialog.
  9. On the Display tab, do the following:
    • Select This field should be displayed but not editable.
    • In the Label box, enter Item No. to replace the existing field label.
    • In the Maximum number of characters to be printed box, enter 5 to allow five digits to be displayed in this field.
  10. On the Summary List tab, do the following:
    • Select Display this field in summary list. The value in the Item No. field is displayed in a column in the Line Items list box.
    • In the Column Width box, enter 8 to set the width of this column in the Line Items list.
      Note: The column width should be wider than the actual content of the column. The extra space that is not used for the content of the column will provide white space separating the columns. If the column width is the exact width of the data, then there will not be space separating the columns of data.
    • From the Sequence list, select 1 to indicate that this field is the first column in the list box.
  11. Click OK to exit the dialog.
  12. Double-click the CNT02 element (in the CNT segment).
  13. On the Standard Rule tab, do the following:
    • Click the Use Accumulator option.
    • Click New to access the Edit Accumulator Entry dialog to create a new calculation for this element.
  14. On the Edit Accumulator Entry dialog, do the following:
    • From the Primary Accumulator list, select 0.
    • In the Name box, enter Item Number.
    • From the First list, select Use primary to specify that the system loads the current value of the accumulator into the CNT02 (Control Value) element.
    • Click OK to add the accumulator.
  15. On the Display tab, select This field should displayed but not editable option.
  16. Click OK to exit the dialog.