2009 Jul 14 7:31 AM
Hi All,
I am using the FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' to send an email of my output to different users with their respective records.It is succesfully sending the mail.In that mail it is displaying the data and along with that it contains an attachment(.txt file) with the same data again.That means the mail contains the data and an attachment with the same content.
I just want to know that, the above FM will work(sending both the content and an attachment with the same content) like that , or we can remove either one of that content (or) attachment with any option in the FM?
Thanks in Advance .....
Regards,
Rakesh.
2009 Jul 14 7:36 AM
Hi Rakesh,
Make sure when you are calling the fm 'SO_DOCUMENT_SEND_API1', the CONTENTS_BIN parameter in disabled.
Regards,
Premal
2009 Jul 14 7:39 AM
try to Use CL_BCS Class.Using this class you can send the email with attachment.
rakesh.
2009 Jul 14 7:40 AM
Hi
Using this Function module ,there is no rule that mail contains the data and an attachment with the same content.
when calling the function module,check the parameters you are passing.
Regards,
Sreeram
2009 Jul 14 7:45 AM
Hi Rakesh,
Comment the Contents_bin parameter in the function module like below
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_document_data
put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
sent_to_all = g_sent_to_all
TABLES
packing_list = i_packing_list
* contents_bin = i_attachment "Comment this one. It makes attachment
contents_txt = i_body_msg
receivers = i_receivers
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.
Thanks
Venkat.O
2009 Jul 14 8:12 AM
Hi All,
I have not used that parameter ( Contents_bin ).Its in disable mode only.see my code below and please tell me how to avoid it.
DESCRIBE TABLE i_body LINES g_att_lines.
READ TABLE i_body INTO lw_body INDEX g_att_lines.
gd_doc_data-doc_size = ( g_att_lines - 1 ) * 255 + STRLEN( lw_body ).
lw_packing_list-transf_bin = space.
lw_packing_list-head_start = 1.
lw_packing_list-head_num = 0.
lw_packing_list-body_start = 1.
lw_packing_list-body_num = g_att_lines.
lw_packing_list-doc_type = 'RAW'.
lw_packing_list-doc_size = 255 * g_att_lines.
APPEND lw_packing_list TO i_packing_list .
CLEAR lw_packing_list.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = gd_doc_data
put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
packing_list = i_packing_list
object_header = i_context
contents_txt = i_body
receivers = i_receivers
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 .
Regards,
Rakesh.
2009 Jul 14 8:14 AM
Make sure you are using SO_DOCUMENT_SEND_API1 and not 'SO_NEW_DOCUMENT_ATT_SEND_API1.
Regards,
Permal
Edited by: Premal Mistry on Jul 14, 2009 12:46 PM
2009 Jul 14 8:12 AM
2009 Dec 29 10:59 AM