Add virtual field

This procedure defines virtual fields. If the information needed in the XML output is not contained in a database table, the last option for adding fields is to use virtual fields. A virtual field is defined per printer file and XML section.

After creating the virtual fields, the fields can be selected in an element from (CMS009).

These types of virtual fields can be defined:

  1. Start (CMS006), select XML structure and use option 11='XML Structure. Open Section' to start (CMS007).

  2. Select structure and use option 11='XML Structure. Open Section Elements' in (CMS007) to start (CMS009).

  3. Click 'Virtual fields' to start 'Virtual Fields. Connect' (CMS012).

Follow these steps to create a calculated field

  1. Specify the virtual field ID (naming convention = &XXXX). Use option 1='Create'.

  2. Specify the column heading by specifying either the description or a message ID. If you specify a Description, it can also be defined per language by clicking the Language button. If you specify a message ID, the column heading is automatically displayed in the end user's M3 language.

  3. Select Virtual field type 1='Calculation'.

  4. Specify the calculation sequence. The field is used if other virtual fields are used as objects in the calculation formula. The current virtual field must have a higher calculation sequence then the virtual fields used as objects in the calculation formula.

  5. Specify the number of decimal places, either by specifying Number of decimal places 0 – 4, or selecting a field information code.

  6. Specify the calculation formula by specifying Operator (+, -, /, *), Object (field from main table, related table, custom subtotal fields, or other virtual field) and factor.

  7. Press Enter.

Follow these steps to create a description or name field

  1. Specify the virtual field ID (naming convention = &XXXX). Use option 1='Create'

  2. Specify the column heading by either specifying the description or a message ID. If you specify a description, it can also be defined per language by clicking language. If you specify a message ID, the column heading is automatically displayed in the end user's M3 language.

  3. Select virtual field type 3='Description' from CSYTAB or 4='Name' from CSYTAB.

  4. Specify the read option for key field CTDIVI (Division). Usually, this should be set to blank.

  5. Specify the read option for key field CTSTCO (Constant value). Usually, this should this be set to 'Equal to'. Value is normally the last 4 positions for the field.

  6. Specify the read option for key field CTSTKY (Key value). Usually, this should be set to 'Equal to'. Object is normally the field.

  7. Specify the read option for key field CTLNCD (Language). Usually, this should this be set to blank.

  8. Press Enter.

A quick entry way to define a virtual field for name from the related system table (CSYTAB) is also available. Click 'Related System Table', specify the key value (for example MMCUCD for currency code name based on MITMAS), and click OK.

Follow these steps to create a currency conversion field

  1. Specify the virtual field ID (naming convention = &XXXX). Use option 1='Create'

  2. Specify the column heading by either specifying the description or a message ID. If specifying a Description, it can also be defined per language by clicking the language button. If specifying a message ID, the column heading is automatically displayed in the end user's M3 language.

  3. Select virtual field type 5–'Currency conversion'.

  4. Specify the read option for base value. This is the value to convert.

  5. Specify the read option for base division. The division can either be set 'Equal to' a division object, or found through a facility or warehouse field.

  6. Specify the read option for rate type. If 'Blank value' is selected, Rate type 01 is used.

  7. Specify the read option for from currency. This is the currency of the base value before the conversion.

  8. Specify the read option for to currency. This is the currency of the base value after the conversion.

  9. Press Enter.

Follow these steps to create a logical formula field

  1. Specify the virtual field ID (naming convention = &XXXX). Use option 1='Create'.

  2. Specify the column heading by either specify the description or a message ID. If specifying a description, it can also be defined per language by pressing the language button. If specifying a message ID, the column heading is automatically displayed in the end user's M3 language.

  3. Select virtual field type 6–'Logical formula'.

  4. Specify the logical type for the condition (alphanumeric or numeric).

  5. Specify the first operand (always a field from the field group).

  6. Specify the condition.

  7. Specify how to set the second operand (field from field group, specific value, or blank).

  8. Specify how to combine 2 or 3 different conditions.

  9. Specify how to set the value if condition is true (field from field group, specific value, or blank).

  10. Specify how to set the value if condition is false (field from field group, specific value, or blank).

  11. Press Enter.

Follow these steps to create a date conversion field

  1. Specify the virtual field ID (naming convention = &XXXX). Use option 1='Create'.

  2. Specify the column heading by either specifying the description or a message ID. If specifying a description, it can also be defined per language by pressing the language button. If specifying a message ID, the column heading is automatically displayed in the end user's M3 language.

  3. Select virtual field type 7–'Date'.

  4. Specify the Base date (1-Current date, 2-Object, 3-Specific date).

  5. Specify the Date output (1-Date YYYYMMDD, 2-Day number, 3-Working day number, 4-Bank day number).

  6. Press Enter.

Related topics