HTML Block Determination User-Exit

The HTML Block Determination User-Exit can be used to over-ride the configuration settings for the assignment of HTML blocks to an Email Type.

The parameters of the User-Exit are:

Parameter Type SAP Type Description
IM_ETYPE Importing /FLOE/ETYPE_CODE The e-mail type passed in to the API
IM_ELANG Importing /FLOE/ELANG The communication language for the e-mail
IM_DOCUMENT Importing /FLOE/DOC_REF The external document reference if passed into the API
IM_RECIPIENTS Importing /FLOE/REC_EMAIL_T Table of recipients for the e-mail
IM_VARIABLES Importing /FLOE/VARS_T Table of variables and their values
CH_HBLOCK_LIST Changing /FLOE/HBLOCK_LIST_T Table of HTML blocks with their sequence number read from the configuration settings table

You can redetermine the list of HTML blocks and sequences based on the Email Type, Communication Language, External Document Reference, Recipients and Variables.

Sample code: Determine an alternate HTML block based on Company Code Variable 'BUKRS'

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:
*---------------------------------------------------------------------------*
*                      <<< Start of Customer Code >>>                       *
*---------------------------------------------------------------------------*

  DATA: ls_hblock_list TYPE /floe/hblock_list_s,
        ls_variables   TYPE /floe/vars_s,
        l_hblock       TYPE /floe/hblock_code.

  READ TABLE im_variables INTO ls_variables WITH KEY var_code = 'BUKRS'.
  CHECK sy-subrc EQ 0.

* Build new HBLOCK name
  CONCATENATE 'HEADING_' ls_variables-value INTO l_hblock.

  LOOP AT ch_hblock_list INTO ls_hblock_list.
*
* Replace HBLOCK at sequence 010.   
    IF ls_hblock_list-hblock_seq EQ '010'.
      ls_hblock_list-hblock = l_hblock.
      MODIFY ch_hblock_list FROM ls_hblock_list.
    ENDIF.
*
  ENDLOOP.

*---------------------------------------------------------------------------*
*                      <<< End of Customer Code >>>                         *
*---------------------------------------------------------------------------*

An alternate method to dynamically show or hide an HTML block is to use a variable to control the style of a <div> tag.  See the Variables examples for more information.