‎2006 Oct 27 8:24 AM
The following code is not working,the mail is not getting posted to the receiver.Can sum1 plz help...
DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
DATA: objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
DATA: doc_chng LIKE sodocchgi1.
DATA: tab_lines LIKE sy-tabix.
Creation of the document to be sent
File Name
doc_chng-obj_name = 'SENDFILE'.
Mail Subject
doc_chng-obj_descr = 'Send External Mail'.
Mail Contents
LOOP AT git_error INTO gwa_error.
t1 = 'Success'.
t2 = 'Operation successful'.
ENDLOOP.
objtxt = t1.
APPEND objtxt.
objtxt = t2.
APPEND objtxt.
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
Creation of the entry for the compressed document
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'RAW'.
APPEND objpack.
Completing the recipient list
reclist-receiver = 'vaishali.rana@capgemini.com'.
reclist-rec_type = 'U'.
APPEND reclist.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = doc_chng
put_in_outbox = 'X'
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
receivers = reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
IF reclist-retrn_code = 0.
WRITE:/ 'hello'.
*WRITE 'The document was sent'.
ELSE.
WRITE 'The document could not be sent'.
‎2006 Oct 27 8:48 AM
The code is working fine for me. Probably you should have got two mails from me.
regards,
Sandeep Josyula
*Mark if helpful
‎2006 Oct 27 8:54 AM
Hi vaishali,
1. The mail may not be sent immediately.
2. It is scheduled by basis team to actually send, with some interval.
3. To send immediately, goto SCOT transaction,
and Execute.
regards,
amit m.
‎2006 Oct 27 8:54 AM
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = doc_chng
put_in_outbox = 'X'
<b>commit_work = 'X'</b>
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
receivers = reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
Just the parameter as indicated in bold and it should work.
Dont forget to assign points for helpful answers
‎2006 Oct 30 4:38 PM
Check whether RSCONN01 program is scheduled in background to sent email regular or execute the above program to send email immediatley.