Send an Excel Attachment as mail to a list of recipients
Hello Everyone,
I am trying to send an email with an excel attachment. My code has been activated successfully. But I haven't received any mail.
Kindly help.
My code is as below.
FORM Z_SENDMAIL .
DATA lv_receiver type SOMLRECI1-RECEIVER.
TYPES: BEGIN OF LTS_CHARFINAL,
matnr(18) type c,
maktx(40) type c,
idnlf(35) type c,
ltsnr(6) type c,
werks(4) type c,
ltsbz(20) type c,
ernam(12) type c,
verpr(11) type c,
soh_qty(13) TYPE c,
int_qty(13) TYPE c,
ext_soh(11) TYPE c,
hol_qty(13) TYPE c,
all_qty(13) TYPE c,
bac_qty(13) TYPE c,
ext_ttl(11) TYPE c,
END OF LTS_CHARFINAL.
DATA: WA_CHARFINAL TYPE LTS_CHARFINAL.
lv_receiver = '[email protected]'.
CONCATENATE 'ITEM_TRIM'
'DESCRIPTION'
'VEND_ITEM'
'PLNRCODE'
'LOCATION'
'SITE'
'PLANNER'
'AVERAGE_COST'
'SOH_QTY'
'INTRANS_QTY'
'EXT_COST_SOH'
'HOLD_QTY'
'ALLOC_QTY'
'BACKORD_QTY'
'EXT_COST_TTL_INVEN'
INTO IT_ATTACH SEPARATED BY CON_TAB.
CONCATENATE CON_CRET IT_ATTACH INTO IT_ATTACH.
APPEND IT_ATTACH.
LOOP AT GIT_FINAL INTO GWA_FINAL.
wa_charfinal-matnr = gwa_final-matnr.
wa_charfinal-maktx = gwa_final-maktx.
wa_charfinal-idnlf = gwa_final-idnlf.
wa_charfinal-ltsnr = gwa_final-ltsnr.
wa_charfinal-werks = gwa_final-werks.
wa_charfinal-ltsbz = gwa_final-ltsbz.
wa_charfinal-ernam = gwa_final-ernam.
wa_charfinal-verpr = gwa_final-verpr.
wa_charfinal-soh_qty = gwa_final-soh_qty.
wa_charfinal-int_qty = gwa_final-int_qty.
wa_charfinal-ext_soh = gwa_final-ext_soh.
wa_charfinal-hol_qty = gwa_final-hol_qty.
wa_charfinal-all_qty = gwa_final-all_qty.
wa_charfinal-bac_qty = gwa_final-bac_qty.
wa_charfinal-ext_ttl = gwa_final-ext_ttl.
CONCATENATE wa_charfinal-matnr
wa_charfinal-maktx
wa_charfinal-idnlf
wa_charfinal-ltsnr
wa_charfinal-werks
wa_charfinal-ltsbz
wa_charfinal-ernam
wa_charfinal-verpr
wa_charfinal-soh_qty
wa_charfinal-int_qty
wa_charfinal-ext_soh
wa_charfinal-hol_qty
wa_charfinal-all_qty
wa_charfinal-bac_qty
wa_charfinal-ext_ttl
INTO IT_ATTACH SEPARATED BY CON_TAB.
CONCATENATE CON_CRET IT_ATTACH INTO IT_ATTACH.
APPEND IT_ATTACH.
ENDLOOP.
PERFORM Z_BUILD_MESSAGE.
PERFORM Z_SEND_FILE_ATTACHMENT
TABLES IT_MESSAGE
IT_ATTACH
USING lv_receiver
'Example .xls documnet attachment'
'XLS'
'filename'
CHANGING GD_ERROR
GD_RECIEVER.
ENDFORM.
FORM Z_BUILD_MESSAGE .
REFRESH IT_MESSAGE.
IT_MESSAGE = 'Please find the attached document'.
APPEND IT_MESSAGE.
ENDFORM. " Z_BUILD_MESSAGE
FORM Z_SEND_FILE_ATTACHMENT TABLES P_IT_MESSAGE
P_IT_ATTACH STRUCTURE IT_ATTACH
USING P_lv_receiver
P_MTITLE
P_FORMAT
P_FILENAME
P_ATTDESCRIPTION
P_SENDER_ADDRESS
P_SENDER_ADDRES_TYPE
CHANGING P_ERROR
P_RECIEVER.
DATA: LD_ERROR TYPE SY-SUBRC,
LD_RECIEVER TYPE SY-SUBRC,
LD_MTITLE LIKE SODOCCHGI1-OBJ_DESCR,
LD_EMAIL LIKE SOMLRECI1-RECEIVER,
LD_FORMAT TYPE SO_OBJ_TP ,
LD_ATTDESCRIPTION TYPE SO_OBJ_NAM ,
LD_ATTFILENAME TYPE SO_OBJ_DES ,
LD_SENDER_ADDRESS LIKE SOEXTRECI1-RECEIVER,
LD_SENDER_ADDRESS_TYPE LIKE SOEXTRECI1-ADR_TYP,
LD_RECEIVER LIKE SY-SUBRC.
LD_EMAIL = P_LV_RECEIVER.
LD_MTITLE = P_MTITLE.
LD_FORMAT = P_FORMAT.
LD_ATTDESCRIPTION = P_ATTDESCRIPTION.
LD_ATTFILENAME = P_FILENAME.
LD_SENDER_ADDRESS = P_SENDER_ADDRESS.
LD_SENDER_ADDRESS_TYPE = P_SENDER_ADDRES_TYPE.
* Fill the document data.
W_DOC_DATA-DOC_SIZE = 1.
* Populate the subject/generic message attributes
W_DOC_DATA-OBJ_LANGU = SY-LANGU.
W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
W_DOC_DATA-OBJ_DESCR = LD_MTITLE .
W_DOC_DATA-SENSITIVTY = 'F'.
* Fill the document data and get size of attachment
CLEAR W_DOC_DATA.
READ TABLE IT_ATTACH INDEX W_CNT.
W_DOC_DATA-DOC_SIZE =
( W_CNT - 1 ) * 255 + STRLEN( IT_ATTACH ).
W_DOC_DATA-OBJ_LANGU = SY-LANGU.
W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
W_DOC_DATA-OBJ_DESCR = LD_MTITLE.
W_DOC_DATA-SENSITIVTY = 'F'.
CLEAR T_ATTACHMENT.
REFRESH T_ATTACHMENT.
T_ATTACHMENT[] = P_IT_ATTACH[].
* Describe the body of the message
CLEAR T_PACKING_LIST.
REFRESH T_PACKING_LIST.
T_PACKING_LIST-TRANSF_BIN = SPACE.
T_PACKING_LIST-HEAD_START = 1.
T_PACKING_LIST-HEAD_NUM = 0.
T_PACKING_LIST-BODY_START = 1.
DESCRIBE TABLE IT_MESSAGE LINES T_PACKING_LIST-BODY_NUM.
T_PACKING_LIST-DOC_TYPE = 'RAW'.
APPEND T_PACKING_LIST.
* Create attachment notification
T_PACKING_LIST-TRANSF_BIN = 'X'.
T_PACKING_LIST-HEAD_START = 1.
T_PACKING_LIST-HEAD_NUM = 1.
T_PACKING_LIST-BODY_START = 1.
DESCRIBE TABLE T_ATTACHMENT LINES T_PACKING_LIST-BODY_NUM.
T_PACKING_LIST-DOC_TYPE = LD_FORMAT.
T_PACKING_LIST-OBJ_DESCR = LD_ATTDESCRIPTION.
T_PACKING_LIST-OBJ_NAME = LD_ATTFILENAME.
T_PACKING_LIST-DOC_SIZE = T_PACKING_LIST-BODY_NUM * 255.
APPEND T_PACKING_LIST.
* Add the recipients email address
CLEAR T_RECEIVERS.
REFRESH T_RECEIVERS.
T_RECEIVERS-RECEIVER = LD_EMAIL.
T_RECEIVERS-REC_TYPE = 'U'.
T_RECEIVERS-COM_TYPE = 'INT'.
T_RECEIVERS-NOTIF_DEL = 'X'.
T_RECEIVERS-NOTIF_NDEL = 'X'.
APPEND T_RECEIVERS.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_DATA = W_DOC_DATA
PUT_IN_OUTBOX = 'X'
SENDER_ADDRESS = LD_SENDER_ADDRESS
SENDER_ADDRESS_TYPE = LD_SENDER_ADDRESS_TYPE
COMMIT_WORK = 'X'
IMPORTING
SENT_TO_ALL = W_SENT_ALL
TABLES
PACKING_LIST = T_PACKING_LIST
CONTENTS_BIN = T_ATTACHMENT
CONTENTS_TXT = IT_MESSAGE
RECEIVERS = T_RECEIVERS
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.
* Populate zerror return code
LD_ERROR = SY-SUBRC.
* Populate zreceiver return code
LOOP AT T_RECEIVERS.
LD_RECEIVER = T_RECEIVERS-RETRN_CODE.
ENDLOOP.
ENDFORM. " Z_SEND_FILE_ATTACHMENT
-Regards
Monica
Hi Monica,
Please check with your BASIS team if all the required configurations are there to send mail.
You can check in SOST transaction if you have an entry there for your mail.
Another relevant transaction in SCOT.
Regards,
Santanu.
Similar Messages
-
Sending an Excel Attachment in E-mail, where linesize 255 characters
Hi,
I have a requirement where I need to send an Excel attachment of around 150 columns and the line-size is around 2000 characters.
I was planning to use SO_DOCUMENT_SEND_API1.
But, it appears that because of the restriction of 255 characters as SOLISTI1 structure has the field size of 255 characters.
Please note, I cannot use any of the OLE or foreground Excel functions, as the job runs in the background.
Please let me know if you have any solutions or work around.
Hoiping to hear from all of the experts out there.
Regards,
Anitry to use the following classes :
send_request TYPE REF TO cl_bcs,
document TYPE REF TO cl_document_bcs,
conlengths TYPE so_obj_len,
html TYPE STANDARD TABLE OF w3html,
sender_id TYPE REF TO if_sender_bcs,
recipient TYPE REF TO if_recipient_bcs,
sent_to_all TYPE os_boolean,
bcs_exception TYPE REF TO cx_bcs,
bcs_message TYPE string. -
How to send existing excel file through mail
Hello Friends,
I have to send mail with Excel File attachement. i have already exist Excel file and that file i hv to send through mail. so pl help me out for sending existing excel file .
i.e. user pickup the exist excel file and that file would be sent to particular mail id.
thank you,
MarmikHi marmik,
1. There is some trick involved
in the binary files.
2. I have made a program (and it works fantastic)
ONLY 6 LINES FOR EMAILING
BELIEVE ME
ITS A FANTASTIC PROGRAM.
IT WILL WORK LIKE OUTLOOK EXPRESS !
3. The user is provided with
a) file name
b) email address to send mail
and it sends ANY FILE (.xls,.pdf .xyz..)
Instantaneously !
4. Make two things first :
1. Include with the name : ZAMI_INCLFOR_MAIL
2. Report with the name : ZAM_TEMP147 (any name will do)
3. Activate both and execute (2)
4. After providing filename, email adress
5. Code for Include :
10.08.2005 Amit M - Created
Include For Mail (First Req F16)
Modification Log
Data
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
FORM
FORM ml_customize USING objname objdesc.
Clear Variables
CLEAR docdata.
REFRESH objpack.
CLEAR objpack.
REFRESH objhead.
REFRESH objtxt.
CLEAR objtxt.
REFRESH objbin.
CLEAR objbin.
REFRESH objhex.
CLEAR objhex.
REFRESH reclist.
CLEAR reclist.
REFRESH listobject.
CLEAR listobject.
CLEAR tab_lines.
CLEAR doc_size.
CLEAR att_type.
Set Variables
docdata-obj_name = objname.
docdata-obj_descr = objdesc.
ENDFORM. "ml_customize
FORM
FORM ml_addrecp USING preceiver prec_type.
CLEAR reclist.
reclist-receiver = preceiver.
reclist-rec_type = prec_type.
APPEND reclist.
ENDFORM. "ml_customize
FORM
FORM ml_addtxt USING ptxt.
CLEAR objtxt.
objtxt = ptxt.
APPEND objtxt.
ENDFORM. "ml_customize
FORM
FORM ml_prepare USING bypassmemory whatatt_type whatname.
IF bypassmemory = ''.
Fetch List From Memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
COMPRESSED_SIZE =
TABLES
in = listobject
out = objbin
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ENDIF.
Header Data
Already Done Thru FM
Main Text
Already Done Thru FM
Packing Info For Text Data
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
APPEND objpack.
Packing Info Attachment
att_type = whatatt_type..
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = whatname.
APPEND objpack.
Receiver List
Already done thru fm
ENDFORM. "ml_prepare
FORM
FORM ml_dosend.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
CONTENTS_HEX = objhex
OBJECT_PARA =
object_parb =
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
IF sy-subrc <> 0.
MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ENDIF.
ENDFORM. "ml_customize
FORM
FORM ml_spooltopdf USING whatspoolid.
DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
Call Function
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = whatspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
OTHERS = 12.
Convert
PERFORM doconv TABLES pdf objbin.
ENDFORM. "ml_spooltopdf
FORM
FORM doconv TABLES
mypdf STRUCTURE tline
outbin STRUCTURE solisti1.
Data
DATA : pos TYPE i.
DATA : len TYPE i.
Loop And Put Data
LOOP AT mypdf.
pos = 255 - len.
IF pos > 134. "length of pdf_table
pos = 134.
ENDIF.
outbin+len = mypdf(pos).
len = len + pos.
IF len = 255. "length of out (contents_bin)
APPEND outbin.
CLEAR: outbin, len.
IF pos < 134.
outbin = mypdf+pos.
len = 134 - pos.
ENDIF.
ENDIF.
ENDLOOP.
IF len > 0.
APPEND outbin.
ENDIF.
ENDFORM. "doconv
CODE FOR PROGRAM
5.
REPORT zam_temp147 .
INCLUDE zami_inclfor_mail.
DATA
DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : file_name TYPE string.
data : path like PCFILE-PATH.
data : extension(5) type c.
data : name(100) type c.
SELECTION SCREEN
PARAMETERS : receiver TYPE somlreci1-receiver lower case.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY.
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM ml_customize USING 'Tst' 'Testing'.
PERFORM ml_addrecp USING receiver 'U'.
PERFORM upl.
PERFORM doconv TABLES itab objbin.
PERFORM ml_prepare USING 'X' extension name.
PERFORM ml_dosend.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
FORM
FORM upl.
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
path = file_name.
CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
EXPORTING
complete_filename = path
CHECK_DOS_FORMAT =
IMPORTING
DRIVE =
EXTENSION = extension
NAME = name
NAME_WITH_EXT =
PATH =
EXCEPTIONS
INVALID_DRIVE = 1
INVALID_EXTENSION = 2
INVALID_NAME = 3
INVALID_PATH = 4
OTHERS = 5
ENDFORM. "upl
regards,
amit m. -
Hi all,
I have an issue in sending mail as an excel attachment .
i am getting some records in the excel sheet as single line and some are coming correctly. here is the sample code.
ie. some records coming line by line, but some record for eg the 6th and 7th record is coming in the 6th line only .here is the coding part for that
CONCATENATE ' '
I_SHIP_HEAD-TKNUM
L_DATEB
VD
I_SHIP_HEAD-EXTI1
I_SHIP_HEAD-TPBEZ
I_SHIP_HEAD-SIGNI
I_SHIP_HEAD-EXTI2
L_NETWR
L_DMBTR
I_SHIP_HEAD-TNDR_TRKID
MODE
L_ALLOWED_TWGT
I_INV-VBELN
L_INVDAT
I_INV-VSTEL
I_INV-KUNRG
L_ETADATE
I_INV-SPART
I_INV-MATNR
I_INV-ARKTX
I_INV-MATKL
L_FKIMG
L_WT
L_VOL
L_DIFFVAL
CON_CRET
INTO I_BIN SEPARATED BY CON_TAB.
APPEND I_BIN .
CLEAR I_BIN.
suggest me a solution.
Thanks & Regards
Magesh AnandanHi,
check the following sample program and also its easy to understand.
REPORT zvenkat_mail_xls_attach.
" Data retrieval related declarations
TYPES:
BEGIN OF t_emp_dat,
pernr TYPE pa0001-pernr,
persg TYPE pa0001-persg,
persk TYPE pa0001-persk,
plans TYPE pa0001-plans,
stell TYPE pa0001-stell,
END OF t_emp_dat.
DATA:
w_emp_data TYPE t_emp_dat.
DATA:
i_emp_data TYPE STANDARD TABLE OF t_emp_dat.
" Mail related declarations
"Variables
DATA :
g_sent_to_all TYPE sonv-flag,
g_tab_lines TYPE i.
"Types
TYPES:
t_document_data TYPE sodocchgi1,
t_packing_list TYPE sopcklsti1,
t_attachment TYPE solisti1,
t_body_msg TYPE solisti1,
t_receivers TYPE somlreci1.
"Workareas
DATA :
w_document_data TYPE t_document_data,
w_packing_list TYPE t_packing_list,
w_attachment TYPE t_attachment,
w_body_msg TYPE t_body_msg,
w_receivers TYPE t_receivers.
"Internal Tables
DATA :
i_document_data TYPE STANDARD TABLE OF t_document_data,
i_packing_list TYPE STANDARD TABLE OF t_packing_list,
i_attachment TYPE STANDARD TABLE OF t_attachment,
i_body_msg TYPE STANDARD TABLE OF t_body_msg,
i_receivers TYPE STANDARD TABLE OF t_receivers.
"Start-of-selection.
START-OF-SELECTION.
PERFORM get_data.
PERFORM build_xls_data_table.
"End-of-selection.
END-OF-SELECTION.
PERFORM send_mail.
"Form get_data from PA0001
FORM get_data.
SELECT pernr
persg
persk
plans
stell
FROM pa0001
INTO CORRESPONDING FIELDS OF TABLE i_emp_data
UP TO 4 ROWS.
ENDFORM. " get_data
"Form build_xls_data_table
FORM build_xls_data_table.
"If you have Unicode check active in program attributes then
"you will need to declare constants as follows.
CLASS cl_abap_char_utilities DEFINITION LOAD.
CONSTANTS:
con_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
con_cret TYPE c VALUE cl_abap_char_utilities=>cr_lf.
CONCATENATE 'PERNR' 'PERSG' 'PERSK' 'PLANS' 'STELL'
INTO w_attachment
SEPARATED BY con_tab.
CONCATENATE con_cret
w_attachment
INTO w_attachment.
APPEND w_attachment TO i_attachment.
CLEAR w_attachment.
LOOP AT i_emp_data INTO w_emp_data.
CONCATENATE w_emp_data-pernr
w_emp_data-persg
w_emp_data-persk
w_emp_data-plans
w_emp_data-stell
INTO w_attachment
SEPARATED BY con_tab.
CONCATENATE con_cret w_attachment
INTO w_attachment.
APPEND w_attachment TO i_attachment.
CLEAR w_attachment.
ENDLOOP.
ENDFORM. "build_xls_data_table
"Form send_mail
"PACKING LIST
"This table requires information about how the data in the
"tables OBJECT_HEADER, CONTENTS_BIN and CONTENTS_TXT are to
"be distributed to the documents and its attachments.The first
"row is for the document, the following rows are each for one
"attachment.
FORM send_mail .
"Subject of the mail.
w_document_data-obj_name = 'MAIL_TO_HEAD'.
w_document_data-obj_descr = 'Regarding Mail Program by SAP ABAP'.
"Body of the mail
PERFORM build_body_of_mail
USING:space,
'Hi,',
'I am fine. How are you? How are you doing ? ',
'This program has been created to send simple mail',
'with Subject,Body with Address of the sender. ',
'Regards,',
'Venkat.O,',
'SAP HR Technical Consultant.'.
"Write Packing List for Body
DESCRIBE TABLE i_body_msg LINES g_tab_lines.
w_packing_list-head_start = 1.
w_packing_list-head_num = 0.
w_packing_list-body_start = 1.
w_packing_list-body_num = g_tab_lines.
w_packing_list-doc_type = 'RAW'.
APPEND w_packing_list TO i_packing_list.
CLEAR w_packing_list.
"Write Packing List for Attachment
w_packing_list-transf_bin = 'X'.
w_packing_list-head_start = 1.
w_packing_list-head_num = 1.
w_packing_list-body_start = 1.
DESCRIBE TABLE i_attachment LINES w_packing_list-body_num.
w_packing_list-doc_type = 'XLS'.
w_packing_list-obj_descr = 'Excell Attachment'.
w_packing_list-obj_name = 'XLS_ATTACHMENT'.
w_packing_list-doc_size = w_packing_list-body_num * 255.
APPEND w_packing_list TO i_packing_list.
CLEAR w_packing_list.
"Fill the document data and get size of attachment
w_document_data-obj_langu = sy-langu.
READ TABLE i_attachment INTO w_attachment INDEX g_tab_lines.
w_document_data-doc_size = ( g_tab_lines - 1 ) * 255 + STRLEN(
w_attachment ).
"Receivers List.
w_receivers-rec_type = 'U'. "Internet address
w_receivers-receiver = '[email protected]'.
w_receivers-com_type = 'INT'.
w_receivers-notif_del = 'X'.
w_receivers-notif_ndel = 'X'.
APPEND w_receivers TO i_receivers .
CLEAR:w_receivers.
"Function module to send mail to Recipients
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_document_data
put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
sent_to_all = g_sent_to_all
TABLES
packing_list = i_packing_list
contents_bin = i_attachment
contents_txt = i_body_msg
receivers = i_receivers
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 .
MESSAGE i303(me) WITH 'Mail has been Successfully Sent.'.
ELSE.
WAIT UP TO 2 SECONDS.
"This program starts the SAPconnect send process.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDIF.
ENDFORM. " send_mail
" Form build_body_of_mail
FORM build_body_of_mail USING l_message.
w_body_msg = l_message.
APPEND w_body_msg TO i_body_msg.
CLEAR w_body_msg.
ENDFORM. " build_body_of_mail
I hope that it helps you something.
Regards,
Venkat.O -
Excel attachment in mailing program
Hi,
I am sending excel attachment in the mailing program.
The attachment contains 56 lines, but the problem is the attachment which is coming with 22 line only in mail .
What may be the problem?
Regards,Please debug and check the internal table before the Mail FM, whether all lines are there.
-
Send file as attachment via mail
Dear All,
I want to send a report (ALV) as attachment to some mail. I am using SO_NEW_DOCUMENT_SEND_API1. Can you please suggest how can I send mail as attachment. I am able to send ALV report as HTML format. I want to send it as attachment.
Thanks and regards,
AtanuHi,
plz check the below code.
it sends Excel sheet attachment with the mail using FM 'SO_DOCUMENT_SEND_API1'
code>>>>>>>>>>>>>>>>>>>>.
form send_email_with_attachment .
DATA: l_t_objbin LIKE solisti1 OCCURS 100 WITH HEADER LINE.
DATA: i_body TYPE soli_tab WITH HEADER LINE.
DATA: l_t_objtxt LIKE solisti1 OCCURS 100 WITH HEADER LINE.
DATA: l_t_objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: l_t_objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
DATA: l_t_reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
DATA: w_tabln TYPE i . "for number of table lines
DATA: w_line TYPE so_text255. " Line of text
DATA: l_doc_chng LIKE sodocchgi1.
DATA: l_tab_lines LIKE sy-tabix.
DATA: l_att_lines TYPE i.
DATA: lv_lines TYPE i.
DATA : BEGIN OF wa_mrpnm,
werks TYPE ZCSVT024D-werks,
dispo TYPE ZCSVT024D-dispo,
name_first TYPE ZCSVT024D-name_first,
name_last TYPE ZCSVT024D-name_last,
END OF wa_mrpnm,
l_i_mrpnm LIKE STANDARD TABLE OF wa_mrpnm.
DATA : l_name TYPE string.
*Used for delimiting the columns in Excel Sheet.
CLASS cl_abap_char_utilities DEFINITION LOAD.
CONSTANTS:
cr_mark(2) TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
constants c_l_newline type ABAP_CHAR1 value %_NEWLINE. "#EC NOTEXT
CLEAR : l_t_objpack,
l_t_objhead,
l_t_objbin,
l_t_objtxt,
l_t_reclist.
REFRESH: l_t_objpack,
l_t_objhead,
l_t_objbin,
l_t_objtxt,
l_t_reclist.
Creating the content of the e-mail message text
IF sy-sysid(1) = 'P'.
IF p_order = 'X'.
l_doc_chng-obj_name = 'Subcontracting Setup Report'(m02).
CONCATENATE 'Details of Orders Extract'(028) 'for Plant'(029)
p_werks
INTO l_doc_chng-obj_descr SEPARATED BY space.
l_doc_chng-doc_size = ( l_tab_lines - 1 ) * 255 + STRLEN( l_t_objtxt ).
ELSE.
l_doc_chng-obj_name = 'TEST ONLY!! SC Setup Report'(m03).
CONCATENATE 'Details of Forecast Extract'(030) 'for Plant'(029)
p_werks
INTO l_doc_chng-obj_descr SEPARATED BY space.
l_doc_chng-doc_size = ( l_tab_lines - 1 ) * 255 + STRLEN( l_t_objtxt ).
ENDIF.
ELSE.
IF p_order = 'X'.
l_doc_chng-obj_name = 'Subcontracting Setup Report'(m02).
CONCATENATE 'Details of Orders Extract'(028) 'for Plant'(029)
p_werks 'TEST TEST TEST'
INTO l_doc_chng-obj_descr SEPARATED BY space.
l_doc_chng-doc_size = ( l_tab_lines - 1 ) * 255 + STRLEN( l_t_objtxt ).
ELSE.
l_doc_chng-obj_name = 'TEST ONLY!! SC Setup Report'(m03).
CONCATENATE 'Details of Forecast Extract'(030) 'for Plant'(029)
p_werks 'TEST TEST TEST'
INTO l_doc_chng-obj_descr SEPARATED BY space.
l_doc_chng-doc_size = ( l_tab_lines - 1 ) * 255 + STRLEN( l_t_objtxt ).
ENDIF.
ENDIF.
l_t_objtxt = 'Hi,'(036).
APPEND l_t_objtxt.
CLEAR l_t_objtxt.
APPEND l_t_objtxt.
CONCATENATE 'Please open the attachment to review details of the Report'(031)
'for plant'(029) p_werks INTO l_t_objtxt
SEPARATED BY space.
APPEND l_t_objtxt.
CLEAR l_t_objtxt.
APPEND l_t_objtxt.
DESCRIBE TABLE t_ddow LINES sy-tfill .
IF sy-tfill GT 0 .
MOVE 'These Materials have been marked as DDOW materials.'(032)
TO l_t_objtxt.
APPEND l_t_objtxt.
CLEAR l_t_objtxt.
APPEND l_t_objtxt.
APPEND l_t_objtxt.
APPEND l_t_objtxt.
CONCATENATE 'Note! - This is an automatically generated email by the'(034)
'SAP system. Pls do not reply to the sender.'(035)
INTO l_t_objtxt
SEPARATED BY space.
APPEND l_t_objtxt.
DESCRIBE TABLE l_t_objtxt LINES l_tab_lines.
READ TABLE l_t_objtxt INDEX l_tab_lines.
l_doc_chng-doc_size = ( l_tab_lines - 1 ) * 255 + STRLEN( l_t_objtxt )
Creating the entry for the email text in the packing list
CLEAR l_t_objpack-transf_bin.
l_t_objpack-head_start = 1.
l_t_objpack-head_num = 1.
l_t_objpack-body_start = 1.
l_t_objpack-body_num = l_tab_lines.
l_t_objpack-doc_type = 'RAW'.
lv_lines = l_tab_lines.
APPEND l_t_objpack.
Columns Heading for Excel Attachment.
CONCATENATE 'MRP Controller'(044)
'MRP Name'(047)
'Material'(037)
'Plant'(026)
'PP Cal'(038)
'Ship Date'(009)
'PO Number'(014)
'PO Line'(033)
'PP Text'(041)
INTO i_body
SEPARATED BY cr_mark.
concatenate ' ' i_body into i_body separated by c_l_newline.
APPEND i_body TO l_t_objtxt.
CLEAR i_body.
Get MRP Names
SELECT werks dispo name_first name_last
FROM ZCSVT024D
INTO TABLE l_i_mrpnm
FOR ALL ENTRIES IN t_ddow
WHERE werks = t_ddow-werks
AND dispo = t_ddow-dispo.
IF sy-subrc = 0.
SORT l_i_mrpnm by werks dispo.
ENDIF.
Data to be shown in Excel Sheet.
LOOP AT t_ddow INTO w_ddow.
CLEAR : l_name.
READ TABLE l_i_mrpnm INTO wa_mrpnm WITH KEY werks = w_ddow-werks
dispo = w_ddow-dispo
BINARY SEARCH.
IF sy-subrc = 0.
CONCATENATE wa_mrpnm-name_first wa_mrpnm-name_last
INTO l_name SEPARATED BY space.
ENDIF.
CONCATENATE w_ddow-dispo
l_name
w_ddow-matnr
w_ddow-werks
w_ddow-mrppp
w_ddow-datum
w_ddow-ebeln
w_ddow-ebelp
w_ddow-pptxt
INTO i_body
SEPARATED BY cr_mark.
concatenate ' ' i_body into i_body separated by c_l_newline.
APPEND i_body TO l_t_objtxt.
CLEAR : w_ddow.
ENDLOOP.
DESCRIBE TABLE l_t_objtxt LINES l_tab_lines.
DESCRIBE TABLE l_t_objtxt LINES l_att_lines.
l_tab_lines = l_tab_lines - lv_lines.
Creating the entry for attachment in the packing list
objpack-transf_bin = 'X'.
lv_lines = lv_lines + 1.
l_t_objpack-head_start = 2.
l_t_objpack-head_num = 1.
l_t_objpack-body_start = lv_lines.
l_t_objpack-body_num = l_tab_lines.
l_t_objpack-doc_type = 'XLS'.
l_t_objpack-obj_name = 'DDOW_Materials'(045).
l_t_objpack-obj_descr = 'DDOW Marked Materials'(046).
l_t_objpack-doc_size = l_tab_lines * 255.
APPEND l_t_objpack.
lv_lines = l_att_lines.
**RECEIVERS...
LOOP AT t_ddow INTO w_ddow.
REFRESH l_t_reclist .
CLEAR l_t_reclist.
* get the MRP controller from table
READ TABLE t_mrpc INTO w_mrpc WITH KEY werks = p_werks
dispo = w_ddow-dispo
BINARY SEARCH .
IF sy-subrc EQ 0 .
MOVE: 'X' TO l_t_reclist-express ,
'U' TO l_t_reclist-rec_type ,
w_mrpc-smtp_addr TO l_t_reclist-receiver .
APPEND l_t_reclist.
EXIT.
ENDIF.
ENDLOOP.
Sending the document
IF NOT l_t_reclist[] IS INITIAL.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = l_doc_chng
commit_work = 'X'
TABLES
packing_list = l_t_objpack
object_header = l_t_objhead
contents_bin = l_t_objbin
contents_txt = l_t_objtxt
receivers = l_t_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
ENDIF.
IF sy-subrc <> 0.
* Do nothing
ELSE.
COMMIT WORK AND WAIT.
MESSAGE s899(8a) WITH 'Email Message sent successfully'."#EC
ENDIF.
ENDIF.
<<<<<<<<<<<<<<<<<<<<<<<
regards,
vikas.
plz reward if helpful.. -
How To Send A Text Attachment Through MAIL Adapter
Hi Experts,
I Did A Scenario that is By using file adapter at the sender side and PI as a middle ware i have sent one text file to database
Now here my question is
I have to send the same text file which i have sent database... my using Mail Adapter
Simply File to Mail Scenario
FILE PI MAIL
But I have to send the same text file which i sent to database... by using mail adapter... Here all the configuration are done ... And the channels are working properly... only thing here is..to send same text file using mail adapter..
It will be good if any one can explain step by step..
Regards
aravindhHi Rajendra,
Tanq for connecting me ... This Blog helped me a lot ....And it is a useful answer to me..
For this file to mail scenario we have got .txt as an attachment ... Its fine ... But her my Client is asking me to add CONTENT in the mail... Content in the sense..
Example of content...
Hi,
Please find the attachment
Regards,
sap pi,
They need in the form of like this... To add content in the mail What i have to do...DO i need to add more configurations if it is what are they...
Please solve the issue.. It is appreciated some one can explain me step by step or .. By sending me screen charts..
Thanks in advance....
Regards
vinay -
Report output sending as an attachement through mail
we are facing one problem while sending report output as an attachement to specific mail-ids.
Every thing is working fine.But for each row upto 255 characteers only it is printig.
Remaining is not comming.
We are using Function Module SO_DOCUMENT_SEND_API1.
Please help us to solve this.
Regards,
Phanicheck this code sample
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5931ff64-0a01-0010-2bb7-ff2f9a6165a0">E-mail ABAP Report List output in HTML format</a>
Regards
Raja -
How to convert sapscript to excel & send it as attachment in mail?
Hi,
I have a requirement to send the customer statement in excel format with all open items to the customer email address. I am creating the customer statement via sapscript . Then I need to convert that into excel. I tried using CONVERT_OTF. But alignment is not coming properly. I have logo also in the script. That also I want in the excel . When I send the mail, the data is not showing correctly
Has anyone worked in similar scenario? Please tell me what are the ways for doing this?
Thanks in advance,
Jissa.HI,
For sending script output through email
Please check this code it may help u.
FORM send_mail USING p_y16m_rcp_par STRUCTURE y16m_rcp_par.
Have a subject for the mail
g_s_document_data-obj_name = text-t02.
g_s_document_data-obj_descr = text-t03.
Fill receiver information
g_s_receivers-rec_type = p_y16m_rcp_par-rec_type.
g_s_receivers-rec_id = p_y16m_rcp_par-rec_id.
g_s_receivers-express = 'X'.
APPEND g_s_receivers TO g_t_receivers.
Call function to send mail
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = g_s_document_data
document_type = 'RAW'
PUT_IN_OUTBOX = ' '
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
OBJECT_HEADER =
object_content = g_t_object_content
CONTENTS_HEX =
OBJECT_PARA =
OBJECT_PARB =
receivers = g_t_receivers
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.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " SEND_MAIL
Regards,
Pavan. -
Arabic text in excel attachment in mail
my requirement is to mail the excel file so I used the internal table
to create an excel and used FM SO_NEW_DOCUMENT_ATT_SEND_API1, While the
excel file is created but however the arabic is not downloaded
correctly. It is downloaded with junk characters.
CONSTANTS:y_k_con_tab TYPE c VALUE
cl_abap_char_utilities=>horizontal_tab,
y_k_con_cret TYPE c VALUE
cl_abap_char_utilities=>cr_lf.
LOOP AT lt_output INTO ls_output.
MOVE ls_output-zdate_changed TO lv_datechanged.
MOVE ls_output-zdate_created TO lv_datecreated.
CONCATENATE ''''
lv_datechanged
INTO lv_datechanged.
CONCATENATE ''''
lv_datecreated
INTO lv_datecreated.
*Concatenate text fields to send the email in the r=uired format.
CONCATENATE ls_output-zexcess
ls_output-zbranch
ls_output-znotes
ls_output-zstatus
lv_datechanged
ls_output-zdate_changed
ls_output-zemp_changed
ls_output-zinitial_status
lv_datecreated
ls_output-zdate_created
ls_output-zemp_created
ls_output-zproduct_name
ls_output-zministry_name
ls_output-zentity_name
ls_output-zposting_date
ls_output-zservice_id
INTO y_wa_htop_new SEPARATED BY y_k_con_tab .
CONCATENATE y_k_con_cret
y_wa_htop_new
INTO y_wa_htop_new .
APPEND y_wa_htop_new TO y_i_htop_new.
CLEAR: y_wa_htop_new.
ENDLOOP.
*ENDLOOP.
i_attachment] = y_i_htop_new[.
SUBJECT OF THE MAIL.
w_document_data-obj_name = 'MAIL_TO_HEAD'.
w_document_data-obj_descr = text-001.
BODY OF THE MAIL
w_body_msg = text-002.
APPEND w_body_msg TO i_body_msg.
CLEAR w_body_msg.
w_body_msg = space.
APPEND w_body_msg TO i_body_msg.
CLEAR w_body_msg.
w_body_msg = text-003.
APPEND w_body_msg TO i_body_msg.
CLEAR w_body_msg.
w_body_msg = space.
APPEND w_body_msg TO i_body_msg.
CLEAR w_body_msg.
w_body_msg = text-004.
APPEND w_body_msg TO i_body_msg.
CLEAR w_body_msg.
w_body_msg = space.
APPEND w_body_msg TO i_body_msg.
CLEAR w_body_msg.
w_body_msg = text-005.
APPEND w_body_msg TO i_body_msg.
CLEAR w_body_msg.
WRITE PACKING LIST FOR BODY
DESCRIBE TABLE i_body_msg LINES g_tab_lines.
*describe table i_attachment lines g_tab_lines.
w_packing_list-head_start = 1.
w_packing_list-head_num = 0.
w_packing_list-body_start = 1.
w_packing_list-body_num = g_tab_lines.
w_packing_list-doc_type = 'RAW'.
APPEND w_packing_list TO i_packing_list.
CLEAR w_packing_list.
WRITE PACKING LIST FOR ATTACHMENT
w_packing_list-transf_bin = 'X'.
w_packing_list-head_start = 1.
w_packing_list-head_num = 1.
w_packing_list-body_start = 1.
DESCRIBE TABLE i_attachment LINES w_packing_list-body_num.
w_packing_list-doc_type = 'XLS'.
w_packing_list-obj_descr = 'Service_Details'.
w_packing_list-obj_name = 'Service_Details'.
w_packing_list-OBJ_LANGU = 'A'.
w_packing_list-doc_size = w_packing_list-body_num * 255.
APPEND w_packing_list TO i_packing_list.
CLEAR w_packing_list.
FILL THE DOCUMENT DATA &GET SIZE OF ATTACHMENT
w_document_data-obj_langu = sy-langu.
READ TABLE i_attachment INTO w_attachment INDEX g_tab_lines.
w_document_data-doc_size = ( g_tab_lines - 1 ) * 255 + STRLEN(
w_attachment ).
RECEIVERS LIST.
w_receivers-rec_type = 'U'. "Internet address
w_receivers-receiver = y_lv_emailid.
w_receivers-com_type = 'INT'.
w_receivers-notif_del = 'X'.
w_receivers-notif_ndel = 'X'.
APPEND w_receivers TO i_receivers .
CLEAR:w_receivers.
SEND MAILS TO RECIPIENTS
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_document_data
put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
sent_to_all = g_sent_to_all
TABLES
packing_list = i_packing_list
contents_bin = i_attachment
contents_txt = i_body_msg
receivers = i_receivers
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 .
*MESSAGE s WITH 'Mail has been Successfully Sent.'.
ENDIF.
Kindly suggest how will I get arabic downloaded and sent as attachment
in email. Can I write a file to application server and send that
particular file as attachement? Can I use BCS class for mailing excel
file? Will it support arabic text?with Excel it is always a good idea to encode your data in UTF-16 LE.
to do so, take your internal table in SOLI format and call
CL_BCS_CONVERT=>TXT_TO_SOLIX
with iv_codepage = 4103 and iv_add_bom = 'X'.
you will get a binary table SOLIX as a result and just have to attach it to your message -
Hi,
I have done a script within Automator that does take filtered information in one Excel-file and copy it to another and close it. I choose a name for it and saves it. Could I get it to automatically attach this file inside a mail document in Mail.app and let me send it manually?
I also would like it to automatically uncheck 1904 Date option inside Excel prefs.If you know the name of the workbook, then add this applescript to the workflow, while the file is still open.on run {input, parameters}
tell application "Microsoft Excel"
set the date 1904 of workbook "Sheet1" to not the date 1904 of workbook "Sheet1"
send mail workbook "Sheet1"
end tell
return input
end runSubstitute the name of the workbook for Sheet1
I couldn't get any of the excel actions to pass the name into the Applescript action.
As for emailing, I can't get Excel to pass any of it's action results onto anything but it's own actions. They don't seem to be very well written. Normally, you'd just add a "New Mail Message" action after something and the output from the previous action would be the content for the new mail message.
Due to Microsoft's shortcomings, there doesn't seem to be a way to do that without using the "send mail" function in Excel's Applescript dictionary.
If you need to do more Applescripting of Excel (or Office), see the [VBA to Applescript Transition Guide|http://www.mactech.com/vba-transition-guide>. It is geared towards converting from VBA to Applescript, but it has many examples of how to automate various tasks.
Message was edited by: Barney-15E -
Sending File as attachment using Mail adapter with naming convention
Dear All,
I am working on a scenario in which my sender file adapter is sending one file named 'ABC.ok' in one of the folders in application server. I have to send the same file with the same name to one of the folders at FTP and also to my customer at his email id.
I have used File Content onversion at the receiver side and has selected adapter specific attributes due to which the required file is getting generated at FTP folder with the same name as that of the source. But how to send the same file using the mail adapter by keeping same name as "ABC.ok". Kindly guide me out in this.
Regards,
NJwhat you need to do:
1) Select ASMA in Sender and receiver File CC...already done
2) Using the Dynamic Config UDF get the sender file name in the field Content-Type...for this you need to have a return statement in your UDF
3) now before pushing this file name to the Content-Type you have to append (concat)the actual type of the file content (xml, txt)
so your entire Content-Type node will have something like text/plain; name="abc.ok"
SAP Note has reference on how to do this:
https://service.sap.com/sap/support/notes/856599
From the note:
Q: How can I set the file name of a mail attachment?
Regards,
Abhishek. -
Sending a PDF attachment by mail
Hello Experts,
I need to write down a report in which you can generate an e-mail attaching automatically one or more PDF already downloaded on my PC (generated by a previous report) i.e. c:\test.pdf
For info, this is the last part of a report that generates PDF from a standard report result:
- I call RFZALI20 for a specific set of parameters (LAUFD, LAUFI, LIFNR)
- I generate a spool with the results (customer wants exactly the "screenshots" of report result) and then convert it in pdf with a submit to RSTXPDF4
- Now I have to send it by mail to the vendor...how can I do that??
thanks in advance
Chiarahi
Store all your texts like dear sir , please find the attachment in text elements example text-001 contains please find the attachments and text-002 contains thank you and so on.
Once you do this the place where you call your pdf palce them there and concat them.
example:
data: wa_msg type solisti1,
i_msg type standard table of solisti1.
wa_msg-line = text-001.
append wa_msg to i_msg.
then you fill the receivers and call the FM for sending pdf mail
regards
Sachin Sharma -
Sending doc as attachment in mail for Ois 8 I phone 6+
Hi All
1) I just bought apple phone fist time and facing serious problem for attaching document like word or excel of PDF with the mails. All my work goes with PDF, word and excel with out this I can't work.
2) How to make folder to keep the data sync with Mac and I phone without putting on web, let say i have one folder in document and I need this folder to be sync with my I phone , How can i do this?
3) with above folder how can I mail the docs as required?
any one please help as without above application I hone is of no use to me what ever it expensive may be. I am feared
Regards
Mayank ManuHi All
1) I just bought apple phone fist time and facing serious problem for attaching document like word or excel of PDF with the mails. All my work goes with PDF, word and excel with out this I can't work.
2) How to make folder to keep the data sync with Mac and I phone without putting on web, let say i have one folder in document and I need this folder to be sync with my I phone , How can i do this?
3) with above folder how can I mail the docs as required?
any one please help as without above application I hone is of no use to me what ever it expensive may be. I am feared
Regards
Mayank Manu -
Query regarding Excel attachment to mail
Hi all,
I am passing spool no. and download path to 'RSPO_DOWNLOAD_SPOOLJOB' to the function module. I am getting the file stored at specified path in 'RAW' format. Now using GUI_UPLOAD to get the excel file data into internal table i_texts.
This excel gets attached to the mail. Since data is in RAW format, I have to pick line by line data. So I am not able to get the data column by column and data appended to the attached mail as line by line. So data redability at column level is not there.
If someone has worked on this type of requirement to get the spool no. data convertd to excel format and attached as an mail.
Please suggest your solutions regarding this...
regards,
Brijesh Patelhi,<b>
first save the excel file as tabdelimited file </b>
Try using GUI_UPLOAD in this way
V_FILENAME = P_FILE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = V_FILENAME
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = '|'
TABLES
DATA_TAB = ITAB
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17.
Regards,
Santosh
Message was edited by: Santosh
Maybe you are looking for
-
Vendor / Customer Master Report
Dear Experts, Would you please inform me if there is any standard report in SAP which generates master for all the customer / vendors created, having below mentioned fields: SAP Code Vendor / Customer Name Address Contact Details Telephone no Mobile
-
Jog forward one Field at a time?
Is it possible to jog forward one field at a time in iMovie? With FCP X, I think it's Option-Right Arrow. Thanks.
-
REQUEST GOP / UEFI BIOS for MSI R9 270 GAMING
Hi there! Could I get the latest UEFI GOP VBIOS for MSI R9 270 2G GAMING please? Serial number: 602-V305-03SB1401002324 Current VBIOS: _https://drive.google.com/file/d/0BzVByGARY8OCNXZBTXpMLVJaems/view?usp=sharing (without _) Many thanks
-
Purchase requistion automaticaly creation
HI I want to create purchase requisition with 100 line items with different plants,different materials,quantity,price.account assignment,assets,user need not want to all 100 line items enter manually in me51n t.code.is this possible to upload automat
-
My isight camera is showing not connected
i tried making a facetime call but its telling me camra not connected?