2009 Apr 07 6:01 AM
Hi Gurus I have to attach data in excel format, but getting a pbm here. I am using the following code..
can anyone suggest on this please..
docdata-obj_name = 'AUTOSEND'(m01).
docdata-obj_descr = trpt-text. "report title
docdata-expiry_dat = docdata-obj_expdat = sy-datum + 14.
Recepient's eMail message body text:
IF msgtab[] IS INITIAL. "no message body passed
PERFORM std_msg_body_for_report. "use standard for any report
ELSE.
READ TABLE msgtab INDEX 1.
docdata-obj_descr = msgtab. "1st line as title
objtxt[] = msgtab[]. "message text as passed
ENDIF.
Write Message Body to Packing List (Main)
PERFORM write_msg_body_to_pack_list.
OBJBIN = '|'.
APPEND OBJBIN.
DESCRIBE TABLE objbin LINES tab_lines. "rpt attachment lines
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = tab_lines * 255.
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = '.csv'. "attachment type
objpack-obj_name = p_repid.
IF msgtab[] IS INITIAL.
objpack-obj_descr = trpt-text. "report title
ELSE.
objpack-obj_descr = msgtab. "1st passed message line
ENDIF.
APPEND objpack.
Create receiver list
reclist-receiver = p_recvr. "external email address
reclist-rec_type = 'U'. "(internet addr)
APPEND reclist.
Send Message
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
commit_work = 'X'
*>>>>>>>>> put_in_outbox = 'X' "sy-uname gets copy
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin "rpt attachment
contents_txt = objtxt
receivers = 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.
2009 Apr 07 6:33 AM
Hi...
objpack-doc_type = '.csv'. "attachment type
try that:
objpack-transf_bin = ''.
objpack-doc_type = 'RAW'. " the description of file: objpack-doc_type = 'CSV'.
bestreg robert
Hi...
objpack-doc_type = '.csv'. "attachment type
try that:
objpack-transf_bin = ''.
objpack-doc_type = 'RAW'. " the description of file: objpack-doc_type = 'CSV'.
bestreg robert
2009 Apr 07 6:33 AM
Hi...
objpack-doc_type = '.csv'. "attachment type
try that:
objpack-transf_bin = ''.
objpack-doc_type = 'RAW'. " the description of file: objpack-doc_type = 'CSV'.
bestreg robert
2009 Apr 07 6:38 AM
Hi try this
objpack-doc_type = 'XLS' instead of objpack-doc_type = 'CSV'
2009 Apr 07 7:00 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |