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.
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 input 6 - Receipt Receipt for subcontract 18 -Loan delivery return 13 - Customer return Loan delivery return 19 - Stock reintegration 12 - Material tracking Stock reintegration 21 - Splitting 29 - Stock change Mvt + Stock change 22 - Storing plan Source document Source document 33 - Subcontract delivery return 13 - Customer return Delivery return 34 - Analysis request 29 - Stock change 16 - Receipt for subcontract
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 |
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:
Grid variable (NBLIG)
Trigger | Action | Description |
Button | SAISTOALL | Allocation entry |
- on an already created line | ||
- must be called for a stable situation |
Trigger | Action | Description |
Button | SAIALLFIL | Entry of the allocation filter |
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
The components to be used will be found in processing STKALL.
In the 'document headers' tables
For those transactions performing inputs
In the screen of the document lines
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
WSTOSAI: Indicator of the stock fields to enter.
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; |
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 |
If !clalev[ENTW] Local Mask STOENTW [ENTW]
[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.
If !clalev[STW] Local Mask STOWORK [STW]
Gosub STK_INILOC From STKLOC
Call VIREBOUT(CHAINE,"A") From GOBJET
Call DELSTOENTW (-1,-1,"XXX",1) From STKENT
Call STKDISCOL From STKECR
Call RECSTO_F From STKECR
If a data is of no significance for the document line, it is replaced with character '$'
Call STJSTOENTW From STKENT
Call DELSTOENTW(-1, -1, "XXX", 1) From STKENT
Call DELSTOENTW(-1, -1, "XXX", 1) From STKENT
STA, LOCTYP, LOC, BPSLOT, LOT, NBSLO, SLO, SLOF, GESLOT, SERNUM, SERNUMF, PALNUM, CTRNUM, PRIORD, MVTDES, WSTOSEQ
and reinitialize them.
Call OUVENT From STKENT
Call OUVENT From STKENT
n = number of the "Detail modification" button
GOUVENT=2
n = number of the "Detail modification" button
mkstat = 4
Call CTLSTOENT From STKECR
Call CTLSTOENT From STKECR
If SIGN=1
Call ALISTOWORK(2,[M:XXX]WSTOSEQ(NOL),LQTA,LSHT,LRET) From STKINT
Call MAJ_STOCK From STKMAJ
Endif
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
Call REGFROMENT (0,"XXX","[M:XXX]CREFLG(I)=0","ITMREF",[M:XXX]STOFCY) From TRTSHTCOM
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
Call REGFROMENT (0,"XXX","[M:XXX]CREFLG(I)=0","ITMREF",[M:XXX]STOFCY) From TRTSHTCOM
Call DELSTOENTW (-1,-1,"XXX",1) From STKECR
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:
Variable thus built in sub-program CTR_COHERENCE_LIG
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.
Variable thus built in sub-program INIT_GOUVLOT
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.
In the 'document headers' tables
For those transactions performing outputs
In the calling object
In action OUVRE
In the screen of the document lines
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.
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 |
Trigger | Action | Processing call |
Post-modif | STD | Call INIZONSOR From STKECR |
|
| Call STKINIEMPS From STKLOC |
Trigger | Action | Description |
Selection | STKSELSTA | Status selection |
Control | STKCTRSTA | Status control |
Trigger | Action | Description |
Selection | STKSELEMP | Location selection |
Control | STKCTREMPS | Location control |
Trigger | Action | Description |
Selection | STKSELLOT | Lot selection |
Control | STKCTRLOTS | Lot control |
Trigger | Action | Description |
Control | STKCTRSLOS | Sub-lot control: |
Trigger | Action | Call to processing/Description |
Post-modif | STD | Call CTLSORSER From STKSOR |
|
| Serial no. control and calculation of end serial no. |
If !clalev[ALP] Local Mask ALLPAR [ALP]
If !clalev[SOW] Local Mask STOSORW [SOW]
If !clalev[STW] Local Mask STOWORK [STW]
Before Gosub LIENS From TABLEAUX
Call RAZSTOSORW From STKSOR
After Gosub LIENS From TABLEAUX
Call ETAZONSOR From STKECR
Call RECSTOSOR From STKECR
Call RAZSTOSORW From STKSOR
Call RAZSTOSORW From STKSOR
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
Call CTLSTOSOR From STKECR
Call CTLSTOSOR From STKECR
Call ENRSTOALL From STKALL
Call ALISTOWORK From STKINT (origin = screen STOSORW)
Call DELSTOSORW From STKECR (with line no. =-1)
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:
Document with validation not validated:
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 control the quantity to issue: CTLALL From STKALL
To transfer the allocations of the document line : CHGALL From STKALL
Document without validation
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
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
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:
Call ALISTOWORK From STKINT (source = table STOALL)
Call MAJ_STOCK From STKMAJ
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:
The information required to update stock is loaded in screen STOWORK.
Call ALISTOWORK From STKINT
Call MAJ_STOCK From STKMAJ
Receipts
Negative outputs
Location changes
- 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
Issues
Negative inputs
Location changes
- 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
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)
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.
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:
The authorized statuses are those defined in the allocation rule. Should there be no rule, only statuses A are taken into account.
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.
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:
If order, delivery or invoice:
If supplier return:
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
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.
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'
If allocation rule, filter on the units and coefficients authorized by the allocation rule.
Otherwise no filter.
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.
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
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.
The screens concerned are:
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:
DOC_ENTW = Document line screen --> Screen STOENTW
STJ_ENM = Table STOJOU --> Screen STOENTM
ENTW_ENT = Screen STOENTW --> Screen STOENT
ENT_ENTW = Screen STOENT --> Screen STOENTW
ENTW_STW = Screen STOENTW --> Screen STOWORK
and Screen STOENTM --> Screen STOWORK
The screens concerned are:
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:
DOC_SOW = Document line screen --> Screen STOSORW
SOW_SOR = Screen STOSORW --> Screen STOSOR
SOR_SOW = Screen STOSOR --> Screen STOSORW
SOW_STW = Screen STOSORW --> Screen STOWORK
and Screen STOSORM --> Screen STOWORK
The screens concerned are:
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:
SCDSQD_SGW = Screen STOCHG --> Screen STOCHGW
and Screen STOQUA --> Screen STOCHGW
SGW_SCD = Screen STOCHGW --> Screen STOCHG
SGW_SQD = Screen STOCHGW --> Screen STOQUA
SGW_STW = Screen STOCHGW --> Screen STOWORK