Stock 150
General considerations
This document provides some help in using stock in the manufacturing and business flows.
It presents the links between documents, movements and rules (allocation/output and management).
It describes those elements necessary to enter stock from a document:
- The screen fields to describe
- The actions on fields to use
- The object actions to enter
- The sub-programs of the stock library
It describes those elements necessary to update stock from a document:
- Parameters of the interface between entry and update
- Update parameters
It also includes a few documentations useful to understand some functionalities.
Setup
Allocations
Document Condition Allocation rule Management rule 2 = Order Other orders Order Delivery Loan order Order Loan shipment 10 - Work Order Other operations Work Order WO issue Subcontract operations Subcontract consump Sub-contract order issue 36- Subcontract order Subcontract consump Sub-contract order issue
Note
The management rule is only applied to specify the locations to use.
Receipts
Movement Document Condition Management rule 1 - Miscellaneous input 19 - Miscellaneous input Miscellaneous receipt 1 - Miscellaneous input 31 - Assembly Parent product Miscellaneous receipt 1 - Miscellaneous input 32 - Disassembly Component Miscellaneous receipt 3 - Receipt 6 - Receipt Receipt 5- WO input 15 - Production reporting WO receipt 7 - Location change 29 - Stock change Subcontract loc. & mvt + Transfer input Other loc. & mvt + Stock change 8 - Quality control 28 - Quality control Quality control 9 - Status change 29 - Stock change Mvt + Stock change 12 - Delivery return 13 - Customer return Delivery return 12 - Delivery return 18 - Customer credit memo Delivery return 13 - Stock count 19 - Miscellaneous input 14 - Inter-site transfer 29 - Stock change Mvt + Transfer input16 - Receipt for subcontract
34 - Analysis request
29 - Stock change
33 - Subcontract delivery return
13 - Customer return
Delivery return
22 - Storing plan
Source document
Source document
21 - Splitting
29 - Stock change
Mvt +
Stock change
19 - Stock reintegration
12 - Material tracking
Stock reintegration
18 -Loan delivery return
13 - Customer return
Loan delivery return
Receipt for subcontract
6 - Receipt
Issues
Movement | Document | Condition | Issue rule | Management rule |
2 - Miscellaneous output | 20 - Miscellaneous output |
| Internal mvt | Misc. issue |
2 - Miscellaneous output | 31 - Assembly | Component | Internal mvt | Misc. issue |
2 - Miscellaneous output | 32 - Disassembly | Parent product | Internal mvt | Misc. issue |
4 - Delivery | 4 - Delivery |
| Shipment | Delivery |
4 - Delivery | 5 - Invoice |
| Shipment | Delivery |
6 - WO output | 12 - Material tracking | Subcon. operation | Subcon. consump. | Subcontract order output |
Other ope. | Material consump | WO issue | ||
7 - Location change | 29 - Stock change | Subcontract loc. & mvt - |
| Internal transfer output |
Other loc. & mvt - |
|
| ||
9- Status change | 29 - Stock change | Mvt - |
|
|
11 - Receipt return | 8 - Supplier return |
| Shipment | Receipt return |
13 - Stock count | 20 - Miscellaneous output |
|
|
|
14 - Inter-site transfer | 29 - Stock change | Mvt - |
| Internal transfer output |
17 - Loan delivery | 4 - Delivery |
| Shipment | Loan shipment |
20 - Delivery for subcont | 4 - Delivery |
| Subcon shipment | Delivery for subcon |
21 - Splitting | 29 - Stock change | Mvt - |
|
|
24 - Service request | 33 - Service request |
| Internal mvt | Service request |
25 - Reorder | 34 - Reorder plan | Subcontract loc | Subcon shipment | Reorder |
Other loc. | Internal mvt | Reorder | ||
29 - Subcon output | 6 - Receipt |
| Subcon. consump. | Subcontract order output |
32 - Receipt return for subcon | 8 - Supplier return |
| Receipt return for subcon |
Allocations
Processes of 'Object' type
Prerequisites
In the screen of the document lines, define (in hidden characters) those fields used to manage the allocation filter on the line with the following names:
- LOT Lot filter (data type: LOT
- LOC Location filter (data type: EMP)
- STA Status filter (type : Char(12))
Field actions
-
Grid variable (NBLIG)
Trigger |
Action |
Description |
Button |
SAISTOALL |
Allocation entry |
- on an already created line |
||
- must be called for a stable situation |
- Quantity
Trigger |
Action |
Description |
Button |
SAIALLFIL |
Entry of the allocation filter |
Exchanges between a document line and the allocation detail
Processing TRTSTOALLA (addition to TRTSTOALL: Allocation entry)
It is used to manage the interaction between a document line and the manual allocation entry.
The developer of the source function is in charge of updating this processing. The update is recognized through the abbreviation of the mask (LABR) used as parameter by action SAISTOALL (allocation entry)
It is used:
- to feed the STOALL entry mask : CHARG_PARAM
- to perform checks before saving the entry: AVANT_ENR
- to perform updates following entry saving: APRES_ENR
Other processes
Available components
The components to be used will be found in processing STKALL.
- To generate a global allocation GENSTOALL
- To delete an allocation from a document line DELALL
- To decrease the quantity of an allocation DIMALL
- To transfer an allocation from one journal to another CHGALL
- To create an allocation CREALL
- To delete an allocation SUPALL
- To modify an allocation MODALL
- To consume customer reserves CSOALL
Receipt flows
Processes of 'Object' type
Prerequisites
In the 'document headers' tables
- Define a field TRSCOD (Movement code) controlled by misc. table 14.
When creating a document, it is necessary to store the movement code of the transaction in this field in order to use it again for the next modification/deletion (independently of the chosen transaction) - Define a field ENTCOD (Auto stock journal code).
- Define a field TRSFAM (Movement group) controlled by misc. table 9.
For those transactions performing inputs
- Define a field TRSCOD (Movement code) controlled by misc. table 14 in order to further specify the input rule to be used.
- Define a field ENTCOD (Auto stock journal code).
- Define a field TRSFAMDEF (Movement group) controlled by misc. table 9.
In the screen of the document lines
- Visible fields (order and description)
Underlined fields must be entered in the document. The other fields, although they can be entered and require a value depending on the product, will only be mandatory in the 'Detail' window.
Fields in bold can be entered but they can be hidden for a specific transaction
Fields in italic are displayed and can be hidden for a specific transaction
- ITMREF: Product reference
- PCU or UOM: Packing unit of measure
- QTYPCU or QTYUOM: Quantity to enter
- PCUSTUCOE: Relation between the packing unit and the stock unit
- STU: Stock unit defined at product category level
- QTYSTU: Quantity in stock unit
- STA: Quality status
- LOCTYP: Location type
- LOC: Location number
- BPSLOT: Supplier lot
- LOT: Lot number
- NBSLO: Number of sub-lots
- SLO: Sub-lot first number
- SLOF: Sub-lot last number
- SERNUM: First serial number
- SERNUMF: Last serial number
- PRIORD: Order value (actual price. equiv.)
- MVTDES: Description of the movement
- Hidden fields
- GESLOT : Lot origin = "B" if blank lot, = "C" if lot managed by counter, = "" if lot entered. Update on lot control Default value: "" except if counter on lot ("C").
- WSTOSEQ: Number of the link between the detail lines and a document line
- WLOCSEQ: Number of the link between the detail lines and a location reservation.
- WSTOFLG: Indicator used to know, both for the document and for the stock engine, whether the line is complete or not with regard to stock fields (0=incomplete, 1=complete).
- WSRUFLG: Flag used to indicate the level of definition of the management rule of the product on the line.
-
WSTOSAI: Indicator of the stock fields to enter.
Field actions
- Default 'pending storing'location (SRGLOCDEF)
Trigger |
Action |
Description |
Selection |
STKSELQUA |
Selection of a location of 'Pending storing' type |
Control |
STKCTRSRG |
Controls the existence and location type |
Post-modif |
STKMODSRG |
Suggests replacing all the detail locations by the one entered; |
- Grid variable (NBLIG)
Trigger |
Action |
Call to processing/Description |
Init-Button |
STD |
Call STKINIBTN From STKENT |
for display depending on the buttons |
||
- detail or modification |
||
- Lot info |
||
- Lot addition |
||
Control |
STD |
Call STKCTRNBLIG From STKENT |
to manage the deletion of lines |
||
Before-Line: |
LECFICENT |
Read of the stock tables |
After-Line |
SAISTOENT |
Opening the 'stock detail' window |
SAIENTLOT |
Opening the 'Lot addition' window |
|
Button 2: |
ENTRCLI |
Authorization to open detail window: GOUVENT = 16384 |
SAISTOENT |
Opening the 'stock detail' window |
|
Button 3: |
STKINFLOT |
Lot information |
Button 4: |
STD |
GOUVLOT = GOUVLOT-mod(GOUVLOT,2) |
GOUVENT = 1 |
||
SAIENTLOT |
Opening the 'Lot addition' window |
|
Button5 |
SAISTOENTM |
Opening the 'stock modification' window |
See action object 'Before-Button' $AB5_NBLIG |
Trigger |
Action |
Description |
Post-modif |
INIZONENT |
- Read of the product and stock tables |
- Assignment of the default values |
||
- Deactivation of the non-significant fields |
Trigger |
Action |
Description |
Selection |
STKSELUOM |
Selecting the unit |
Post-modif |
STD |
- Update of the PAC unit/STK unit coef |
- Update of the STK unit quantity |
||
- Coef PCUSTUCOE activated if modifiable |
Trigger |
Action |
Description |
Post-modif |
STD |
- Update of the STK unit quantity |
Trigger |
Action |
Description |
Post-modif |
STD |
- Update of the STK unit quantity |
Trigger |
Action |
Description |
Selection |
STKSELSTA |
- Selecting the status |
Control |
STKCTRSTA |
- Controlling the status |
Trigger |
Action |
Description |
Before-Entry |
STKSUGTLO |
- Suggesting a location type |
Parameter LOCSEQ = [M]WLOCSEQ(nolign-1) |
||
Selection |
STKSELTLO1 |
- Selecting a location type |
Control |
STKCTRTLO |
- Controlling the location type |
Post-modif |
RAZLOC |
- Erases the content of the LOC field |
Trigger |
Action |
Description |
Before-Entry |
STKSUGEMP |
- Suggesting a location |
Parameter LOCSEQ = [M]WLOCSEQ(nolign-1) |
||
Selection |
SAIEMPLIB |
- Selecting a location |
Control |
STKCTREMP |
- Location control |
Trigger |
Action |
Description |
Selection |
STKSELBPLN |
- Supplier lot selection |
Post-modif |
STKAMLOF |
- Lot by default equal to the supplier lot in case of supplier lot being used |
Trigger |
Action |
Description |
Init-Button |
STKIBLOT |
Based on the conditions, addition of buttons |
* Blank lot: |
||
- Lot info |
||
Control |
STKCTRLOT |
- Checks if a blank lot is authorized |
- Checks if lot uniqueness is mandatory |
||
Post-modif |
STKAMLOT |
- Recalculates the sub-lot |
Button 1: |
STKSELLOT |
- Selection of a lot |
Button 2: |
LOTNUMCPT |
- Next lot number (counter) |
Button 3: |
LOTBLANC |
- Blank lot: loads field 'GESLOT' with "B" |
Button 4: |
STKINFLOT |
- Lot info ('blank lot', 'Counter', 'Document no.') |
Trigger |
Action |
Processing call |
Control |
STD |
- Call STKCTRNBSLO From STKACT |
Checks the validity of the number of sub-lots |
Trigger |
Action |
Processing call |
Button 2: |
STD |
- Call RECLASTLO From STKLIB |
Calculation of the last sub-lot number |
||
Control |
STD |
- Call STKCTRSLO From STKACT |
Control and assignment of the end sub-lot |
Trigger |
Action |
Description |
Control |
STKCTRSER |
- Serial number control |
Selection |
STKSELSERN |
- Serial number selection |
Object actions
- $OUVRE
- Open mask STOENTW
If !clalev[ENTW] Local Mask STOENTW [ENTW]
- Enter the names of the 'unit' and 'quantity' fields in the corresponding fields.
[M:ENTW]WZONPCU = "PCU"
[M:ENTW]WZONQUC = "QTYPCU"
[M:ENTW]WZONCCS = "PCUSTUCOE"
[M:ENTW]WZONQUS = "QTYSTU"
Do nothing " Rtz [ENTW] ". In effect, the input documents may be opened by tunnel from the storing plan, which can already contain information in STOENTW.
- Open mask STOWORK
If !clalev[STW] Local Mask STOWORK [STW]
- Initialization of masks and files for the management of locations:
Gosub STK_INILOC From STKLOC
- $SETBOUT
- If the document contains lines, the button "Delete" should be grayed-out:
Call VIREBOUT(CHAINE,"A") From GOBJET
- $LIENS
- Reset to zero of mask STOENTW
Call DELSTOENTW (-1,-1,"XXX",1) From STKENT
- Gray out all the following columns while leaving the last line activated (blank)
Call STKDISCOL From STKECR
- $LIENS_LIG
- Upon loading of the document line, it is necessary to know if the data should be displayed or not.
Call RECSTO_F From STKECR
If a data is of no significance for the document line, it is replaced with character '$'
- $FIN_PICK
- If the picking is OK:
Call STJSTOENTW From STKENT
- $RAZCRE
- Reset to zero of mask STOENTW
Call DELSTOENTW(-1, -1, "XXX", 1) From STKENT
- $RAZDUP
- Reset to zero of mask STOENTW:
Call DELSTOENTW(-1, -1, "XXX", 1) From STKENT
- Reset the stock fields to zero:
STA, LOCTYP, LOC, BPSLOT, LOT, NBSLO, SLO, SLOF, GESLOT, SERNUM, SERNUMF, PALNUM, CTRNUM, PRIORD, MVTDES, WSTOSEQ
and reinitialize them.
- Automatic opening of the "Details" window if needed
Call OUVENT From STKENT
- $AAPRES_NBLIG
- Automatic opening of the "Details" window if needed
Call OUVENT From STKENT
- $ABn_NBLIG
n = number of the "Detail modification" button
- Specify that the detail should be opened:
GOUVENT=2
- $BBn_NBLIG
n = number of the "Detail modification" button
- If the line has been modified
mkstat = 4
- Checks that all the lines can be saved.
Call CTLSTOENT From STKECR
- $VERIF_MOD
- Checks that all the lines can be saved.
Call CTLSTOENT From STKECR
- $VALLIG
- In case of line creation, load the STOWORK screen and call the Stock update:
If SIGN=1
Call ALISTOWORK(2,[M:XXX]WSTOSEQ(NOL),LQTA,LSHT,LRET) From STKINT
Call MAJ_STOCK From STKMAJ
Endif
- $APRES_CRE
- If the printing of the labels is requested by the transaction (PRNCOD>1)
Local Char PARAM(GLONVCR)(1..4) , VALEUR(10)
PARAM(1) = [M:XXX]STOFCY
PARAM(2) = num$([M:XXX]VCRTYP)
PARAM(3) = [M:XXX]VCRNUM
PARAM(4) = [M:XXX]VCRNUM2
Call TRAITE_CHAR(VALEUR,PARAM,"ISTOLBE","SUBSLP","",4,"SPESLP") From GTRAITE
- The adjustment of stock shortages is started
Call REGFROMENT (0,"XXX","[M:XXX]CREFLG(I)=0","ITMREF",[M:XXX]STOFCY) From TRTSHTCOM
- $APRES_MOD
- If the printing of the labels is requested by the transaction (PRNCOD>1)
Local Char PARAM(GLONVCR)(1..4) , VALEUR(10)
PARAM(1) = [M:XXX]STOFCY
PARAM(2) = num$([M:XXX]VCRTYP)
PARAM(3) = [M:XXX]VCRNUM
PARAM(4) = [M:XXX]VCRNUM2
Call TRAITE_CHAR(VALEUR,PARAM,"ISTOLBE","SUBSLP","",4,"SPESLP") From GTRAITE
- The adjustment of stock shortages is started
Call REGFROMENT (0,"XXX","[M:XXX]CREFLG(I)=0","ITMREF",[M:XXX]STOFCY) From TRTSHTCOM
- $ABANDON
- Reset to zero of screen STOENTW
Call DELSTOENTW (-1,-1,"XXX",1) From STKECR
Exchanges between a document line and the stock detail
Processing TRTSTOENTA (addition to TRTSTOENT: Input entry)
It is used to manage the interaction between a document line and the detailed input entry.
The developer of the source function is in charge of updating this processing. The update is recognized by means of the movement type (LTYP) and the mask abbreviation (LABR) used as parameter by action SAISTOENT (input entry)
It is used:
- To load the entry mask STOENT in the $CHARG_PARAM_STOENT label
- To perform updates following the saving of the entry in the $MAJ_LIGNE_DOCUMENT label
Additions
Global variables
- GOUVENT
Variable thus built in sub-program CTR_COHERENCE_LIG
- bit 1 (1) = lot addition not OK
- bit 2 (2) = lot number to enter
- bit 3 (4) = sub-lot number to enter
- bit 4 (8) = serial number to enter
- bit 5 (16) = location to enter
- bit 6 (32) = status to enter
- bit 7 (64) = detail quantities to confirm following document quantity modif
- bit 8 (128) = label missing, should not be missing
- bit 9 (256) = number of sub-lots
- bit 10 (512) = unit <> Packing unit and Stock unit
- bit 15 (16384) = right-click opening
If the value of GOUVENT is > à 2, the line is not complete, which triggers the opening of the detail window in the document.
If the value of GOUVENT is equal to 1, the lot addition must be open, because the necessary information is not entered.
- GOUVLOT
Variable thus built in sub-program INIT_GOUVLOT
- bit 1 (1) = opening: 0=right-click, 1=auto
- bit 2 (2) = heading user 1 to enter
- bit 3 (4) = heading user 2 to enter
- bit 4 (8) = heading user 3 to enter
- bit 5 (16) = heading user 4 to enter
- bit 6 (32) = title to enter
- bit 7 (64) = not used
- bit 8 (128) = expiry date to enter
If bit1 = 0, it means that the opening of the lot addition is forced, and thus the window is open, unless no heading of the lot addition can be entered.
If bit1 = 1, the lot addition window will only be open if this is necessary: lot does not exist or addition not entered.
Issue flows
Processing of 'Object' type
Prerequisites
In the 'document headers' tables
- Define a field TRSCOD (Movement code) controlled by misc. table 14.
When creating a document, it is necessary to store the movement code of the transaction in this field in order to use it again for the next modification/deletion (independently of the chosen transaction) - Define a field ENTCOD (Auto stock journal code).
- Define a field TRSFAM (Movement group) controlled by misc. table 9.
For those transactions performing outputs
- Define parameter STKFLG (Automatic determination of the stock lines to issue).
- Define a field TRSCOD (Movement code) controlled by misc. table 14 in order to further specify the output rule to be used.
- Define a field ENTCOD (Auto stock journal code).
- Define a field TRSFAM (Movement group) controlled by misc. table 9.
In the calling object
In action OUVRE
- Open the TABALLRUL [TRU] allocation rule table
- Open the TABSTORUL [SRU] management rule table
- Open the STOWIPW [SWW] table (of quantities under processing)
- Open the ALLPAR [ALP] setup parameter and reset it to zero before calling a stock component where it is being used
- Open the STOSORW [SOW] backup screen
- Open the STOWORK [STW] stock interface screen
In the screen of the document lines
- Define a WSTOSEQ field (long integer) in order to manage the link between the document line and the stock lines of the backup screen (STOSORW)
- Define the STOMGTCOD field (local menu 215 ) that specifies the product stock management
- Define the stock fields that can be entered on the line with the following names:
LOT, SLO, LOC, STA, SERNUM, SERNUMF, MVTDES
These fields need to be deactivated (using a grizo, or a mkstat=2) depending on the product characteristics
Recall
Line loaded but not created: [M]CREFLG(nolign-1)=0
Line already created: [M]CREFLG(nolign-1)<>0
Warning
Whenever a document line has been entered (the end of the line has been reached), the lot, sub-lot, serial, location, status, etc. fields can no longer be accessed. Only the quantity can be accessed.
Field actions
- Grid variable (NBLIG)
Trigger |
Action |
Call to processing/Description |
Before-Line: |
STD |
Call INIZONSOR From STKECR |
Control |
STD |
Call DELSTOSORW From STKSOR |
|
|
- if a line is deleted during creation |
Init-Button |
STD |
GOUVSOR=1 |
Button |
SAISTOSOR |
Output entry |
|
|
- on a line loaded but not created |
|
|
- on a line already created, if journal with validation not validated |
Button |
SAISTOSORM |
Modification of the outputs |
|
|
- on an already created line in the event of a journal without validation |
|
|
- on a line already created, if journal with validation validated |
|
|
This action must only be called for a stable situation |
After-Line |
SAISTOSOR |
Output entry |
|
|
See the object action 'Before-Field' $AAPRES_NBLIG |
- Product (ITMREF)
Trigger |
Action |
Processing call |
Post-modif |
STD |
Call INIZONSOR From STKECR |
|
|
Call STKINIEMPS From STKLOC |
- Quality status (STA)
Trigger |
Action |
Description |
Selection |
STKSELSTA |
Status selection |
Control |
STKCTRSTA |
Status control |
- Location (LOC)
Trigger |
Action |
Description |
Selection |
STKSELEMP |
Location selection |
Control |
STKCTREMPS |
Location control |
- Lot (LOT)
Trigger |
Action |
Description |
Selection |
STKSELLOT |
Lot selection |
Control |
STKCTRLOTS |
Lot control |
- Sub-lot (SLO)
Trigger |
Action |
Description |
Control |
STKCTRSLOS |
Sub-lot control: |
- Serial number (SER)
Trigger |
Action |
Call to processing/Description |
Post-modif |
STD |
Call CTLSORSER From STKSOR |
|
|
Serial no. control and calculation of end serial no. |
Object actions
- $OUVRE
- Open mask ALLPAR
If !clalev[ALP] Local Mask ALLPAR [ALP]
- Open mask STOSORW
If !clalev[SOW] Local Mask STOSORW [SOW]
- Open mask STOWORK
If !clalev[STW] Local Mask STOWORK [STW]
- $LIENS
Before Gosub LIENS From TABLEAUX
- Reset to zero of live mask STOSORW
Call RAZSTOSORW From STKSOR
After Gosub LIENS From TABLEAUX
- Graying-out of the stock fields
Call ETAZONSOR From STKECR
- $LIENS_LIG
- Upon loading of the document line, it is necessary to know if the data should be displayed or not. If a data is of no significance for the document line, it is replaced with character '$'
Call RECSTOSOR From STKECR
- $RAZCRE
- Reset to zero of live mask STOSORW
Call RAZSTOSORW From STKSOR
- $RAZDUP
- Reset to zero of live mask STOSORW
Call RAZSTOSORW From STKSOR
- $AAPRES_NBLIG
- Defines the action to carry out to identify the stock to be issued
In the event of a line entered but not created or if the line has already been created (journal with validation not validated)
Call OUVSOR From STKSOR
- This leads to:
- the write in STOSORW
- or the launch of sub-program GENSTOSORW
- or the execution of action SAISTOSOR
- $VERIF_CRE
- Checks that all the lines can be saved.
Call CTLSTOSOR From STKECR
- $VERIF_MOD
- Checks that all the lines can be saved.
Call CTLSTOSOR From STKECR
- $VALLIG
- Document with validation not validated:
- if new line: TRTLIG=‘C‘
- or modified line (before transclass [M]-->[F]): TRTLIG=‘M‘ & SIGN=-1
- or deleted line: TRTLIG=‘A‘
Call ENRSTOALL From STKALL
- Document without validation:
- if new line: TRTLIG=‘C‘
Call ALISTOWORK From STKINT (origin = screen STOSORW)
- $ABANDON
- Reset to zero of screen STOSORW
Call DELSTOSORW From STKECR (with line no. =-1)
Picking
- Order or WO picking
- Sub-program CTLALL From STKALL to check the quantity to issue (what is being picked upon control)
- Sub-program ALISTOSORW From STKSOR if the picking is OK
- Sub-program OUVSOR From STKSOR to automatically determine the lines to issue or warn that they will need to be selected (in that case LRET=1, the product will need to be emphasized in red on the document line)
- Receipt picking (from the supplier returns)
- Sub-program STJSTOSORW From STKSOR if the picking is OK
- Sub-program OUVSOR From STKSOR to automatically determine the lines to issue or warn that they will need to be selected (in that case LRET=1, the product will need to be emphasized in red on the document line)
- Unpicking
- Sub-program DELSTOSORW From STKSOR with the no. of the unpicked line to delete from the live screen those stock lines which had been selected
Exchanges between a document line and the stock detail
Processing TRTSTOSORA (addition to TRTSTOSOR: Output entry )
It is used to manage the interaction between a document line and the detailed stock entry.
The developer of the source function is in charge of updating this processing. The update is recognized through the abbreviation of the mask (LABR) used as parameter by action SAISTOSOR (output entry)
It is used:
- To load the entry mask STOSOR in the $CHARGE_PARAM label
- To perform updates following entry saving in the $APRES_ENR label
Other processes
Output document generated automatically (GTRAITE processing)
Document with validation not validated:
- Source document with global allocation
To delete allocations from the line of the source document: DELALL From STKALL
To decrease the allocations from the line of the source document: DIMALL From STKALL
To generate the allocations of the line of the destination document: GENSTOALL From STKALL
- Source document with detailed allocation
To control the quantity to issue: CTLALL From STKALL
To transfer the allocations of the document line : CHGALL From STKALL
Document without validation
- Source document with global allocation
To delete allocations from the line of the source document: DELALL From STKALL
To decrease the allocations from the line of the source document: DIMALL From STKALL
To generate the allocations of the line of the destination document: GENSTOALL From STKALL
To load the stock update interface screen: ALISTOWORK From STKINT
To update stock: MAJ_STOCK From STKMAJ
- Source document with detailed allocation
To control the quantity to issue: CTLALL From STKALL
To transfer the allocations of the document line : CHGALL From STKALL
To load the stock update interface screen: ALISTOWORK From STKINT
To update stock: MAJ_STOCK From STKMAJ
Validation
Output validation
A document can be validated using a button on said document, or automatically via a processing.
For that purpose, the following sub-programs should be called:
- Loading of the interface screen for stock update
Call ALISTOWORK From STKINT (source = table STOALL)
- Stock update
Call MAJ_STOCK From STKMAJ
Update of the stocks
Interface between entry and update
Interface between entry and update
Stock is updated from a single backup screen STOWORK [STW]. It is therefore necessary to use a loading interface for this screen.
The various sources of the data used in this interface processing are the following:
- Table STOALL (Allocations)
- Screen STOENTW (Input storage screen)
- Screen STOSORW (Output storage screen)
- Screen STOENTM (Input modification screen)
- Screen STOSORM (Output modification screen)
- Screen STKSHTREG (Output adjustment screen)
- Screen STOCHGW (Stock change screen)
- Table CUNLISDET (Stock count)
- Table STOJOU (Stock movements)
The information required to update stock is loaded in screen STOWORK.
- Loading of the interface screen for stock update
Call ALISTOWORK From STKINT
Update
Stock update
- Stock is updated for a document line from screen STOWORK [STW]
Call MAJ_STOCK From STKMAJ
Content of screen STOWORK depending on the various flows
- INPUT FLOW
Receipts
- Miscellaneous receipt
- Receipt
- Sub-contract receipt
- Production reporting
Negative outputs
- Customer return
- Stock reintegration
Location changes
- Loan return
- Sub-contract delivery return
- Creation
Movement |
MAJTYP |
MAJCOD |
Quantity |
STOCOU |
LOC |
LOCDES |
Other fields |
Enter key |
E |
C |
+ |
|
Enter key |
|
Enter key |
Output - |
S |
C |
- |
|
Enter key |
|
Enter key |
Loc change |
C |
C |
+ |
Issue |
Issue |
Enter key |
Enter key |
Location change --> negative movement on LOC and positive movement on LOCDES
- Cancellation
The movements of origin are referred to
Movement |
MAJTYP |
MAJCOD |
Quantity |
STOCOU |
LOC |
LOCDES |
Other fields |
Enter key |
E |
A |
+ |
|
Enter key |
|
Enter key |
Output - |
S |
A |
- |
|
Enter key |
|
Enter key |
Loc change |
C |
A |
+ |
Enter key |
Issue |
|
Issue |
Location change--> positive movement on LOC and negative movement on location found from the input stock
- OUTPUT FLOWS
Issues
- Misc. issue
- Delivery
- WO issue
- Sub-contract order issue
- Service request
Negative inputs
- Receipt return
- Subcontract receipt return
Location changes
- Loan shipment
- Sub-contracting deliveries.
- Creation
Movement |
MAJTYP |
MAJCOD |
Quantity |
STOCOU |
LOC |
LOCDES |
Other fields |
Issue |
S |
C |
+ |
Issue |
Issue |
|
Issue |
Input - |
E |
C |
- |
Issue |
Issue |
|
Issue |
Loc change |
C |
C |
+ |
Issue |
Issue |
Enter key |
Enter key |
Location change --> negative movement on LOC and positive movement on LOCDES
- Cancellation
The movements of origin are referred to
Movement |
MAJTYP |
MAJCOD |
Quantity |
STOCOU |
LOC |
LOCDES |
Other fields |
Issue |
S |
A |
+ |
|
Issue |
|
Issue |
Input - |
E |
A |
- |
|
Issue |
|
Issue |
Loc change |
C |
A |
+ |
Enter key |
Issue |
|
Issue |
Location change--> positive movement on LOC and negative movement on location found from the input stock
- STOCK ADJUSTMENT
They are the same movement types as in the output flows
WAIFLG = 1
Movement |
MAJTYP |
MAJCOD |
Quantity |
Issue |
S |
A |
+ |
Input - |
E |
A |
+ |
Loc change |
C |
A |
- |
Then standard processing with WAIFLG = 0 (adjustment of pending movements)
Miscellaneous documentation
Allocation and output algorithm
Allocation algorithm and stock issue
Technical characteristics
Sub-program STOCKALG of processing STKALL
The result is stored in the ALLPAR live screen in the form of a grid containing the stock lines to allocate or to issue.
Context
This algorithm also uses the allocation and management rules.
There are differences concerning statuses between those documents that only perform allocation (Orders, WOs and Subcontract orders) and the other documents:
- Order, WO and Subcontract order
The authorized statuses are those defined in the allocation rule. Should there be no rule, only statuses A are taken into account.
- Other documents
The authorized statuses/sub-statuses are those defined in the management rule.
Allocation and issue rule
The allocation or issue rule is defined in the category-site or product category depending on the correspondence specified in the 'Allocation setup' and 'Issue setup' documentations.
If there are no allocation rules for the product-document pair, the following principles will be applied.
- FIFO classification
- Status A
- All units without any restrictions
Management rule
The management rule used is defined in the category-site or product category for the movement type to be processed and the movement code entered (if there is any).
If there is not specific management rule, the standard management rule will be used for the movement type to be processed.
There are no management rules for those documents that do not perform any output. These documents will then be considered as belonging to a movement type depending on the correspondence defined in the 'Allocation setup' documentation.
Used units
The units of the stock lines used are the following:
- Stock unit
- Packing units of the product
If order, delivery or invoice:
- Sales unit
- Sales unit of the customer product
- Packing units of the customer product
If supplier return:
- Purchase unit
- Purchase unit of the supplier product
- Packing unit of the supplier product
Operation
The principle is as follows:
All the eligible stock lines based on the allocation rule and the management rule are loaded into the grid of the ALLPAR screen.
The generated processing associated with the allocation rule is being run. This processing selects and sorts the stock lines of the grid of the ALLPAR screen.
The quantity of stock lines in the grid is being consumed up to the limit of the quantity to allocate or to issue
Loading the eligible stock lines
- Loading the filters
- Lot
If the lot is entered in the allocation filter, an exclusive filter is applied to it or its prefix (if *) and it is stored as shortage lot.
Filter on non-obsolete lots on the date of the requirement while taking into account the alert margin for the expiry, except if obsolete lot authorized by the management rule.
- Status
If the statuses are entered in the allocation filter, exclusive filter on these statuses or their prefixes (if *)
Otherwise in the presence of a document other than an order, a WO or a subcontract order, filter on the sub-statuses authorized by the management rule.
At this level, if there is no filter on the statuses yet,
If order, WO or subcontract order and allocation rule, filter on statuses authorized by it
Otherwise, if order, WO or subcontract order without allocation rule, filter on statuses 'A'
- Unit
If allocation rule, filter on the units and coefficients authorized by the allocation rule.
Otherwise no filter.
- Locations
Filter on the internal locations
Based on the algorithm parameters, the locations pending storage and the subcontract locations are taken into account.
If the location is entered in the allocation filter, filter on this location or its prefix (if *)
If allocation rule
In this rule, there always is a filter on the location
If WO or WO tracking and work center location, it is added to the filter and if this location is exclusive, it is stored in the shortage location.
If product location, it is added to the filter, and if this location is exclusive, it is stored in the shortage location.
Otherwise, filter deletion
Otherwise, filter deletion.
Based on the algorithm parameter, locations are taken into account during stock count.
- Selection of the stock lines
If allocation rule, the lots are read following the order defined in this rule (by lot, FIFO, FEFO, LIFO)
Otherwise lots are read in FIFO mode.
For each lot having available stock for the authorized statuses, the stock lines are read using the status filters, units and locations.
For each stock line having available stock, the characteristics of the line are loaded into the grid of the eligible lines.
Selection and sorting of the eligible stock lines
If allocation rule, the generated processing associated with this rule is executed.
Otherwise, the standard processing defined in the algorithm itself is run.
This processing checks the adequacy of each line of eligible stock with the allocation rule lines and assigns a sorting code to the line accordingly.
These lines are then sorted according to this sorting code.
Consumption of these stock lines
The quantity of stock lines in the grid is being consumed up to the limit of the quantity to allocate or to issue
Management of additional fields
Management of new fields in the STOJOU and STOCK tables
This document helps implement additional fields in the STOJOU and/or STOCK tables, from their entry in the various screens to their storage in the tables.
The entry points associated with an input flow enable new fields to be managed in the STOJOU and STOCK tables.
The entry points associated with the other flows (output, stock change) enable new fields to be managed in the STOJOU table.
Entry flow
The screens concerned are:
- Document line ([SMR1] for miscellaneous inputs, [PTH1] for receipts, …)
- Entry of input detail (for a document line): STOENT [ENT]
- Modification of input detail (for a document line): STOENTM [ENM]
- Storage of input detail: STOENTW [ENTW]
- Storage for input update: STOWORK [STW]
The new fields must be added to these various screens, and also in the STOJOU and/or STOCK tables (with the same name).
The entry points to be used are:
- In processing STKENT (if the field is assigned in the document line)
DOC_ENTW = Document line screen --> Screen STOENTW
- In processing TRTSTOENMA (if field accessible in movement modification)
STJ_ENM = Table STOJOU --> Screen STOENTM
- In processing TRTSTOENTA (if the field is assigned in the input detail)
ENTW_ENT = Screen STOENTW --> Screen STOENT
ENT_ENTW = Screen STOENT --> Screen STOENTW
- In processing STKINT (for update of the field in the tables)
ENTW_STW = Screen STOENTW --> Screen STOWORK
and Screen STOENTM --> Screen STOWORK
Output flow
The screens concerned are:
- Document line ([SMO1] for miscellaneous outputs, [SDH1] for deliveries, …)
- Entry of output detail (for a document line): STOSOR [SOR]
- Modification of output detail (for a document line): STOSORM [SOM]
- Storage of output detail: STOSORW [SOW]
- Storage for output update: STOWORK [STW]
The new fields must be added to these various screens, and also in the STOJOU table (with the same name).
The entry points to be used are:
- In processing STKSOR (if the field is assigned in the document line)
DOC_SOW = Document line screen --> Screen STOSORW
- In processing TRTSTOSOR (if the field is assigned in the input detail)
SOW_SOR = Screen STOSORW --> Screen STOSOR
SOR_SOW = Screen STOSOR --> Screen STOSORW
- In processing STKINT (for update of the field in the tables)
SOW_STW = Screen STOSORW --> Screen STOWORK
and Screen STOSORM --> Screen STOWORK
Stock modification
The screens concerned are:
- Entry of stock change detail (for a document line): STOCHG [SCD]
- Entry of quality control detail (for a document line): STOQUA [SQD]
- Storage of the stock change detail: STOCHGW [SGW]
- Update for stock change update STOWORK [STW]
The new fields must be added to these various screens, and also in the STOJOU table (with the same name).
The entry points to be used are:
- In processing SUBSCSB (if entry of the field in the stock change details or quality control details)
SCDSQD_SGW = Screen STOCHG --> Screen STOCHGW
and Screen STOQUA --> Screen STOCHGW
- In processing TRTSTOCHGB (if entry of the field in the stock change detail)
SGW_SCD = Screen STOCHGW --> Screen STOCHG
- In processing TRTSTOQUAB (if entry of the field in the quality control detail)
SGW_SQD = Screen STOCHGW --> Screen STOQUA
- In processing STKINT (for update of the field in the tables)
SGW_STW = Screen STOCHGW --> Screen STOWORK