‎2008 Dec 15 11:31 AM
Moderator message: please use a meaningful subject in future - and not ALL CAPITALS
I am using following perform for messaging, It is sending mail in CSV format, but I want to send the mail written in Outlook Message Body instead of CSV format, please advise.
Thanks,
LM
FORM set_emailbody.
CONSTANTS:
lc_doc_type(3) TYPE c VALUE 'CSV'. " Document type
REFRESH : t_objpack,
t_messbody.
CLEAR : fs_objpack,
fs_messbody.
MOVE:
'Hi,'(004) TO fs_messbody-line.
APPEND fs_messbody TO t_messbody.
CLEAR fs_messbody.
MOVE:
* 'The attachment contains sales order details.'(005)
'www.google.com'
TO fs_messbody-line.
APPEND fs_messbody TO t_messbody.
CLEAR w_tabln.
DESCRIBE TABLE t_messbody LINES w_tabln.
CLEAR fs_messbody.
READ TABLE t_messbody INTO fs_messbody INDEX w_tabln.
fs_docdata-doc_size = ( w_tabln - 1 ) * 255 + STRLEN( w_line ).
MOVE:
space TO fs_objpack-transf_bin,
c_1 TO fs_objpack-head_start,
c_0 TO fs_objpack-head_num,
c_1 TO fs_objpack-body_start,
w_tabln TO fs_objpack-body_num,
lc_doc_type TO fs_objpack-doc_type.
APPEND fs_objpack TO t_objpack.
ENDFORM. " Set_emailbodyEdited by: Matt on Dec 15, 2008 12:47 PM - Added tags
‎2008 Dec 15 11:59 AM
* SEND MAIL
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = lwa_doc_data
* put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
sent_to_all = lv_sent_to_all
* NEW_OBJECT_ID =
TABLES
packing_list = t_objpack " Pass the table of body information here
* OBJECT_HEADER =
contents_bin = gt_messg_att "Pass attachment info here
contents_txt = t_messbody " pass the body contents here
* CONTENTS_HEX =
* OBJECT_PARA =
* OBJECT_PARB =
receivers = lgt_receivers " pass mail ids
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8
.
‎2008 Dec 15 11:37 AM
use object type is 'RAW'
gc_doc_type TYPE gs_objpack-doc_type VALUE 'RAW',
‎2008 Dec 15 11:49 AM
Please use a meaningful subject in future - and not ALL CAPITALS. Also, use to surround your ABAP - it preserves formatting.
‎2008 Dec 15 11:53 AM
If I use RAW, instead of CSV it send the file in attachment with RAW, which again opens in ACROBAT while I want the same in OUTLOOP message body.
Please advise.
Thanks
‎2008 Dec 15 11:59 AM
* SEND MAIL
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = lwa_doc_data
* put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
sent_to_all = lv_sent_to_all
* NEW_OBJECT_ID =
TABLES
packing_list = t_objpack " Pass the table of body information here
* OBJECT_HEADER =
contents_bin = gt_messg_att "Pass attachment info here
contents_txt = t_messbody " pass the body contents here
* CONTENTS_HEX =
* OBJECT_PARA =
* OBJECT_PARB =
receivers = lgt_receivers " pass mail ids
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8
.
‎2008 Dec 18 4:09 AM
‎2008 Dec 18 4:47 AM
I guess, answer is YES, anyways, also look FM MC_SEND_MAIL.
thanq