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
- Start (CMS006), select XML structure and use option 11='XML Structure. Open Section' to start (CMS007).
- Select structure and use option 11='XML Structure. Open Section Elements' in (CMS007) to start (CMS009).
- Click 'Virtual fields' to start 'Virtual Fields. Connect' (CMS012).
Follow these steps to create a calculated field
- Specify the virtual field ID (naming convention = &XXXX). Use option 1='Create'.
- 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.
- Select Virtual field type 1='Calculation'.
- 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.
- Specify the number of decimal places, either by specifying Number of decimal places 0 – 4, or selecting a field information code.
- Specify the calculation formula by specifying Operator (+, -, /, *), Object (field from main table, related table, custom subtotal fields, or other virtual field) and factor.
- Press Enter.
Follow these steps to create a description or name field
- Specify the virtual field ID (naming convention = &XXXX). Use option 1='Create'
- 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.
- Select virtual field type 3='Description' from CSYTAB or 4='Name' from CSYTAB.
- Specify the read option for key field CTDIVI (Division). Usually, this should be set to blank.
- 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.
- Specify the read option for key field CTSTKY (Key value). Usually, this should be set to 'Equal to'. Object is normally the field.
- Specify the read option for key field CTLNCD (Language). Usually, this should this be set to blank.
- 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
- Specify the virtual field ID (naming convention = &XXXX). Use option 1='Create'
- 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.
- Select virtual field type 5–'Currency conversion'.
- Specify the read option for base value. This is the value to convert.
- 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.
- Specify the read option for rate type. If 'Blank value' is selected, Rate type 01 is used.
- Specify the read option for from currency. This is the currency of the base value before the conversion.
- Specify the read option for to currency. This is the currency of the base value after the conversion.
- Press Enter.
Follow these steps to create a logical formula field
- Specify the virtual field ID (naming convention = &XXXX). Use option 1='Create'.
- 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.
- Select virtual field type 6-'Logical formula'.
- Specify the logical type for the condition (alphanumeric or numeric).
- Specify the first operand (always a field from the field group).
- Specify the condition.
- Specify how to set the second operand (field from field group, specific value, or blank).
- Specify how to combine 2 or 3 different conditions.
- Specify how to set the value if condition is true (field from field group, specific value, or blank).
- Specify how to set the value if condition is false (field from field group, specific value, or blank).
- Press Enter.
Follow these steps to create a date conversion field
- Specify the virtual field ID (naming convention = &XXXX). Use option 1='Create'.
- 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.
- Select virtual field type 7-'Date'.
- Specify the Base date (1-'Current date', 2-'Object', 3-'Specific date').
- Specify the Date output (1-'Date' YYYYMMDD, 2-'Day number', 3-'Working day number', 4-'Bank day number').
- Press Enter.
Follow these steps to create a merged data
- Specify the virtual field ID (naming conversion = &XXXX). Use option 1='Create'.
- 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.
- Select virtual field type 8='Merge Data'.
- Specify the field length.
- Select a value for the 'Conversion' field as necessary. This field has three options: 0 - Not used, 1 - Hexadecimal, and 2 - Base64.
- Specify the 'Source of data', 'Field' or 'Value' field. For the decimal format and date format, this information will be based on the locale.
- Press Enter.
Follow these steps to create a substring
- Specify the virtual field ID (naming conversion = &XXXX). Use option 1='Create'.
- 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.
- Select virtual field type 9='Substring'.
- Specify the field length.
- Specify the 'Field', 'Start position' and 'End position' values.
- Press Enter.
Follow these steps to create a business message data translation field
- Specify the virtual field ID (naming conversion = &XXXX). Use option 1='Create'.
- 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.
- Select virtual field type 11='Translate Business Message Data'.
- Press Enter to create the field. 'Business Message Data. Translate' (CRS882) will be shown for entry of business message data translation.