Image User-Exit

The Image User-Exit can be used to add an embedded image into the e-mail.

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_VARIABLES Importing /FLOE/VARS_T Table of variables and their values
EX_IMAGETAB Exporting /FLOE/ Table of images together with a variable code used to store the 'content id' of the image.  This variable must be referenced in an HTML block at the required position of the image.

Sample code:

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

  DATA: lv_content   TYPE xstring,
        lo_mime_rep  TYPE REF TO if_mr_api,
        ls_imagetab  TYPE /floe/image_s.
*
  lo_mime_rep = cl_mime_repository_api=>if_mr_api~get_api( ).

  lo_mime_rep->get(
    EXPORTING
      i_url              = '/SAP/BC/BSP/FLM/PORTAL_MIMES/Images/Arch.jpg'
      i_check_authority  = ''
   IMPORTING
      e_content          = lv_content
    EXCEPTIONS
      parameter_missing  = 1
      error_occured      = 2
      not_found          = 3
      permission_failure = 4
      OTHERS             = 5 ).

  ls_imagetab-var_code = 'IMAGE_ID1'.
  ls_imagetab-data = lv_content.
  APPEND ls_imagetab TO ex_imagetab.

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

Please note that user-exits produced by FLOE version 100 will not contain the following line in the comments/sample code:

i_check_authority  = ''

Import parameter i_check_authority has a default value of X, so unless it is passed in as blank the 'get' method will perform an authorization check to determine whether the user triggering the email has authorization to view the image stored in the MIME repository (authorization object = S_DEVELOP, DEVCLASS = the package the MIME object has been assigned to, OBJTYPE = SMIM, ACTVT = 03). User-exits generated by future FLOE versions will pass i_check_authority in as blank in the sample code/comments section so that this authorization check is skipped.

The image is referenced in the HTML block as follows:

<p><img alt="[image]" src="cid:&IMAGE_ID1&" /></p>