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

a question about mail attachment

Hi, everybody.

I have met a question about mail attachment in ABAP.

According to some weblog, I will use SO_DOCUMENT_SEND_API1 to send mail with attachement.

But my question is , if I want to attach a text file in the mail, should I convert it to a binary internal table, and pass it to the 'CONTENTS_BIN'?

I have read some sample which attach a PDF or HTML in mail, but if it is a text file, how can I do with it?

Is there any function module can convert a text file or string to binary format?

Any suggestion is welcome, and hope for your reply

thanks a lot

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on May 30, 2005 at 06:34 AM

    Hi,

    you can use fm to send normal text file:

      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                DOCUMENT_DATA              = DOC_CHNG
                PUT_IN_OUTBOX              = 'X'
           TABLES
                PACKING_LIST               = OBJPACK
                OBJECT_HEADER              = OBJHEAD
                CONTENTS_TXT               = OBJTXT"<-your itab
                RECEIVERS                  = RECLIST

    regards Andreas

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 30, 2005 at 06:34 AM

    Hi,

    Go through this linkhttp://www.sapdevelopment.co.uk/reporting/email/emailhome.htm

    Thanks & Regards,

    Judith.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 30, 2005 at 06:39 AM

    Hi,

    Just try this.

    DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,

    i_tline TYPE TABLE OF tline WITH HEADER LINE,

    v_len_in LIKE sood-objlen.

    CALL FUNCTION 'CONVERT_OTF'

    EXPORTING

    format = 'TXT'

    max_linewidth = 132

    IMPORTING

    bin_filesize = v_len_in

    TABLES

    otf = i_otf

    lines = i_tline

    EXCEPTIONS

    err_max_linewidth = 1

    err_format = 2

    err_conv_not_possible = 3

    OTHERS = 4.

    IF sy-subrc <> 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

    ENDIF.

    Then try to convert the line size be 255 characters.Then attach it.

    Check this link also.

    http://www.sap-img.com/abap-function.htm

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.