PARSTO: Modifying the allocation/issue mechanism setup

Use this entry point to intervene on some of the parameters of the algorithm determining automatically the stock to allocate or to issue.

Context and operating mode

Transaction

There is no transaction in progress.

Log file

No trace file is open.

Different call cases - Significant variables

This entry point is located in the STOCKALG sub-program of the STKALL processing. 

The accessible parameters are:

- [M :ALP]LOC                      Location to be processed as a priority

- [M :ALP]PECSCOLOC:     Authorizing subcontract locations                                (1=no / 2=yes)

                                               Default value = 1

- [M :ALP]PECPLFLOC:      Authorizing the locations awaiting put-away                (1=no / 2=yes)

                                               Default value = 2

- [M :ALP]PECCUNLOK:    Authorizing the locations in stock count                     (1=no / 2=yes)

                                               Default value = 2 (if order or WO), 1 for other documents

- [M :ALP]PECQLYCTL:     Authorizing the stocks being the object of an analysis request    (1=no / 2=yes)

                                               Default value = 2 (if order or WO), 1 for other documents

 

Open tables

In the table below, the significant content flag indicates that the content is in phase with the context (the current customer is loaded…).

Table

Significant content

Table Title

ITMMASTER

Yes

Products

ITMMVT

Yes

Product movements

ITMFACILIT

Yes

Products sites

ITMCATEG

Yes

Product categories

STOLOT   [STL1]

No

Lots

STOCK    [STO1]

No

Stock

STOALL   [STA1]

No

Allocations

TABALLRUL

Yes if WTRUCOD<>’’

Allocations/issues rules

TABSTORUL

Yes

Management rules

 

FILSTO: Adding filters on the stock to allocate or issue

This entry point concerns the filtering of the stock in the algorithm of automatic determination of stock to allocate or to issue.

It is used to insert additional logic after the loading of the filters in the LOT and STOCK tables in order to complete them.

Context and operating mode

Transaction

There is no transaction in progress.

Log file

No trace file is open.

Different call cases - Significant variables

This entry point is located in the STOCKALG sub-program of the STKALL processing. 

To add additional filters on stock lines to be processed, the screen field [M :ALP]FILSTO (length= 100) must be loaded by defining criteria on the [F:STO1] table.

Example: only consider the stock lines where the identifier 1 is equal to the content of the WIDENT variable.

to    [M :ALP]FILSTO = ‘[F :STO1]PALNUM = WIDENT’

To add additional filters on the lots to be processed, the loading of the WCRITLOT variable must be completed (length still available = 60) by defining criteria on the [F :STL1] table.

Example: only consider the lots where the user 1 field is equal to " BANC1".

to    WCRITLOT += ‘&[F :STL1]USRFLD1 = “BANC1”’

 

Open tables

In the table below, the significant content flag indicates that the content is in phase with the context (the current customer is loaded…).

Table

Significant content

Table Title

ITMMASTER

Yes

Products

ITMMVT

Yes

Product movements

ITMFACILIT

Yes

Products sites

ITMCATEG

Yes

Product categories

STOLOT   [STL1]

No

Lots

STOCK    [STO1]

No

Stock

STOALL   [STA1]

No

Allocations

TABALLRUL

Yes if WTRUCOD<>’’

Allocations/issues rules

TABSTORUL

Yes

Management rules

 

PECSTOALG: Taking into account a line of stock in the automation of the allocati

Use this entry point to take into account stock lines selected and sorted by the algorithm of automatic determination of stock to allocate or to issue.

It is used to take over in order to reject a stock line normally selected by the algorithm.

Context and operating mode

Transaction

There is no transaction in progress.

Log file

No trace file is open.

Different call cases - Significant variables

This entry point is located in the STOCKALG sub-program of the STKALL processing.

It is called during the automatic determination of stock to be processed in order to carry out an allocation, an issue, an allocation or issue suggestion.

It is used to reject a stock line that do not match the conditions that have been defined when setting the GOK variable to 0.

The significant variables are the following:

-         The section 1 of the ALLPAR [ALP] mask contains the execution characteristics of the algorithm: movement and document types, site, product, allocation and management rules, quantity to be processed, etc.

-         [M :ALP]TYPQTY indicates which quantity type is being used:    1 = quantities in physical units                                                                                                                                                                              2 = quantities in active units (standard case)

-         The grid section 4 of the ALLPAR [ALP] mask contains the stock lines selected and sorted by the algorithm.                                                                         The current line is indexed with J.

-         Warning: the following fields on the line are not significant: [M :ALP]WQTYSTU(J), [M :ALP]WQTYSTUACT(J), [M :ALP]WFLG(J), [M :ALP]WCOND(J)

Warning: the content of the ALLPAR screen field must be modified in no case. The only action to be carried out is to set GOK=0 to reject a stock line.

Additional note: with GPE=1, it also allows to prevent the execution of the quantity processing standard code. In that case it is necessary to perform this operation in the entry point.  

Open tables

In the table below, the significant content flag indicates that the content is in phase with the context (the current customer is loaded…).

Table

Significant content

Table Title

ITMMASTER

Yes

Products

ITMMVT

Yes

Product movements

ITMFACILIT

Yes

Products sites

ITMCATEG

Yes

Product categories

STOLOT   [STL1]

No

Lots

STOCK    [STO1]

No

Stock

STOALL   [STA1]

No

Allocations

TABALLRUL

Yes if WTRUCOD<>’’

Allocations/issues rules

TABSTORUL

Yes

Management rules

 

SORTSTO: Modifying the trt order for the stock in order to determine the automat

Use this entry point to modify the order in which the stock lines are processed during the automatic determination of stock to allocate or to issue.

This modification only concerns the stock lines of the lot currently being processed, the order of the lots being defined by the allocation/issue rule.

Context and operating mode

Transaction

There is no transaction in progress.

Log file

No trace file is open.

Different call cases - Significant variables

This entry point is located in the STOCKALG sub-program of the STKALL processing.

It is called as follows during the automatic determination of stock to be processed in order to carry out an allocation, an issue, an allocation or issue suggestion.

$LEC_STOCK

 

GPE=0

GPOINT="SORTSTO"

Gosub ENTREE  from EXEFNC

If GPE<>0 Return Endif

 

It is necessary to entirely re-write the stock line loading loop in the [M :ALP] grid (as done in the $LEC_STOCK label in the STKALL processing) and to strictly comply with the following instructions:

The re-written processing must follow this structure:

Filter [STO1] Where ...

&                   & evalute(WCRITSTO1) & evalute(WCRITSTO2) & evalute(WCRITSTO3)

&                   & evalute([M:ALP]FILSTO)

&             Order By …

 

For [STO1] …

   # Loading of the stock line

   Gosub TRAITE_STOCK

   If WRET=1

      GotoSTO1_SUI

   Elsif WRET=2

      Break

   Endif

   $STO1_SUI

Next

Filter [STO1]

The elements that can be modified are:

-         In the ‘Filter’:           the concerned table that can be either [F :STO1] or the result of a link between [F :STO1] and another table ([F :STC] for example)

The selection (‘Where’) Warning: the evaluations of WCRITSTO1,WCRITSTO2,WCRITSTO3 and FLISTO must be saved.

The order (’Order by’)

-          In the ‘For’:            the concerned table that can be either [F :STO1] or the result of a link between [F :STO1] and another table ([F :STC] for example)

Warning: the content of the ‘For’ loop must absolutely be saved.

 

Warning: It is necessary to bypass the standard processing by setting the GPE variable to 1. 

 

The standard processing is the following:

# If product managed with R/I serial number, FIFO or LIFO classification of serial numbers

If [F:ITM]SERMGTCOD=3

   Case [F:TRU]LOTMGT

    When 1,3    : # By serial number

                  Filter [STO1] Where ITMREF=[M:ALP]ITMREF & STOFCY=[M:ALP]STOFCY

&                      & LOT=[F:STL1]LOT & SLO=[F:STL1]SLO

&                      & evalute(WCRITSTO1) & evalute(WCRITSTO2) & evalute(WCRITSTO3)

&                      & evalute([M:ALP]FILSTO)

&                               Order By SERNUM

    When 4      : # LIFO

                  Filter [STO1] Where ITMREF=[M:ALP]ITMREF & STOFCY=[M:ALP]STOFCY

&                      & LOT=[F:STL1]LOT & SLO=[F:STL1]SLO

&                      & evalute(WCRITSTO1) & evalute(WCRITSTO2) & evalute(WCRITSTO3)

&                      & evalute([M:ALP]FILSTO)

&                               Order By RCPDAT Desc;SERNUMDesc

    When Default: # FIFO

                  Filter [STO1] Where ITMREF=[M:ALP]ITMREF & STOFCY=[M:ALP]STOFCY

&                      & LOT=[F:STL1]LOT & SLO=[F:STL1]SLO

&                      & evalute(WCRITSTO1) & evalute(WCRITSTO2) & evalute(WCRITSTO3)

&                      & evalute([M:ALP]FILSTO)

&                               Order By RCPDAT;SERNUM

   Endcase

   For [STO1] Hint Key STO3

      # Loading of the stock line

      Gosub TRAITE_STOCK

      If WRET=1

         GotoLEC_STOCK_SUI2

      Elsif WRET=2

         Break

      Endif

      $LEC_STOCK_SUI2

   Next

   Filter [STO1]

Else

   Case [F:TRU]LOTMGT

    When 4      : # LIFO

                  Filter [STO1] Where ITMREF=[M:ALP]ITMREF & STOFCY=[M:ALP]STOFCY

&                      & LOT=[F:STL1]LOT & SLO=[F:STL1]SLO

&                      & evalute(WCRITSTO1) & evalute(WCRITSTO2) & evalute(WCRITSTO3)

&                      & evalute([M:ALP]FILSTO)

&                               Order By LOC Desc; STOCOU Desc

    When Default: # FIFO

                  Filter [STO1] Where ITMREF=[M:ALP]ITMREF & STOFCY=[M:ALP]STOFCY

&                      & LOT=[F:STL1]LOT & SLO=[F:STL1]SLO

&                      & evalute(WCRITSTO1) & evalute(WCRITSTO2) & evalute(WCRITSTO3)

&                      & evalute([M:ALP]FILSTO)

&                               Order By LOC; STOCOU

   Endcase

 

   For [STO1] Hint Key STO3

      # Loading of the stock line

      Gosub TRAITE_STOCK

      If WRET=1

         GotoLEC_STOCK_SUI

      Elsif WRET=2

         Break

      Endif

      $LEC_STOCK_SUI

   Next

   Filter [STO1]

Endif

 

Warning: It is necessary to bypass the standard processing by setting the GPE variable to 1. 

 

Open tables

In the table below, the significant content flag indicates that the content is in phase with the context (the current customer is loaded…).

Table

Significant content

Table Title

ITMMASTER

Yes

Products

ITMMVT

Yes

Product movements

ITMFACILIT

Yes

Products sites

ITMCATEG

Yes

Product categories

STOLOT   [STL1]

No

Lots

STOCK    [STO1]

No

Stock

STOALL   [STA1]

No

Allocations

TABALLRUL

Yes if WTRUCOD<>’’

Allocations/issues rules

TABSTORUL

Yes

Management rules

 

DELALL: Used to prohibit the cancellation of an allocation

Use this entry point to prohibit the deletion of an allocation in the deletion component of document line allocations.

It is used to take over in the read loop of the allocations to delete in order to decide whether the read allocation must be canceled or not.

Context and operating mode

Transaction

There is one transaction in progress.

Log file

No trace file is open.

Different call cases - Significant variables

This entry point is located in the DELALL sub-program of the STKALL processing. 

To prohibit the deletion of the allocation, you must set the GOK global variable to 0.

The allocation record is located in [F :STA1].

The stock record corresponding to the allocation is not on line.

GFONCTION contains the function being executed:        FUNDESALL = automatic deallocation of orders

FUNMDESA = automatic WO deallocation

For example:

Deleting only allocations with the ‘R’ status in the automatic order deallocation

If GFONCTION = ‘FUNDESALL’              : # Automatic order deallocation

   If [F:STA1]ALLTYP=2                              : # Detailed allocation

      If clalev ([F:STO]) = 0: Local File STOCK  [STO]: Endif

      Read [STO]STO0=[F :STA1]STOFCY ;[F :STA1]STOCOU

      If !fstat & left$([F:STO]STA,1)<>’R’      : # Read OK and status different from ‘R’

         GOK=0                                                 : # The allocation is not to be deleted

      Endif

   Endif

Endif

 

Open tables

In the table below, the significant content flag indicates that the content is in phase with the context (the current customer is loaded…).

Table

Significant content

Table Title

STOALL   [STA1]

Yes

Allocations

ECRTRACE: Adding lines in the log file upon deallocation of an order line

This entry point concerns the automatic deallocation of orders.

It is used to insert additional logic in the deallocation of an order line, when deleting allocations in order to add elements to the log file.

This entry point is located in the STKALL processing.

Context and operating mode

Transaction

There is a transaction in progress (allocation update transaction, with update of the order line, deletion of allocations, the corresponding credit and the order header).

The GOK variable is used and tested. It equals 1. It can be set to 0 if the transaction is to be abandoned.

Log file

There is an open log file.

It gives for each processed order line, the deallocated quantity (allocated quantity and/or shortage quantity). The purpose of this entry point is to add lines to this log file.


 

Different call cases - Significant variables

This entry point is called in the STKALL processing in the SUPALL sub-program for allocation deletion. This sub-program is itself called by the DELALL sub-program that carries out the deletion of all allocations for a document line.

It is located in the deletion transaction of the allocation on an order line in the automatic deallocation of orders function.

.          A lock has been set on the order header.

.          The [F:SOQ] order detail line has been read.

.           The DELALL sub-program is called. It is located in the read loop of all the allocation lines. For each allocation line to delete

.          The allocation line has been read. The [F:STA] buffer is loaded.

.           The corresponding stock line has been read and updated (Decrease of the total allocated quantity). The [F:STO] buffer is loaded.

           [F :STO]LOT :           Contains the lot number

           [F:STO]LOC  :           Contains the location

The lot expiry date can be easily found by reading the Lot number in the corresponding file STOLOT. This read requires the file to be open.

.          Carried out just before the deletion of the allocation line.

.          Carried out just before the update of the order line detail.

The entry point is called only if a log file is open (GTRACE is not equal to blank). Adding a new line to this log file is carried out using the following instruction:

Call ECR_TRACE("Description of the message to be added", 0 or 1) From GESECRAN.

(If 1, the line will appear in red).

 

NB:     Knowing that this entry point is located in the SUPALL sub-program, it can be used by all functions that carry out deletions using this means. GFUNCTION can be used to identify the original function.


Open tables

In the table below, the significant content flag indicates that the content is in phase with the context (the current customer is loaded…).

This grid is valid for the function of automatic deallocation of orders.

Table

Significant content

Table Title

SORDER

Yes

Order headers

SORDERQ

Yes

Order line quantities

SORDERP

Yes

Order line prices

SORDERC

Yes

Product / customer orders (open orders)

ITMMASTER

Yes

Products

ITMMVT

No

Product movements

ITMFACILIT

Yes

Products sites

FACILITY

No

Sites

STOALL

Yes

Allocations

STOCK

Yes

Stock

 

ALLSTO: Used to exploit the stock of a detailed allocation in allocation update

Use this entry point to use the stock data of a detailed allocation upon allocation update.

Context and operating mode

Transaction

There is one transaction in progress.

Log file

No trace file is open.

Different call cases - Significant variables

This entry point is located in the $TRT_STO label of the STKALL processing that is used in the CREALL, MODALL and SUPALL sub-programs of the STKALL processing. 

It is called upon each creation, modification or deletion of a detailed allocation before it is updated.

[F :STA]VCRTYP contains the document type which the allocation originates from.

[L]WQTA contains the quantity to be allocated/deallocated

            this quantity is positive in the case of a creation or an increase

            it is negative in the case of a deletion or a decrease

The stock information associated with this allocation (serial no., lot, sub-lot, location, …) is located in the [F :STO] file class. 

Open tables

In the table below, the significant content flag indicates that the content is in phase with the context (the current customer is loaded…).

Table

Significant content

Table Title

STOCK    [STO]

Yes

Stock

STOALL   [STA]

No

Allocations

 

STOWIPW: Allows to cancel the synchronization of quantities in process

Use this entry point to cancel the execution of the resynchronization processing for the quantities being processed upon calling the processing determining the stock to be issued.

Context and operating mode

Transaction

There can be one transaction in progress. It is necessary to test the value of the "adxlog" supervisor variable in order to know the context:

adxlog = 0 : There is no transaction in progress.

adxlog = 1 : There is one transaction in progress.

Log file

No trace file is open.

Different call cases - Significant variables

This entry point is located in the STOCKALG sub-program of the STKALL processing (determination of the stock to be issued).

It is used not to execute the resynchronization of quantities being processed in an automatic manner (performance issue in the case of large volume, for example upon creation of sales deliveries).

It will be necessary to launch the resynchronization via the FUNSTOWIPW function in batch or in direct mode.

To inhib this automatic launch, set the local variable [L]WSTOWIPW = 0 in the STOWIPW entry point of the STKALL processing.

Open tables

Table

Significant content

Table Title

 

ALLREA: Authorizing the reorder of requirements from locations subject to reorde

Use this entry point to authorize the automatic reorder of reorder requirements from locations that can be replenish.

Context and operating mode

  Transaction

  There is no transaction in progress.

Log file

No trace file is open.

Different call cases - Significant variables

This entry point is located in the $TRAITE_STOCK label called in the STOCKALG sub-program of the STKALL processing (determination of the stock to be issued).

When using this automatic determination of the stock to be processed as part of the reorder plan, the locations that can be replenish are not taken into account.

To do so, you must set the variable GPE=1

RECHALL: Sorting the stock lines that have been selected and sorted by the algor

Use this entry point to take into account stock lines selected and sorted by the algorithm of automatic determination of stock to allocate or to issue.

It is used to sort again the stock lines selected and sorted by the algorithm.

Context and operating mode

Transaction

There is no transaction in progress.

Log file

No trace file is open.

Different call cases - Significant variables

This entry point is located in the STOCKALG sub-program of the STKALL processing.

It is called during the automatic determination of stock to be processed in order to carry out an allocation, an issue, an allocation or issue suggestion.

It is used to sort again the stock lines selected and sorted by the algorithm.

The significant variables are the following:

-         The section 1 of the ALLPAR [ALP] mask contains the execution characteristics of the algorithm: movement and document types, site, product, allocation and management rules, quantity to be processed, etc.

-         [M :ALP]TYPQTY indicates which quantity type is being used: 1=quantities in physical units and 2=quantities in active units (standard case)

-         The grid section 4 of the ALLPAR [ALP] mask contains the stock lines selected and sorted by the algorithm.

Warning: The grid has only been sorted on the [M :ALP]WCOND and [M:ALP]NLIG columns since the other columns have not been moved --> when a loop is carried out from 0 to [M:ALP]NBLIG, the values of these columns can be accessed via the [M:ALP]NLIG index.   

Warning: the content of a field on the ALLPAR screen must never be modified.

Open tables

In the table below, the significant content flag indicates that the content is in phase with the context (the current customer is loaded…).

Table

Significant content

Table Title

ITMMASTER

Yes

Products

ITMMVT

Yes

Product movements

ITMFACILIT

Yes

Products sites

ITMCATEG

Yes

Product categories

STOLOT   [STL1]

No

Lots

STOCK    [STO1]

No

Stock

STOALL   [STA1]

No

Allocations

TABALLRUL

Yes if WTRUCOD<>’’

Allocations/issues rules

TABSTORUL

Yes

Management rules

 

MOD_ALLPAR: Modifying the parameters for automatic allocation

Use this entry point to intervene on some parameters of the automatic allocation such as the quantity to allocate.

Context and operating mode

Transaction

There is no transaction in progress.

Log file

No trace file is open.

Different call cases - Significant variables

This entry point is located at the beginning of the GENSTOALL sub-program of the STKALL processing.

For example, it is used to intervene on the quantity to allocate. 

The accessible parameters are:

- [M:ALP]QTY:  Quantity to allocate (in active stock unit)

- The fields in section 1 of the ALLPAR setup screen are entered and accessible. Warning: any modification on these fields must be performed according to an informed decision.    

Open tables

In the table below, the significant content flag indicates that the content is in phase with the context (the current customer is loaded…).

Table

Significant content

Table Title

ITMMASTER

Yes

Products

ITMFACILIT

No

Products sites

ITMCATEG

No

Product categories

STOLOT   [STL1]

No

Lots

STOCK    [STO1]

No

Stock

STOALL   [STA1]

No

Allocations

TABALLRUL

No

Allocations/issues rules

TABSTORUL

No

Management rules

 

CHG_WTRUCOD: Modifying the allocation rule

Use this entry point to modify the allocation/issue rule used upon automatic determination of the stock to allocate or issue.

Context and operating mode

Transaction

There is no transaction in progress.

Log file

No trace file is open.

Different call cases - Significant variables

This entry point is located in the $APPEL_ALGO label in the STKALL process after loading the allocation/issue rule to use.

It is used to change the rule to be used by modifying the WTRUCOD local variable. 

The accessible parameters are:

- [M:ALP]VCRTYP:  Entry type (local menu no. 701)

- [M:ALP]PECSCOLOC:  Consideration of subcontract locations (1=no, 2=yes)

For example, in order to modify the allocation rule of a subcontract WO, the value of WTRUCOD must be edited as follows:

If [M:ALP]VCRTYP=10 & [M:ALP]PECSCOLOC=2 : WTRUCOD="xxx": Endif

      

Open tables

In the table below, the significant content flag indicates that the content is in phase with the context (the current customer is loaded…).

Table

Significant content

Table Title

ITMMASTER

Yes

Products

ITMFACILIT

No

Products sites

ITMCATEG

No

Product categories

STOLOT   [STL1]

No

Lots

STOCK    [STO1]

No

Stock

STOALL   [STA1]

No

Allocations

TABALLRUL

No

Allocations/issues rules

TABSTORUL

No

Management rules

 

CREALL: taking over on creation of allocation

This entry point is positioned in the processing loop of the STOSORW work mask lines.

It is used to take over when allocating a document line (while possibly deallocating an original document).

Context and operating method

Transaction

There is one transaction in progress.

Log file

No trace file is open.

Different call cases - Significant variables

This entry point is located in the ENRSTOALL sub-program of the STKALL processing. 

The LTRT variable is used to identify the call context:

0: allocation only

1: source line allocation + deallocation.

The STOSORW [SOW] screen is loaded.

The I variable corresponds to the index of the STOSORW mask line being processed (from 0 to NBLIG-1).

Open tables

In the table below, the significant content flag indicates that the content is in phase with the context (the current customer is loaded…).

Table

Significant content

Table Title

STOALL   [STA1]

No

Allocations