on 05-02-2006 10:53 AM
Hi Experts,
I have developed a report which has given the
Due Date Analysis on Customers. When i run the Report then
automatically mail will send to customer in Excel format.
what are the FM's used for this and what is the Procudure to Send a mail thro abap report?
I am using alv list for my output display.
so from the Internal table itab_out , i want to convert to excel file.
Is there any FMs available?
Thanks,
Neptune.M
HI NEPTUNE,
To download the data from itab to excel u can use FM GUI_DOWNLOAD with filetype as 'DAT'.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = 'C:\ABC.XLS'
FILETYPE = 'DAT'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = ITAB
FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
AND U CAN USE FM SO_NEW_DOCUMENT_ATT_SEND_API1 FOR SENDING MAIL THRU ABAP
HOPE THIS HELPS,
PRIYA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai Neptune
try with
CALL FUNCTION 'RFC_MAIL' DESTINATION 'LOCAL_EXEC'
EXPORTING USER = 'mailid@dsds.com'
TABLES MAIL = IT_MAIL.
TABLES MAIL = ITAB.
endif.
check with the following code
REPORT Z_SENDITAB_EMAIL_SREE_13424 .
tables : mara.
DATA IT_MAIL(200) TYPE C OCCURS 0 WITH HEADER LINE.
message body:
IT_MAIL = '1st line.'. APPEND IT_MAIL.
IT_MAIL = '2nd line.'. APPEND IT_MAIL.
IT_MAIL = '3rd line.'. APPEND IT_MAIL.
IT_MAIL = '4th line.'. APPEND IT_MAIL.
to view the following function (cannot be viewed in se37):
go to sm59, select 'TCP/IP connections',
select and open 'SERVER_EXEC' or 'LOCAL_EXEC',
look on the pull down menu SYSTEM INFORMATION->FUNCTION LIST
data : begin of itab occurs 0,
matnr like mara-matnr,
mtart like mara-mtart,
mbrsh like mara-mbrsh,
meins like mara-meins,
end of itab.
select
matnr
mtart
mbrsh
meins
from mara
into table itab.
if sy-subrc = 0.
CALL FUNCTION 'RFC_MAIL' DESTINATION 'LOCAL_EXEC'
EXPORTING USER = 'srini_paru@yahoo.com'
TABLES MAIL = IT_MAIL.
TABLES MAIL = ITAB.
endif.
CASE SY-SUBRC.
WHEN 0. WRITE 'E-mail sent successfully.'.
WHEN OTHERS. WRITE 'Error sending E-mail!'.
ENDCASE.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.