This entry point is called before the update of the new stock line coming from the unpacking of the line which an action is being carried out on (issue, location and status change, etc.).
The characteristics of this new stock line are contained in the work screen [M:STW].
Modifying the content of this work screen enables to intervene on the characteristics of the new line and in particular to modify identifiers 1 and 2 that are those of the unpacked line by default.
There is one transaction in progress
There is an open log file.
The original stock line has just been updated (reduction of 1 packing unit and n stock units).
A new line of n stock units will be created with the same characteristics or a line with identical characteristics will be updated (increase of n stock units).
The characteristics of this new line are in the screen [M:STW] indexed via the I variable.
For example: Reset to zero of identifiers 1 and 2
Raz [M :STW]PALNUM(I)
Raz [M :STW]PALNUM(I)
Warning: Avoid intervening on other fields than the 2 identifiers since the STOWORK [STW] screen contains all the data used to update stock.
All the tables of the stock engine are open but their content is not significant.
The stock update interface screen: STOWORK [STW] is open and contains all the characteristics of the issues to carry out.
This entry point is used to intervene on the update of a receipt into stock when the analysis number is assigned.
There is one transaction in progress
No trace file is open.
Call if creation of a new analysis request, therefore only in the case of stock receipt movements with the ‘Q’ status.
|
Variable or mask |
Definition |
|
Global char WANA |
Analysis number |
If the WANA variable is loaded via this entry point, no automatic assignment of the analysis number by the standard sub-program will be carried out.
If this entry point reuses an existing analysis number, the quality control recording must be updated concerning the quantity by status fields.
All the tables opened by the stock engine.
Use this entry point in order not to update the history of the products-sites totals (ITMMVTHIS table).
There is one transaction in progress
No trace file is open.
Call on updating the stock on product shortage when the products-sites totals are being updated.
In order not to update the history of the products-sites totals, the GPE variable must be set to 1.
Warning: this entry point is the equivalent of the entry point located in the STKVALMAJ2 processing. The same behavior will probably be required in both cases.
|
Variable or mask |
Definition |
|
Block 1 of screen STOWORK |
It contains the characteristics of the document line for which the stock is being updated, among which: - [M:STW]TRSTYP: transaction type (local menu 704) - [M:STW]VCRTYP: document type (local menu 701) |
|
|
All the tables opened by the stock engine.
Use this entry point in order not to aggregate the stock movements.
There is one transaction in progress
There is an open log file.
Call upon stock update on each stock movement entry.
In order not to aggregate stock movements, the GPE variable must be set to 1.
|
Variable or mask |
Definition |
|
Block 1 of screen STOWORK |
It contains the characteristics of the document line for which the stock is being updated, among which: - [M:STW]TRSTYP: transaction type (local menu 704) - [M:STW]VCRTYP: document type (local menu 701) |
|
|
All the tables opened by the stock engine.
Use this entry point to define an additional differentiation criterion when generating analysis requests.
There is one transaction in progress
There is an open log file.
Call upon stock update on each stock movement entry.
To use the lot as an additional differentiation criterion when generating analysis requests, the WQLH_CRIT local variable must be declared and loaded as follows:
Local Char WQLH_CRIT
WQLH_CRIT = "LOT = [M:STW]LOT(I)"
Prerequisites
The lot must be added to the STOQLYH table. It is automatically loaded via the transclasses.
Available variables and masks
|
Variable or mask |
Definition |
|
Block 1 of screen STOWORK |
It contains the characteristics of the document line for which the stock is being updated, among which: - [M:STW]TRSTYP: transaction type (local menu 704) - [M:STW]VCRTYP: document type (local menu 701) |
|
|
All the tables opened by the stock engine.
Use this entry point to define an additional differentiation criterion when searching for the allocations to be followed on a new stock line.
There is one transaction in progress
There is an open log file.
Call when updating stock if the characteristics of a stock line with allocations are modified. Calling this entry point only occurs when searching for an allocated quantity equal to the quantity of the new stock line.
Used to determine the allocations to be followed on this new stock line.
To define an additional differentiation criterion for allocations, the WSTACRIT local variable must be loaded with the additional filter to be applied.
All the tables opened by the stock engine.
Use this entry point not to purge a quality control in the case of an issue in Q status.
There is one transaction in progress
There is an open log file.
Call upon update of stock placed in the PURGE_STOQLYD label.
The GPE variable must be set to 1 in order not to purge a quality control in the event of an issue with Q status.
Available variables and masks
|
Variable or mask |
Definition |
|
|
All the tables opened by the stock engine.
This entry point is used to check if a backdated stock issue is authorized. The control is applied to the existing stock on a relevant date. This is a blocking control.
This control has been implemented to meet several requirements:
In this entry point, enter the following instruction:
Call BACKDATE From STKMAJCTL
Errors are managed by the standard scripts.
The control only applies to the creation of documents. It does not apply to the modification or deletion of documents.
| Flow | TRSTYP (Stock transaction types) ML 704 | VCRTYP (Entry type) ML 701 |
|---|---|---|
| Issue | 2 = Miscellaneous issue | 20 = Miscellaneous issue |
| 31 = Assembly (parent product) | ||
| 32 = Disassembly (component) | ||
| 35 = Lot modification | ||
| 4 = Customer delivery | 4 = Delivery | |
| 5 = Sales invoice with stock movement | ||
| 6 = Work order issue | 12 = Production tracking | |
| 24 = Service request | 33 = Service request | |
| 29 = Subcontract issue | 6 = Receipt | |
| Negative receipt | 11 = Receipt return | 8 = Supplier return |
| 32 = Subcontract receipt return | 8 = Supplier return | |
| Stock change | 14 = Intersite transfer | 29 = Stock change |
| Count | 13 = Stock count | 9 = Stock count |
Loan deliveries and subcontract deliveries are not handled because permanent stock is kept.Stock movements corresponding to a Lot modification document (VCRTYP = 35) are considered. Effectively, the corresponding issue flow is identified as a Miscellaneous issue (TRSTYP=2). This is normal behavior for lot renumbering/mixing but it serves no purpose for characteristic changes (except potency) and lot user custom fields. This has no consequences on the calculation of the stock on the effective date. On the other hand, it will block the update if a movement relating to characteristic changes or lot user custom fields is later than the effective date entered.
The table below mentions the sign (positive/negative) of the quantity in the following flows [M:STW]:
| Flow type | MAJCODH | MAJTYP (I) | Quantity sign |
|---|---|---|---|
| Issue | C (creation) | S (issue) | + |
| Negative receipt | C | E (receipt) | - |
| Intersite transfers | C | C (change of location) | + |
STOCK on the S1 site: Lots are managed for Product A1.
On 22 October, the stock quantity is 150.
| 1 October | 3 October | 5 October | 10 October | 15 October |
|---|---|---|---|---|
| Lot 1 +30 | Lot 1 -10 | Lot 1 +10 |
|
Lot 1 +20 |
| Lot 2 +20 |
|
|
|
|
|
|
|
|
Lot 3 +50 | Lot 3 +30 |
| Effective date | Lot | Quantity | Result |
|---|---|---|---|
| 30 September | Lot 2 | - 10 | Blocked movement (Stock = 0) |
| 1 October | Lot 1 | - 40 | Blocked movement (Issue movement on 3 October) |
| 5 October | Lot 1 | - 40 | Blocked movement (Stock = 30) |
| 5 October | Lot 3 | - 20 | Blocked movement (Stock = 0) |
| 12 October | Lot 3 | - 60 | Blocked movement (Stock = 50) |
| 14 October | Lot 1 | - 50 | Blocked movement (Stock = 30) |
| 15 October | Lot 1 | - 50 | Authorized movement (Stock = 50) |