Table of Contents

Step: Create Document Line and/or Document Detail Line

General

Object Id: 11242344 Function Id: 46

Purpose of step

The function creates a Document Line, a Document Detail Line, or both, on a TMS document.

Application Area

The step can only be used on TMS Document Header records. It errors when used on any other table.

Functionality

The LEVEL parameter decides what the step creates:

  • LEVEL 1 creates a Document Detail Line only. If LINENO is filled in, the step uses that Document Line, which must be of type Good. If LINENO is empty, the step creates a Document Detail Line for every Good line on the document.
  • LEVEL 2 creates a Document Line only, using GOODSCODE, GOODSUOM, and QTY.
  • LEVEL 3 creates a Document Line and then a Document Detail Line under it.

Before creating a Document Line, the step checks for an existing Good line with the same GOODSCODE (the unit of measure doesn't factor into this check). The IF EXISTS parameter decides what happens next: error, skip, or create the line anyway.

On the Document Detail Line, the step always sets Type to Carrier and Carrier Quantity to 1. Its No. comes from the first of the following that has a value:

  1. HANDLINGUNITNO
  2. The header field named in HU FIELDNO
  3. The next number from NO. SERIES

If none of these give a value, the step errors.

Parameters

Name Description
LEVEL Mandatory. 1 = Document Detail Line, 2 = Document Line, 3 = Both. Any other value results in an error.
GOODSCODE The Goods Code for the Document Line. Mandatory when LEVEL is 2 or 3.
GOODSUOM The Unit of Measure Code for the Document Line. Mandatory when LEVEL is 2 or 3.
QTY The quantity to use for the Document Line and/or Document Detail Line. A value of 0 or less is treated as 1.
LINENO The Line No. of the Document Line to create a Document Detail Line for. Only used with LEVEL 1. If empty, all Good lines are used.
HANDLINGUNITNO The Document Detail Line's No. Takes priority over HU FIELDNO and NO. SERIES.
HU FIELDNO The field number on TMS Document Header to read the Document Detail Line's No. from. Used when HANDLINGUNITNO is empty.
NO. SERIES The number series to get the next number from for the Document Detail Line's No. Used when HANDLINGUNITNO and HU FIELDNO give no value.
CARRIERTYPECODE The Carrier Type Code to set on the Document Detail Line.
IF EXISTS How to handle a Good line that already exists with the same No.: 0 or empty = error, 1 = skip, 2 = create a new line anyway.

Example

Create a Document Line for goods code PALNL, and a Document Detail Line under it with a handling unit number from the HU number series.

Name Description
LEVEL 3
GOODSCODE PALNL
GOODSUOM PLT
QTY 2
NO. SERIES HU
CARRIERTYPECODE PALLET
IF EXISTS 2