12-09-2008 12:01 PM
Hi All,
I have a requirement of sending data as Email with Excel sheet as attachment.
I have populated the data into internal table populating into other table and passing this table as
parameter to the FM SO_NEW_DOCUMENT_ATT_SEND_API1.
Now in my outbox the status is Yellow(highlited) Sending in process.
Are there any prerequisites that i need to do before doing this?
Thanks
Madan
12-09-2008 12:03 PM
Hi,
After the call to the FM
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'....
WAIT UP TO 1 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
Also ensure that BASIS has configured sending external emails.
Best regards,
Prashant
12-09-2008 12:23 PM
Hi Prashanth,
Thanks for the solution.Its working fine.
But when i am sending The receiver isreceiving 2 file.
1)Excel sheet
2).Txt which contains body of the message.
I dont want this .TXT
Can you help me..?/
Thanks
12-09-2008 12:04 PM
HI,
Add this code after the Fm SO_NEW_DOCUMENT_ATT_SEND_API1.
SUBMIT rsconn01
WITH mode = 'INT'
WITH output = ''
AND RETURN.
12-09-2008 12:04 PM
12-09-2008 12:14 PM
hi,
use this
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
check this standard pogram
http://www.sap-img.com/abap/sending-email-with-attachment.htm
also check blog
thanks.
12-09-2008 12:27 PM
Hi,
* Describe the body of the message
lwa_packing_list-transf_bin = space.
* For attachment
lwa_packing_list-transf_bin = 'X'.
Best regards,
Prashant
12-09-2008 12:31 PM
Check this code which is simple and will be able to attach the excel file
CLASS cl_abap_char_utilities definition load.
DATA: tab type x value 9,
ctab(1) type c,
clen type string.
*constants: ctab(1) type c value ','.
DATA: one type char3 value 'one',
two type char3 value 'two',
three type char5 value 'three',
out(1000) type c occurs 0 with header line.
CTAB = cl_abap_char_utilities=>newline .
"vertical_tab.
clen = cl_abap_char_utilities=>MaxCHAR. "charsize.
*class cl_gui_frontend_services definition load.
concatenate one
space
two
space
three
space
clen
INTO out SEPARATED BY tab.
into out. "separated by CTAB.
append out.
call function 'GUI_DOWNLOAD'
exporting
filename = 'c:\out.xls'
filetype = 'ASC'
trunc_trailing_blanks = 'X'
tables
data_tab = out
exceptions
file_write_error = 01
no_batch = 04
unknown_error = 05
others = 99.