Skip to Content
author's profile photo Former Member
Former Member

sending smartform output by mail


My requirement is to send smartform output by mail to external mail ids to a given TO:,CC:,BCC: and subject. This smartform is getting triggered by a custom report and not by any standard transaction.

Please give me suggestions how to do this.


Add comment
10|10000 characters needed characters exceeded

1 Answer

  • Posted on Jan 27, 2004 at 06:03 PM

    This actually quite easy to do with SMARTFORMs. First you will want to fill the control_parameters exporting option for the call to your SMARTForms function module. You want to set the getotf field to 'X'. This will cause the function call to return the raw OTF data as part of the job_output_info importing parameter.

    Example 1

    if email = 'X'.

    control-getotf = 'X'.

    move 'X' to control-no_dialog.


    ****Call the Smart Form generated function module

    move-corresponding job_output_options to output_options.

    call function fm_name


    control_parameters = control

    output_options = output_options

    edidc = edidc

    header = header


    job_output_info = job_output_info

    job_output_options = job_output_options


    schedules = schedules[]

    htext = htext[]

    itext = itext[] .

    You can then convert the OTF to PDF using function CONVERT_OTF and send it as a binary attachement using SO_NEW_DOCUMENT_ATT_SEND_API1. There have been other posts on this forum that detail these steps. There are also some parameters to the SmartForms function call for Mail_appl_obj, mail_recipient, and mail_sender. I have never used these however, because I like the greater control that this approach gives you. Often I am generating more than one output that I want to separate into different file attachments on the same E-Mail.

    Add comment
    10|10000 characters needed characters exceeded