TRTWIP processing: TRTWIP
MAJITMMVT: Additional update of files after a WIP update
Presentation
This entry point concerns stock WIP management.
It is used to perform additional file updates after each operation on a stock WIP.
Presentation
Context and operating mode
Transaction
There is one transaction in progress.The GOK variable is set to 1.
Different call cases
This entry point is called in the TRTWIP processing. This processing is called from each processing (Stock, Purchase, Sales, Production) to allow the creation, modification or deletion of a stock WIP.
Significant variables
WMAJCOD contains: " C " when writing an ORDERS record
" M " when re-writing an ORDERS record
" A "when deleting an ORDERS record
If WMAJCOD = "M"
WRMNEXTQTY contains the remaining quantity after re-writing the WIP with its new quantity.
WOLDWIPSTA contains the previous status of the WIP (1="Firm", 2="Planned", 3="Suggested", 4="Closed").
Open tables
In the table shown below, the significant content flag indicates that the content matches the context (the current delivery is loaded).
Table |
Significant content |
Table title |
ORDERS |
YES |
Stock WIP [F:ORDW] |
|
|
|
Open screens
Screen |
Significant content |
Screen title |
ORDK |
YES |
Stock WIP parameters |
|
|
|
Specific case
To populate a requirement total (BESSTO for example) in the product-site totals table (ITMMVT), proceed as follows:
For orders
- SOF (Sales order) ( [M:ORDK]WIPTYP=1 and [M:ORDK]WIPSTA=1 )
- MWF (Production materials) ( [M:ORDK]WIPTYP=6 and [M:ORDK]WIPSTA=1 )
- TPF (Transfer request) ( [M:ORDK]WIPTYP=8 and [M:ORDK]WIPSTA=1 )
If WMAJCOD="C"
[F :ITV]BESSTO += [F:ORDW]RMNEXTQTY
If WMAJCOD= "M"
If WOLSWIPSTA=2 or WOLDWIPSTA=3 and [F :ORD]WIPSTA=1 (status changed from "Planned/Suggest" to "Firm")
[F :ITV]BESSTO += [F :ORDW]RMNEXTQTY
Otherwise
[F :ITV]BESSTO += [F:ORDW]RMNEXTQTY - WRMNEXTQTY
If WMAJCOD= "A"
[F :ITV]BESSTO -= [F:ORDW]EXTQTY – [F :ORDW]CPLQTY
ORDMAJ: Update of the specific/custom fields in the WIP file ORDERS
This entry point concerns stock WIP management.
It is used to take over just before the creation or modification of the WIP record (which makes it possible for example, to initialize custom/specific fields or to re-calculate the quantities in active unit).
Context and operating mode
Transaction
There is one transaction in progress.The GOK variable is set to 1.
Different call cases
This entry point is called in creation and modification mode in the TRTWIP processing. This processing is called from every processing (Stock, Purchase, Sales, Production) used to create a stock WIP.
It will be necessary to test the GFONCTION and WMAJCOD variables in order to identify the call context.
Significant variables
WMAJCOD contains:
" C " when writing an ORDERS record
" M " when re-writing an ORDERS record
It should be noted that for the re-calculation of the quantities in active unit, only orders coming from purchasing are concerned.
An example of a custom processing to manage this requirement is shown below :
$ACTION
Case ACTION
When "ORDMAJ" : Gosub ORDMAJ
When Default
Endcase
Return
#-----------------------------------#
# Conversion quantities in active unit #
# for orders coming from purchasing #
# - [F:ORDW]RMNEXTQTY #
# - [F:ORDW]CPLQTY #
# - [F:ORDW]EXTQTY #
#-----------------------------------#
$ORDMAJ
If find([F:ORDW]WIPTYP,2,7) & left$([M:ORDK]ABBFIL,1)="P"
If [F:ITM]ITMREF<>[F:ORDW]ITMREF
Read [ITM] ITM0=[F:ORDW]ITMREF : If fstat Raz [F:ITM] : Endif
Endif
If [F:ITM]STOMGTCOD=3 & [F:ITM]DEFPOT<>0
[F:ORDW]RMNEXTQTY=[F:ORDW]RMNEXTQTY*[F:ITM]DEFPOT/100
Call QTEARR ([F:ORDW]RMNEXTQTY,[F:ITM]STU) From TRTDIV
If [F:ORDW]CPLQTY <> 0
[F:ORDW]CPLQTY=[F:ORDW]CPLQTY*[F:ITM]DEFPOT/100
Call QTEARR ([F:ORDW]CPLQTY,[F:ITM]STU) From TRTDIV
Endif
If [F:ORDW]EXTQTY <> 0
[F:ORDW]EXTQTY=[F:ORDW]EXTQTY*[F:ITM]DEFPOT/100
Call QTEARR ([F:ORDW]EXTQTY,[F:ITM]STU) From TRTDIV
Endif
Endif
Endif
Return
Open tables
In the table below, the significant content flag indicates that the content is in phase with the context.
Table |
Significant content |
Table title |
ORDERS |
YES |
Stock WIP |
|
|
|
Open screens
Screen |
Significant content |
Screen title |
ORDK |
YES |
Stock WIP parameters |
|
|
|