The Email Data User-Exit is used to determine Variables and their values.
The parameters for the User-Exit are:
Parameter | Type | SAP Type | Description |
---|---|---|---|
IM_ETYPE | Importing | /FLOE/ETYPE_CODE | The selected e-mail type passed into the API |
IM_ELANG | Importing | /FLOE/ELANG | The communication language |
IM_DOCUMENT | Importing | /FLOE/DOC_REF | The external document reference if passed into the API |
CH_VARIABLES | Changing | /FLOE/VARS_T | Table of variables passed in to the API |
Add variables or change variable values based on the Email Type, Communication Language and the External Document Reference.
When adding a variable there are 4 fields in the variable table:
- VAR_CODE: The variable name that is referenced in the HTML block
- VALUE: The value of the variable
- ROW_NUM: The number of the current data row. This is used only for repeating data. If the data does not repeat then this should be left blank.
- PARENT_ROW_NUM: The number of the parent's data row. This is used only for NESTED repeating data. If there is no nested repeating data then this should be left blank.
Example: Add a variable
Simple addition of non-repeating variable
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: |
*---------------------------------------------------------------------------* * <<< Start of Customer Code >>> * *---------------------------------------------------------------------------* DATA: ls_variables TYPE /floe/vars_s. ls_variables-var_code = 'DATE_FROM'. ls_variables-value = '01/01/2014'. APPEND ls_variables TO ch_variables. *---------------------------------------------------------------------------* * <<< End of Customer Code >>> * *---------------------------------------------------------------------------* |
Example: Add a repeating variable
Simple addition of a repeating variable with row number
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: |
*---------------------------------------------------------------------------* * <<< Start of Customer Code >>> * *---------------------------------------------------------------------------* DATA: ls_variables TYPE /floe/vars_s. * Sample 2: Add a repeating variable: * (the row number is the instance number of the HTML block the variable appears in) ls_variables-var_code = 'TXT_FIRST_NAME'. ls_variables-value = 'John'. ls_variables-row_num = 1. APPEND ls_variables TO ch_variables. * ls_variables-var_code = 'TXT_FIRST_NAME'. ls_variables-value = 'Joe'. ls_variables-row_num = 2. APPEND ls_variables TO ch_variables. *---------------------------------------------------------------------------* * <<< End of Customer Code >>> * *---------------------------------------------------------------------------* |
Example: Add a nested, repeating variable
Simple addition of variables with logical parents
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: |
*---------------------------------------------------------------------------* * <<< Start of Customer Code >>> * *---------------------------------------------------------------------------* DATA: ls_variables TYPE /floe/vars_s. * Sample 3: Add a nested repeating variable: * (the parent row number is the instance number of the repeating ancestor HTML block) ls_variables-var_code = 'DATE'. ls_variables-value = '11/2/2014'. ls_variables-row_num = 1. ls_variables-parent_row_num = 1. APPEND ls_variables TO ch_variables. ls_variables-var_code = 'DATE'. ls_variables-value = '12/2/2014'. ls_variables-row_num = 1. ls_variables-parent_row_num = 2. APPEND ls_variables TO ch_variables. ls_variables-var_code = 'DATE'. ls_variables-value = '13/2/2014'. ls_variables-row_num = 2. ls_variables-parent_row_num = 1. APPEND ls_variables TO ch_variables. ls_variables-var_code = 'DATE'. ls_variables-value = '14/2/2014'. ls_variables-row_num = 2. ls_variables-parent_row_num = 2. APPEND ls_variables TO ch_variables. *---------------------------------------------------------------------------* * <<< End of Customer Code >>> * *---------------------------------------------------------------------------* |
For more example code refer to the Variables examples.