Development > Script dictionary > Update transactions 

This function is used to create system transactions in the dictionary. These transactions will be used by the system transactions execution function to mass-update the database (create, modify or delete lines).

In addition, it is important to notice that the system transactions are included in the data dictionary. It means that revalidating the folder deletes all the system transactions that had not been protected by a specific activity code. Then, it can transfer standard system transactions in the folder if the editor decides whether to deliver system transactions in the software reference folder (currently, it is not applied).

Prerequisites

SEEREFERTTO Refer to documentation Implementation

Screen management

The definition of a screen is made with the help of 2 tabs: the general tab for the definition of the transaction and a tab containing the formulas for the selection of records to process and tables to update.

Header

Presentation

The header is used to identify the function.

Close

 

Fields

The following fields are present on this tab :

  • Code (field COD)

This code identifies the system transaction to be launched.

  • Description (field ZINTIT)

 

Close

 

Tab General

Presentation

The general context linked to the system transaction is defined in this tab:

  • on the one hand, the main table and the possible linked tables that can be updated.
  • on the other hand, the possible setups to enter (in a 6 lines tables maximum). Then, these setups can be used as variables named V1 to V6 in the second tab table.

Close

 

Fields

The following fields are present on this tab :

Block number 1

  • Module (field MODULE)

Select a module for the setup.

Use this field to specify if the screen has to be created in the folder database. This is the case when the module linked to the screen is active on the folder.

  • Short description (field ZINTITSHO)

 

An activity code is used to:

  • Make an element optional in the dictionary if the value associated with the activity code is null
  • Identify the specific/custom elements if they are marked with a code starting with X, Y, or Z
  • Size a maximum number of lines when the activity code marks elements from a grid

If the activity code is disabled:

  • The marked element will not be useable
  • The associated code will not be generated nor activated

This access code makes it possible to prohibit access to the current record for some users.

If the field is populated, only users that have this access code with read access rights (and write access rights respectively) can view (or with write access rights, modify) the record.

Execution right that can be attached to the access code that is used to authorize the execution of the system transaction.

Taking into account the fact that this function is sensitive, it is advisable to enter an activity code and to carefully limit the number of users that have the execution right.

Define the principal table on which the transaction is going to be executed.

Grid Linked tables

Identify the tables linked to the principal table.

  • Link (field LNKEXP)

This field is defined as one or more calculated expressions separated by a semi colon. Each expression is evaluated, and the result used to identify the value of the key used to perform the join. When multiple joins are authorized, only the first elements of the key can be given.

In the expressions, constants can be used, as well as fields coming from the tables previously defined in the link list.

Grid Parameters

Define the data type corresponding to the entered parameter. This is used to control the value by means of a table, if required.

  • Description (field ZVARINTIT)

 

  • Length (field VARLNG)

Define the maximum number of characters that must be entered in order to save the parameter.

  • Menu (field VARMEN)

When the entry parameter is of the local menu type, the local menu number concerned is entered here.

  • Object parameter (field VARPAR)

This field defines an addition required for the definition of the data type, if required. In the case of a miscellaneous table, the addition defines the table number, for example.

  • Default value (field VARDEF)

Used to define a default value by means of a calculated expression can contain constants and variables.

A code for a control table can be entered in this field to carryout a specific validity control associated with the parameter defined in the system transaction.

Close

 

Tab Details

Presentation

This tab is used to specify the lines of the joins browsed by selection criteria and to detail the updates carried out by the system transaction on these lines. This can be:

  • a record creation from a selected record (it will be necessary to set up only one line of this type by requested creation, for the corresponding key field). This is the equivalent of a record duplication.
  • a modification of the value of one or several fields (one line by field).
  • a record deletion (nothing is specified for the fields).

 

Fields

The following fields are present on this tab :

Grid Selections

  • Formulas (field SELFRM)

This field is used to define the logical expressions to filter the records to be updated or to be deleted. It is possible to use the fields from the principal table, the linked tables and the variables defined in the launch parameters grid in the first tab (V1 to Vn).

If the result of one of these expressions is false, the save will not be carried out.

Grid Update

Defines the table in which the operation must be carried out.

  • Transaction (field FLDSUP)

The operation carried out can be :

  • a modification (then numbering of the fields to be modified).
  • a deletion (no additional information in the name of the table is to be supplied).
  • a creation (in this case, loading the fields record by record).
  • Field (field FLD)

Define the field where that is to receive the value (in modification or in creation). This field comes from the entry table on the line.

  • Formulas (field FLDFRM)

This formula is evaluated to give the value of the field to be assigned. Fields from online tables, constants as well as the V1 to Vn variables defined in the launch parameters grid in the first tab can be used in this formula.

 

Specific Buttons

The validation is used to generate the automatic processing. It contains all the personalized processing for the transaction:

  • Declaration of the variables named V1, V2,..., V6
  • Declaration of the tables
  • Links between all the tables (Link instruction)
  • Filter on the records in the table, if it is unique, or an abbreviation resulting from the link.
  • Update transaction
  • Entry in the espion.tra file in the tmp directory.

The following fields are included on the window opened through this button :

Block number 1

  • Code (field COD)

This code identifies the system transaction to be launched.

  • field DES

Title associated with the previous code.

Block number 2

  • Test mode (field TEST)

If this box is checked, the transaction is carried out without any table being updated, and the trace mentions which data would be updated if the process were launched in real mode.

It is possible to set a maximum number of transactions to be processed.

  • Number of transactions (field NOMBRE)

In test mode, this field limits the number of processed table lines.

Grid

  • Variable (field VARDES)

Name of each variable which can be entered as system transaction parameter.

  • Value (field VALEUR)

It defines the values associated with the transaction parameters when said transaction is being carried out.

Close

This button is used to directly execute the transaction. It is a system transaction utility.

The following fields are included on the window opened through this button :

Block number 1

  • field OBJET

 

  • field CLES

 

Block number 2

  • From folder (field DOSORG)

Use this field to define the folder from which the record will be copied. The possible syntaxes are described in the Dedicated appendix.

  • All folders (field TOUDOS)

Use this option to copy the record to all the folders defined in the dictionary (ADOSSIER table of the current solution).

  • To folder (field DOSDES)

Use this field to define the folder to which the record will be copied. The possible syntaxes are described in the Dedicated appendix.

Close

This button is used to copy the transaction definition to another folder. Warning, it is necessary to validate the transaction in the destination folder.

Algorithm and generated processing

It is important to note that simultaneous modifications and duplications in the same transaction, provided that the declaration order is observed. For example, if the following lines are entered:

Table

Transaction

Field

Formulas

TABLE1

Modification

FIELD1

EXPRESSION1

TABLE1

Creation

FIELD2

EXPRESSION2

TABLE2

Creation

FIELD3

EXPRESSION3

TABLE2

Modification

FIELD4

EXPRESSION4

TABLE3

Modification

FIELD5

EXPRESSION5

The algorithm applied is the following:

For [all the lines of the join concerned]

read the TABLE1 current line, Allocate FIELD1 and FIELD2, then create a lines TABLE1

read the TABLE1 current line, Allocate FIELD1 and FIELD2, then create a line TABLE1

Allocate FIELD4, then modify by re-writing the TABLE2 current line

Read the TABLE3 current line, Allocate FIELD5, then modify by re-writing TABLE3

In any case, a developer can view the processing generated by the validation. Its name is defined by the transaction code, prefixed by the WMAMI characters.

Error messages

In addition to the generic error messages, the following messages can appear during the entry :

Incorrect length

The length of a variable is controlled according to its type.

Type

Maximum length

Title

 30

Short integer

 4

Long integer

 8

Characters

 250

Date

4, 6 or 8 (authorized length)

Decimal

32 (for the integer and decimal section)

Local Menu No. incorrect

The number entered corresponds to a message chapter and not a local menu.

Local menu not defined

The number entered does not correspond to an existing local menu.

Incorrect value

It is not possible to update a table non-defined as the principal table or table linked in this transaction record.

Non-existent field

The field must exist in the table dictionary in the table specified on this same line.

Index incorrect

The dimension expressed for this field must not exceed that defined for this same field in the table dictionary.

Tables used

SEEREFERTTO Refer to documentation Implementation