TRTVENBOM processing: BOM creation in ADAPI

ALINOMBOH: Loading of the sales BOM lines from the header

This entry point is used during the interactive generation of a BOM in sales documents (quote, order, delivery, invoice).

It is located at the start of the generation, after the alternative BOM is selected and the BOM header is read.

It is therefore used to take over after the BOM header and the 1st component line are read.

Context and operating mode

Transaction

There is no transaction in progress.

Log file

There is no open log file.

Call context

The entry point is called in interactive mode from the quote, order, deliver and invoice management, every time a BOM parent product or a kit parent product is entered.

Available variables and masks

The FUNCTION variable is used to identify the function currently being executed:

  • 1: Quote management

  • 2: Order management

  • 3: Delivery management

  • 4: Invoice management

It can be necessary to test it in order to use the correct context.

The [M] classes linked to the object currently being executed are open. For example, if FUNCTION=1, the [M :SQH0], [M :SQH1], [M :SQH2], and [M :SQH3] quote management masks are open.

During the creation or modification of a document, the value of GREP can be C, D, or M.

After the creation of the parent product line, in the APRES_LIGNE label of the variable at the bottom of the [M]NBLIG lines table. The TRTCRENOM action (standard processing type) is executed within the INIT label.

The ORI variable contains the number of the parent product line (0 for the 1st line of the table).

The BOM header is available in [F :BOH], the detail of the 1st component line in [F :BOD].

Open tables

Considering that this entry point can be called from different functions (quote, order, delivery, invoice), it is difficult to give the list of the open tables. The open tables are the tables linked to the object currently being executed.

However, the following tables are also loaded:

Tables Significant content Table title

ITMSALES

Yes

Products - Sales

BOM

Yes

BOM header

BOMD

Yes

BOM detail

ALILIG: Optional loading of the inserted line

This entry point is used during the automatic generation of a sales document line (quote, order, delivery, invoice) coming from a BOM breakdown or the generation of a free item from the price list search (normal search or grouped search).

It is located at the end of the generation of the line and used to take control in order to complete the creation of this line.

Concerning the generation of a BOM, it is used to take control after the detail BOM is read and the component line is created in order to complete the creation of this component line.

Context and operating mode

Transaction

There is no transaction in progress.

Log file

There is no open log file.

Call context

It is called in interactive mode from the quote, order, delivery, invoice management every time a product with a BOM parent product type or kit parent product type is entered, or the price list search returns a free item (normal search or grouped search).

Available variables and masks

The FUNCTION variable is used to identify the function currently being executed:

  • 1: Quote management

  • 2: Order management

  • 3: Delivery management

  • 4: Invoice management

It can be necessary to test it in order to use the correct context.

The TYPINS variable is used to identify the type of insertion performed:

  • N: BOM line

  • G: Free item line

  • P: Group line

It will also be necessary to test this variable in order to use the correct context.

The [M] classes linked to the object currently being executed are open. For example, if FUNCTION=1, the [M :SQH0], [M :SQH1], [M :SQH2], and [M :SQH3] quote management masks are open.

During creation or modification of a document, the value of GREP can be C, D, or M.

After the creation of the parent product line, in the APRES_LIGNE label of the variable at the bottom of the [M]NBLIG lines table. The TRTCRENOM action is executed (standard processing type). It is located in the EXEC label.

The ORI variable contains the number of the source line in the table (0 for the 1st line of the table). The source line corresponds to the parent product line in the case of a BOM, or to the line at the origin of the free item in the case of a free item.

The NL variable contains the number of the line inserted in the table (1 if 1st line inserted after the source line). The inserted line corresponds to the parent product line or the free item line. After inserting this line in the table, all the standard fields of the [M] class are loaded for this line.

Concerning the generation of a BOM, the entry point can be used to load a component line in the [M] class with the content of the BOM detail [F :BOD].

Open tables

Given that this entry point can be called from different functions (quote, order, delivery, invoice) and for the insertion of different types of lines, it is difficult to list all the open tables. The open tables are the tables linked to the object currently being executed.

In any case, regarding the generation of a BOM, the following tables are loaded:

Table Significant content Table title

ITMSALES

Yes

Products - Sales

BOM

Yes

BOM header

BOMD

Yes

BOM detail

CPLCREGRA: Adding data during the generation of a free item line

This entry point is used to intervene after the creation of a free item line in the [M:SOH4] class. Additional data can be added to this line. It is only called in web service.

Context and operating mode

Transaction

There is no transaction in progress.

Log file

There is no open log file.

Different call cases

This entry point only concerns the management of orders and web services.

Call context

This entry point is called at the start of the VERIF_CRE and VERIF_MOD actions of the object if: dim(GWEBSERV)=1 & GWEBSERV=1

Available variables and masks

The following screen classes are available and loaded with the order currently being created or modified:

SOH0, SOH1, SOH2, SOH3, SOH4 (lines)

The entry point is located in the read loop of the order lines in the table of the lines.

I is the index used. It is the index of the free item inserted in the table.

[M:SOH4] NBLIG contains the number of order lines. It has been incremented by 1 because the free item line has been inserted in the table.

ORI is the index of the line of the origin of the free item.

The free item line has been inserted in the table.

Open tables

The open tables are the tables of the order object.

In the table below, the significant content flag indicates that the content matches the context (the current customer is loaded). It is usually the case for the file that contains the header but not for the file that contain the lines.

Table Significant content Table title

ITMMASTER

Yes

Product

ITMSALES

Yes

Sales product

ITMFACILIT

Yes

Product-site

MODLIG: Changes completing the update of a BOM parent product

This entry point is used when modifying the parent product (BOM or kit) of a document line.

It allows some customers to modify specific fields created by the ALILIG entry point.

It is located at the end of the modification of the component line and is used to take control in order to complete the modification of this component line.

Context and operating mode

Transaction

There is no transaction in progress.

Log file

There is no open log file.

Code context

It is called in interactive mode from a sales document management (quotes, orders, deliveries, invoices) every time the line of a product of BOM parent product type or kit parent product type is modified.

Available variables and masks

The [M] classes linked to the object currently being executed are open. For example, if FUNCTION=1, the [M :SQH0], [M :SQH1], [M :SQH2], and [M :SQH3] quote management masks are open.

Document currently being modified, the entry point is called by the TRTVENBOM processing.

The NL variable contains the line number of the component modified in the grid.

CALQTYCPS: Recalculate quantity of a component

Context and operating method

Transaction

There is no transaction in progress.

Log file

No log is open.

Call context

This entry point is called from the quote, order, delivery, invoice management every time a product with a BOM parent product type or kit parent product type is entered.

It is located at the end of the parent product line creation, label APRES_LIGNE for [M]NBLIG. The action TRTCRENOM is executed. It performs the automatic generation of the component lines.

The entry point is located at the line insertion and the fields loading.

It allows you to take control after the quantity calculation based on the parent product quantity and the linked quantity in order to modify this calculated quantity.

In the sales order management, the quantity can be the ordered quantity ([M]QTY), the quantity to allocate ([M]WALLQTY), or the quantity to deliver ([M]TDLQTY). For the other documents, it's the quantity. For all the documents, the quantity is in sales units.

Available variable and masks

The FUNCTION variable is used to identify the function currently being executed:

  • 1: Quote management

  • 2: Order management

  • 3: Delivery management

  • 4: Invoice management

The [M] classes linked to the object currently being executed are open. For example, if FUNCTION=1, the [M :SQH0], [M :SQH1], [M :SQH2], and [M :SQH3] quote management masks are open.

The ORI variable contains the number of the source line in the grid line (0 for the 1st line of the grid). The source line is the parent product line.

The NL variable contains the number of the line inserted in the grid (1 if 1st line inserted after the source line). The inserted line is the component line. The [M] fields are currently loaded.

The WEP_QTYCPE variable is the parent product quantity.

The WEP_QTYCPS variable is the component qty calculated with the parent product quantity and the BOM quantity link ([F:BOD]LIKQTY).

The entry point is used to modify WEP_QTYCPS to update the component quantity.

The WEP_FIELD variable can be used in the sales order management to know which quantity is calculated.

If WEP_FIELD="QTY", it's the ordered quantity.

If WEP_FIELD="WALLQTY", it's the quantity to allocate.

If WEP_FIELD="TDLQTY", it's the quantity to deliver.

For all the other documents, WEP_FIELD="QTY".

Open tables

Table Significant content Table title
ITMMASTER Yes Product
BOM Yes BOM header
BOD Yes BOM detail
ITMSALES Yes Product-Sales

CALPRINOM: Cost price calculation for the kit, cost price sum of the components

This entry point is used when entering a component (BOM or kit) of an order line.

It makes it possible for some customers to have:

  • For the parent product: the sum of the parent product's prices and of its components

  • For the components: 0

It is located at the end of the insertion of the components linked to the parent product entered.

Context and operating mode

Transaction

There is no transaction in progress.

Log file

There is no open log file.

Call context

It is called in interactive mode from the order management every time that a product of parent product BOM type or kit parent product type is inserted.

The call is made after the component lines are inserted.

Available variables and masks

The [M:SOH4] class linked to the order object is available.

Order currently being modified, the entry point is called by the TRTVENBOM processing.

The PARAM(2) variable contains the number of the line of the parent product inserted.

The PARAM(2)+1 variable contains the number of the line of the first component inserted.

The PARAM(8)-1 variable contains the number of the line of the last parent product inserted.

PERTFAB1: Modification of components following the modification of a parent product

This entry point is used during the modification of a parent product line (BOM or kit) on a sales document (quote, order, delivery, invoice).

It is used to intervene in the different component lines linked to the parent product. It is especially used to intervene in the variable used for the recalculation of the component quantities from the quantity of the parent product.

It is called every time a component line is modified.

Context and operating mode

Transaction

There is no transaction in progress.

Log file

There is no open log file.

Call context

It is called from the management of sales documents (quotes, orders, deliveries, invoices) every time that the line of a product of BOM parent product type of kit parent product type is modified. It is called for all the component lines.

Available variables and masks

The [M] classes linked to the object (quote, order, delivery, invoice) are available. For example, [M :SOH0], [M :SOH1], [M :SOH2], [M :SOH3], [M :SOH4] are open for the orders.

Order currently being modified, the line of the parent product has been modified and you are in the APRES_NBLIG action of this line. The component line is currently being modified.

  • NL: Number of the line of the component currently being modified in the line table.

  • ORI: Number of the line of the parent product currently being modified in the line table.

  • FUNCTION: Function concerned (1=Quote, 2=Order, 3=Delivery, 4=Invoice)

  • RAPPORT: Relation between parent product quantity and component quantity is calculated, just before the entry point is called, from the parent product quantity before modification and the component quantity before modification.

For example, if the link quantity is 2 in the BOM between the parent product and the component, the original quantity of the parent product = 1 and the original quantity of the component = 2, then RAPPORT=2 (2/1). This variable can be modified by the entry point. The new quantity of the component has not been calculated yet.

Open tables

Given that this entry point can be called from different functions (quote, order, delivery, invoice), it is difficult to list all the open tables. The open tables are the tables linked to the object currently being executed.

QTEARRCPS: Modification of the rounding of the component quantity following the modification of a parent product

This entry point is used during the modification of a parent product line (BOM or kit) on a sales document (quote, order, delivery, invoice).

It is used to intervene in the different component lines linked to the parent product during their modification in order to modify the rounding performed on the component quantity recalculated from the quantity of the parent product.

It is located in the TRTVENBOM processing and called every time a component line is modified.

Context and operating mode

Transaction

There is no transaction in progress.

Log file

There is no open log file.

Call context

It is called from the management of sales documents (quotes, orders, deliveries, invoices) every time that the line of a product of BOM parent product type of kit parent product type is modified. It is called for all the component lines.

Available variables and masks

The [M] classes linked to the object (quote, order, delivery, invoice) are available. For example, [M :SOH0], [M :SOH1], [M :SOH2], [M :SOH3], [M :SOH4] are open for the orders.

Order currently being modified, the line of the parent product has been modified and you are in the APRES_NBLIG action of this line. The component line is currently being modified. The quantity of the component has been recalculated.

  • NL: Number of the line of the component currently being modified in the line table.

  • ORI: Number of the line of the parent product currently being modified in the line table.

  • FUNCTION: Function concerned (1=Quote, 2=Order, 3=Delivery, 4=Invoice)

  • RAPPORT: Relation between parent product quantity and component quantity is calculated from the parent product quantity before modification and the component quantity before modification.

For example, if the link quantity is 2 in the BOM between the parent product and the component, the original quantity of the parent product = 1 and the original quantity of the component = 2, then RAPPORT=2 (2/1).

WCPSQTY: New re-calculated quantity of the component and not yet rounded. The rounding will be performed according to the sales unit [M]SAU(NL). The entry point is used to perform a specific rounding and/or short-circuit the standard rounding. The GPE variable, set to 0, must be set to 1 to prevent standard rounding. After the rounding, [M]QTY(NL) is loaded with WCPSQTY.

Open tables

Given that this entry point can be called from different functions (quote, order, delivery, invoice), it is difficult to list all the open tables. The open tables are the tables linked to the object currently being executed.