05-30-2005 7:28 AM
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
05-30-2005 7: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
05-30-2005 7:34 AM
Hi,
Go through this linkhttp://www.sapdevelopment.co.uk/reporting/email/emailhome.htm
Thanks & Regards,
Judith.
05-30-2005 7: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
05-30-2005 7: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.