Import/export template >  Module Stock >  Import/export template INV (Cycle Counting)  

Display all Hide all

The stock count import is used to manage two cases:

  The import with update of a list previously created in Sage X3.

  The import with creation of the stock count list.

 This import template has three levels which correspond to the three tables to update: CUNSESSION, CUNLISTE and CUNLISDET.

Prerequisite

Mandatory fields in the template

Import of the list previously created in Sage X3

This type of import is used to update a list already created in Sage X3 (update of the counted quantity for example).

Table CUNSESSION

For this stock count type, the CUNSSSNUM field (session no.) must be specified in order to detect that it is an import of an existing list update. The site is also a mandatory field.

Headings

Labels

Import

Mandatory

Default

Existing physical stock count

CUNSSSNUM

Session

Yes

Yes

 

mandatory

STOFCY

Storage site

Yes

Yes

 

X

Table CUNLISTE

In this table, fields must be specified if the list is to be automatically validated after the import. This validation happens if the CUNLISSTA field = 5. STOFCY and CUNSSSNUM fields are mandatory.

Headings

Labels

Import

Mandatory

Default

Existing physical stock count

CUNSSSNUM

Session

Yes

Yes

 

mandatory

CUNLISNUM

List

Yes

 

 

 

CUNLISSTA

Status

Yes

No

1

X

STOFCY

Storage site

Yes

Yes

 

X

Table CUNLISDET

The session no., the list no. as well as the rank are mandatory to find the list to be updated. If the stock line is not present in the selected list it will be added to the list as an unplanned line.

The fields in the stock lines are important because they are used to identify if it is necessary to update the quantity for a line in the list or whether to create a new list.

 

Headings

Labels

Import

Mandatory

Default

Existing physical stock count

These being used to find an existing detail

CUNSSSNUM

Session

Yes

 

 

mandatory

CUNLISNUM

List

Yes

 

 

mandatory

ITMLISNUM

Rank

Yes

Yes

 

mandatory

STOFCY

Site

Yes

 

 

X

Those which update the physical stock count

QTYPCUNEW

UoM PAC counted stock

Yes

 

 

mandatory

QTYSTUNEW

UoM STK counted stock

Yes

 

 

mandatory

ZERSTOFLG

Zero stock

Yes

 

 

mandatory

Those that are used to find the stock line

ITMREF

Product

Yes

 

 

X

LOT

Lot

Yes

 

 

X

SLO

Sub-lot

Yes

 

 

X

LOC

Location

Yes

 

 

X

STA

Status

Yes

 

 

X

PCU

Unit

Yes

 

 

X

PCUSTUCOE

Coefficient

Yes

 

 

X

SERNUM

Serial number

Yes

 

 

X

PALNUM

Ident 1

Yes

 

 

X

CTRNUM

Ident 2

Yes

 

 

X

QLYCTLDEM

Analysis req

Yes

 

 

X

If ITMLISNUM field equals 0, then a new line is added. Otherwise, the line is updated.

Import of the list in creation

Three types of import with physical stock count creation exist:

 Partial physical stock count creation: the lists only consist of the imported stock lines (CUNSSSNUM present and not entered).

 Complete physical stock count product creation: the lists consist of all stock lines for the products present in the product range (CUNSSSNUM present and not entered and CUNLASFLG = 2).

 Complete physical stock count location creation: the lists consist of all stock lines for the locations present in the location range (CUNSSSNUM present and not entered and CUNSSSTYP = 2).

Table CUNSESSION

Headings

Labels

Import

Mandatory

Default

Creation

Stock count

Partial

Creation

Stock count

Complete

product

Creation

Stock count

Complete

location

CUNSSSNUM

Session

Yes

Yes

 

mandatory

mandatory

mandatory

CUNSSSDES

Title

Yes

 

 

mandatory

mandatory

mandatory

CUNSSSTYP

Phys count type

Yes

No

1

1

1

2

CUNSSSMOD

Proc. choice

No

 

1

1

1

1

CUNNULSTK

Product in stk

No

 

1

1

1

1

CUNSRTCOD

Stock count sort

Yes

No

1

X

X

X

CUNLASFLG

Global

Yes

No

1

1

2

1

MAXLIG

Line maximum

Yes

No

INV

 

X

X

PRCLIG

% limit

Yes

No

100

 

X

X

ITMREFxxx

Product

Yes

No

 

 

X

 

LOCxxx

Location

Yes

No

 

 

 

X

STOFCY

Storage site

Yes

Yes

 

X

X

X

The session no. field is mandatory to identify that it is physical stock count session creation (field empty in import file). The title must also be entered in the case of creation.

If the import is creation of the complete physical import for the product then the CUNLASFLG must take the value 2.

If the import is creation of the complete physical import for the location then the CUNSSSTYP must take the value 2.

Table CUNLISTE

In this table, fields must be specified if the list is to be automatically validated after the import. This validation is only available in the case of a partial physical stock count. To validate it is is necessary that the CUNLISSTA field = 5.

Headings

Labels

Import

Mandatory

Default

Creation

Stock count

Partial

CUNSSSNUM

Session

Yes

Yes

 

mandatory

CUNLISNUM

List

Yes

 

 

mandatory

CUNLISSTA

Status

Yes

No

1

X

STOFCY

Storage site

Yes

Yes

 

X

Table CUNLISDET

The session no., the list no. as well as the rank are mandatory and must be empty to indicate that this is the creation of the list.

The stock line fields are important because they are used to identify the counted lines and therefore to recover the theoretical quantity if they exist.

Headings

Labels

Import

Mandatory

Default

Creation

Stock count

Partial

Creation

Stock count

Complete

product

Creation

Stock count

Complete

location

These being used to find an existing detail

CUNSSSNUM

Session

Yes

 

 

mandatory

 

 

CUNLISNUM

List

Yes

 

 

mandatory

 

 

ITMLISNUM

Rank

Yes

Yes

 

mandatory

mandatory

mandatory

STOFCY

Site

Yes

 

 

X

X

X

Those which update the physical stock count

QTYPCUNEW

UoM PAC counted stock

Yes

 

 

mandatory

mandatory

mandatory

QTYSTUNEW

UoM STK counted stock

Yes

 

 

mandatory

mandatory

mandatory

ZERSTOFLG

Zero stock

Yes

 

 

mandatory

mandatory

mandatory

Those that are used to find the stock line

ITMREF

Product

Yes

 

 

X

X

X

LOT

Lot

Yes

 

 

X

X

X

SLO

Sub-lot

Yes

 

 

X

X

X

LOC

Location

Yes

 

 

X

X

X

STA

Status

Yes

 

 

X

X

X

PCU

Unit

Yes

 

 

X

X

X

PCUSTUCOE

Coefficient

Yes

 

 

X

X

X

SERNUM

Serial number

Yes

 

 

X

X

X

PALNUM

Ident 1

Yes

 

 

X

X

X

CTRNUM

Ident 2

Yes

 

 

X

X

X

QLYCTLDEM

Analysis req

Yes

 

 

X

X

X

For lot creations, depending on the products, the expiry date can be imported, or the current date is retained. The expiry date comes from the product record. The title can be imported, or the product record title is retained.

Error messages

In addition to the generic error messages, the following messages can appear during the entry :

The possible errors during the import are:

Consistency errors in CUNLISDET

The specified session number does not exist
"non-existing session ! non-existing session No !"

The specified list number does not exist
"non-existing list ! non-existing session n !"

PAC counted qty <> 0 and zero stock = yes!
"PAC counted qty <> 0 and zero stock = yes! non-existing session ! non-existing list ! non-existing No. CUD !"

STK counted qty <> 0 and zero stock = yes
"STK counted qty <> 0 and zero stock = yes! non-existing session ! non-existing list ! non-existing No. CUD !"

If ITMLISNUM (rank)  <> 0  and list number not specified
"missing list ! non-existing session ! non-existing rank !"

If the imported file has no counted quantity information or zero stock
"Zero import : no counted quantity information or zero stock ! non-existing session ! non-existing list ! No. CUD "

Errors according to the context, if the detail does not exist

If the STOFCY or ITMREF or STATUT or UNITE fields are missing
"fields: STOFCY, ITMREF, STA, PCU missing ! non-existing session ! non-existing list ! non-existing No. CUD !"

If the STOFCY or ITMREF or STATUT or UNITE fields are not specified
"fields: STOFCY, ITMREF, STA, PCU not specified ! non-existing session ! non-existing list ! non-existing No. CUD !"

If the unit specified is different from the STK of the product and the PCUSTUCOE field is missing
"field PCUSTUCOE missing !  non-existing session ! non-existing list ! non-existing No. CUD !"

If the specified unit is different from the STK for the product and the PCUSTUCOE field is set to 0
"field PCUSTUCOE not specified ! non-existing session ! non-existing list ! non-existing No. CUD !"

In the following cases:
If the product is managed by lot and LOT field is missing,
If the product is managed by sub-lot and SLO field is missing,
If the product is managed by series and SERNUM field is missing,
If the product is managed by location and LOC field is missing,
the following message is displayed:
"LOT, SLO, SERIE, LOC fields missing ! non-existing session ! non-existing list ! non-existing No. CUD !"

In the following cases:
If the product is managed by lot and LOT field is not specified,
If the product is managed by sub-lot and SLO field is missing,
If the product is managed by series and SERNUM field is not specified,
If the product is managed by location and LOC field is not specified,
the following message is displayed:
"LOT, SLO, SERIE, LOC fields not entered ! non-existing session ! non-existing list ! non-existing No. CUD !"

If the product does not exist:
"non-existing product ! non-existing session ! non-existing list ! non-existing No. CUD ! non-existing product !"

If the product site does not exist
"non-existing product-site ! non-existing session ! non-existing list ! non-existing No. CUD ! non-existing site !"

In case of product not managed in stock
"product not managed in stock ! non-existing session ! non-existing list ! non-existing No. CUD ! non-existing product !"

In case of not authorized stock status
"not authorized stock status ! non-existing session ! non-existing list ! non-existing No. CUD ! non-existing status !"

If the packing unit has not been found
"the packing unit has not been found ! non-existing session ! non-existing list ! non-existing No. CUD ! non-existing packing unit !"

If the location does not exist
"non-existing location ! non-existing session ! non-existing list ! non-existing No. CUD ! non-existing site !" "

If the product is managed with serial numbers and the counted quantities are <> 1 or the unit <> 1 stock unit,
"incorrect QTYPCUNEW, QTYSTUNEW, PCU fields: product managed in series ! non-existing session ! non-existing list ! non-existing No. CUD !  Non-existing product !"

For new stock count lines, if the corresponding stock line is already into a counting process
"stock line into a counting process ! non-existing session ! non-existing list ! non-existing No. CUD !"

Error reading the STOCK file

On a new physical stock count line: after detection of the corresponding stock line to retrieve the allocated element,
On an existing line: to retrieve the allocated element,
the possible error messages are:

"access error for STOCK file ! non-existing session ! non-existing list ! non-existing No. CUD ! non-existing stock chrono !"
"writing error for STOLOT file !" for new stock count lines, on a non-existing stock line and a new lot.
"writing error for STOLOT file ! non-existing session ! non-existing list ! non-existing No. CUD ! non-existing product ! non-existing lot ! non-existing sub-lot !"

Reading error for CUNLISDET file.

For imports involving the creation of a complete stock count:  after detection of the stock line previously created on an existing line, the possible error messages are the following:

"non-existing CUNLISDET record ! non-existing session ! non-existing list ! non-existing No. CUD ! non-existing rank !"
"the import file has no counted quantities on a new line and no corresponding stock line""Zero import: no counted quantity on non-existing CUNLISDET ! non-existing session ! non-existing list ! non-existing No. CUD !"
"writing error for the working backup of STOJOU file for new stock count lines, for a product that does not exist in the list"
"writing error for the working backup of STOJOU file ! non-existing session ! non-existing list ! non-existing product !"

If the imported serial number already exists, check performed for new lines without corresponding stock lines, the possible error messages are the following:

"Serial number already existing for this product ! non-existing session ! non-existing list ! non-existing No. CUD ! non-existing product ! non-existing series !"
Control of the counted quantity in the stock line with its allocated quantity. The allocated quantity must not be inferior.
"the allocated quantity is higher than the counted quantity ! non-existing session ! non-existing list ! non-existing No. CUD ! non-existing chrono stock !"
"Import prohibited for an existing detail, validated or abandoned"
"prohibited import : the detail is abandoned or already validated !non-existing session ! non-existing list ! non-existing No. CUD ! non-existing rank !"
"import prohibited in a closed existing session"
"import prohibited : the session is closed ! non-existing session !"
"the imported session number does not exist"
"non-existing session !"

Reading error for the CUNLISTE file before the validation process

"validation impossible: reading error for CUNLISTE ! non-existing session ! non-existing list !"
"the validation of an import of the complete stock count creation is prohibited, the validation must be manual"
"validation prohibited on import with creation in complete stock count ! non-existing session !"

Tables used

This template can be used in import and export modes. The data is updated in the following tables :

Table

Table description

BPDLVCUST [BPD]

Ship-to customer

CUNLISDET [CUD]

Counts

CUNLISTE [CUL]

Count worksheets

CUNSESSION [CUN]

Stock count session

FACILITY [FCY]

Sites

ITMBPS [ITP]

Supplier product

ITMFACILIT [ITF]

Products-sites

ITMMASTER [ITM]

Products

ITMMVT [ITV]

Product-site totals

ITMSALES [ITS]

Products - sales

ITMWRH [ITW]

Products-warehouses

STOCK [STO]

Stock

STOLOC [STC]

Locations

STOLOT [STL]

Lot numbers

STOPAR [STE]

Stock parameters

TABFOR [TFO]

Formula table

WAREHOUSE [WRH]

Warehouses