Skip to Content

How to add note / some text as attachment into the workflow container from program?


I am looking to add the some text as attachment to the workflow container from Z program. And later steps I want to use that text in the email attachment. Could you please advice me on how to do this one?

Thank you,


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    May 09, 2017 at 05:16 AM

    Hi Praveen,

    Maybe this can help:

    Please check with this FM:





    Add comment
    10|10000 characters needed characters exceeded

    • Hi,

      Thankyou. Yes now able to add the attachment successfully.

              if wa_item-rb_reject eq icon_wd_radio_button.
                loop at wa_item-decision_text into data(ls_decsion_text).
                  concatenate l_text ls_decsion_text lc_linefeed into l_text separated by space.
      * construct attachment header
                lv_atthdr-file_type      = 'T'.
                lv_atthdr-file_name      = zcl_sd_sample_order_wf_exit=>c_att_name_reason_for_rej.
                lv_atthdr-file_extension = 'TXT'.
                lv_atthdr-language       = sy-langu.
                call function 'SAP_WAPI_ATTACHMENT_ADD'
                    workitem_id    = wa_item-top_wi_id
                    att_header     = lv_atthdr
                    att_txt        = l_text
                    document_owner = sy-uname
                    language       = sy-langu
                    do_commit      = ' '
                    return_code    = lv_return_code
                    att_id         = lv_att_id
      *       TABLES
      *             MESSAGE_LINES  =
      *             MESSAGE_STRUCT =

      Thank you.

  • May 09, 2017 at 05:33 AM

    Hi PC,

    am not clear on your requirement, how can you add a text as an attachment?

    Either you can add text to your email or add an file. Please elaborate the requirement.

    Or do you mean that you want to keep a text in a WF container which you will use later in your steps?

    Aditya V

    Add comment
    10|10000 characters needed characters exceeded

  • May 09, 2017 at 01:41 PM

    If you're approving/rejecting via event, add comments and attachments as event parameters. Then just bind it into your WF.

    Add comment
    10|10000 characters needed characters exceeded