Add virtual field (CMS012)

This procedure defines virtual fields.

In output management, if the information required 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).

Virtual fields are also used in these programs:
  • 'Information Browser Category. Open' (CMS010)
  • 'Ad hoc Report Group. Open' (AHS100)

These types of virtual fields can be defined:

  • Calculated fields
  • Description from CSYTAB
  • Name from CSYTAB
  • Currency conversion
  • Logical formula
  • Date conversion
  • Merge data
  • Substring
  • Translate Business Message Data
In ad hoc reporting, additional type of virtual field can be defined:
  • Translate Business Message Data
  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 a 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 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 a 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 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 a 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 specifying a 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 a 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.

Follow these steps to create a merged data

  1. Specify the virtual field ID (naming conversion = &XXXX). Use option 1='Create'.
  2. Specify the column heading by either specifying a 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 8='Merge Data'.
  4. Specify the field length.
  5. Select a value for the 'Conversion' field as necessary. This field has three options: 0 - Not used, 1 - Hexadecimal, and 2 - Base64.
  6. Specify the 'Source of data', 'Field' or 'Value' field. For the decimal format and date format, this information will be based on the locale.
  7. Press Enter.

Follow these steps to create a substring

  1. Specify the virtual field ID (naming conversion = &XXXX). Use option 1='Create'.
  2. Specify the column heading by either specifying a 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 9='Substring'.
  4. Specify the field length.
  5. Specify the 'Field', 'Start position' and 'End position' values.
  6. Press Enter.

Follow these steps to create a business message data translation field

  1. Specify the virtual field ID (naming conversion = &XXXX). Use option 1='Create'.
  2. Specify the column heading by either specifying a 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 11='Translate Business Message Data'.
  4. Press Enter to create the field. 'Business Message Data. Translate' (CRS882) will be shown for entry of business message data translation.