on 09-04-2007 5:30 AM
Hii All,
what r the mandary parameters that i hv to gv for this Fm SO_NEW_DOCUMENT_ATT_SEND_API1.
for mail..
i hv done till converting OTF data to PDF format n now my requiremnet is to send attachment through mail.
so how to use SO_NEW_DOCUMENT_ATT_SEND_API1 this FM..
n what sdl i declare before using this FM.?
Hi,
In the FM, also make,
<b>commit_work = 'X'</b>
Regards,
Pritha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check this sample code
data : it_docdata like sodocchgi1 occurs 0 with header line,
it_objpacklist like sopcklsti1 occurs 0 with header line,
it_contentbin like solisti1 occurs 0 with header line,
it_contenttxt like solisti1 occurs 0 with header line,
it_reclist like somlreci1 occurs 0 with header line.
data : l_lines type i.
refresh : it_docdata, it_objpacklist, " it_objheader
it_contentbin, it_contenttxt, it_reclist.
* Text contents of the email
it_contenttxt-line = text-003.
append it_contenttxt.
clear : it_contenttxt.
* Contents of the Excel File
move it_text[] to it_contentbin[].
* Attributes of new document
it_docdata-obj_name = 'Message'.
it_docdata-obj_descr = text-002.
append it_docdata.
clear : it_docdata.
* For Email message
describe table it_contenttxt lines l_lines.
it_objpacklist-transf_bin = 'X'.
it_objpacklist-head_start = 1.
it_objpacklist-head_num = 0.
it_objpacklist-body_start = 1.
it_objpacklist-body_num = l_lines.
it_objpacklist-doc_type = 'TXT'.
it_objpacklist-obj_name = 'Message'.
it_objpacklist-doc_size = l_lines * 255.
append it_objpacklist.
clear : it_objpacklist.
* For Email attachment
clear : l_lines.
describe table it_text lines l_lines.
it_objpacklist-transf_bin = 'X'.
it_objpacklist-head_start = 1.
it_objpacklist-head_num = 0.
it_objpacklist-body_start = 1.
it_objpacklist-body_num = l_lines.
it_objpacklist-doc_type = 'XLS'.
it_objpacklist-obj_name = 'Attachment'.
concatenate 'Performance Analysis of ' p_user ' in this server'
into it_objpacklist-obj_descr.
append it_objpacklist.
clear : it_objpacklist.
* Receivers list
it_reclist-receiver = email.
it_reclist-rec_type = 'U'.
append it_reclist.
clear : it_reclist.
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = it_docdata
put_in_outbox = 'X'
tables
packing_list = it_objpacklist
contents_bin = it_contentbin
contents_txt = it_contenttxt
receivers = it_reclist
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.
if sy-subrc <> 0.
write 😕 'Error sending Email to ' , p_email.
else.
write 😕 'Mail successfully sent to ' , p_email.
endif.
Regards
Gopi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.