Extension of excel file in email attachment is .excel instead of .xls
I have concurrent program and I'm trying to use the 'delivery option' to send the output as attachment in email. I defined a rtf template and can open the output from 'Output' button correctly. it can also send mail with attach, but the file name of the attachment is .excel which Excel cannot recognize. My question is , is there any setup to specify the file extension of excel output. I'm sure bursting can work correctly, I just want to try the delivery option. Thanks in advance.
Please see these links.
excel output in report builder reports
http://forums.oracle.com/forums/search.jspa?threadID=&q=excel+AND+XML&objID=f475&dateRange=all&userID=&numResults=15&rankBy=10001
Thanks,
Hussein
Similar Messages
-
Sending excel file as an attachment in email program thru Oracle8i
I cant send my excel file as an attachment in my email program thru Oracle 8i.
My excel file i located in my local pc C:\test.xls
Everything is in my local machine, DB and progams.
I have read the example of DEMO_MAIL program i am hardly understand it.
My sample program:
if (p_file_name is not null) then
begin_attachment( p_mime_type=>'application/excel', p_fname=>p_file_name,
p_transfer_enc=>'base64'
dbms_lob.createtemporary(l_blob, true);
dbms_lob.open(l_bfile);
dbms_lob.fileopen(l_bfile);
dbms_lob.open(l_blob, dbms_lob.lob_readwrite);
dbms_lob.loadfromfile(l_blob, l_bfile, dbms_lob.getlength(l_bfile));
dbms_lob.fileclose(l_bfile);
dbms_lob.close(l_bfile);
l_file_len := dbms_lob.getlength(l_blob);
l_modulo := mod(l_file_len,MAX_BASE64_LINE_WIDTH);
l_pieces := trunc(l_file_len/MAX_BASE64_LINE_WIDTH);
while (l_counter < l_pieces)
loop
dbms_lob.read(l_blob, l_modulo, l_filepos, l_buffer);
l_message := utl_raw.concat(l_message, l_buffer);
write_mb_text(l_message||g_crlf);
l_filepos := l_counter * MAX_BASE64_LINE_WIDTH + 1;
l_counter := l_counter + 1;
end loop;
if l_modulo <> 0 then
dbms_lob.read(l_blob, l_modulo, l_filepos, l_buffer);
l_message := utl_raw.concat(l_message, l_buffer);
write_mb_text(l_message||g_crlf);
end if;
dbms_lob.close(l_blob);
end_attachment(true);
Please helpI did not receive any error messages when executing the program. It works fine, I received the email nicely but without the attachment.
Here is the emails I received:
LOGICAL SPACE USED HAS REACHED ITS TRESHOLD. PLEASE DO NECESSAY TO MAKE MORE ROOM FOR THE SPACE TO EXTEND.
Tablespace Name Used Size(MB) Free Size(MB)
SYSTEM 259.953 4.047
USERS 144.508 55.492
INDX 31.258 26.742
-------7D81B75CCC90D2974F7A1CBD
Content-Type: multipart/mixed; boundary="-----7D81B75CCC90D2974F7A1CBD"
Content-Disposition: attachment; filename="capacity_13-JAN-05-111226.xls"
Content-Transfer-Encoding: base64
-haris -
Send An Internal Table Via Excel File As An Attachment of E-mail
Hi,
I've sent my internal table via Excel file as an attachment of email but all records of internal table are in a row of sended excel file.
How can i send an internal table via excel file , records of internal table for each rows of excel file,as an attachment of email correctly?
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 " t_packing_list-doc_type = 'XLS'.
contents_bin = pit_attach " this is a normal internal table.
contents_txt = pit_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.Hi,
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.
LOOP AT T_FINAL INTO WA_T_FINAL.
CONCATENATE WA_T_FINAL-PERNR
WA_T_FINAL-NAME
WA_T_FINAL-LEVEL
WA_T_FINAL-POS
WA_T_FINAL-JOB
WA_T_FINAL-SECTION
WA_T_FINAL-DEPT
WA_T_FINAL-GROUP
WA_T_FINAL-EX_HEAD
WA_T_FINAL-SUPID
WA_T_FINAL-SUPNM
WA_T_FINAL-FHRNM
WA_T_FINAL-VACID
WA_T_FINAL-VAC_SECTION
WA_T_FINAL-VAC_DEPT
WA_T_FINAL-VAC_GROUP
WA_T_FINAL-VAC_EX_HEAD
WA_T_FINAL-VAC_FHRNM
INTO T_FINAL3 SEPARATED BY CON_TAB.
CONCATENATE CON_CRET T_FINAL3 INTO T_FINAL3.
APPEND T_FINAL3.
ENDLOOP.
*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 = 'REPORT'.
W_DOC_DATA-OBJ_DESCR = LD_MTITLE . "mail description
W_DOC_DATA-SENSITIVTY = 'F'.
*Fill the document data and get size of attachment
CLEAR W_DOC_DATA.
READ TABLE T_FINAL1 INDEX W_CNT.
W_DOC_DATA-DOC_SIZE =
( W_CNT - 1 ) * 255 + STRLEN( T_FINAL1 ).
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[] = PT_FINAL1[].
*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 1st 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 = 'Application 1'.
T_PACKING_LIST-OBJ_NAME = 'Application 1'.
T_PACKING_LIST-DOC_SIZE = T_PACKING_LIST-BODY_NUM * 255.
APPEND T_PACKING_LIST.
CLEAR 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.
Edited by: Rahul Ghosh on Apr 6, 2009 6:42 AM -
Sending an excel file in email
Hello all!
I need a help, please someone helps me...
I always send pdf by email without problems, nor i need to send an excel file by email i am using demo mail package, can anyone give an example please???
THank you!I am sending by the same way of pdf but its showing the message error - ora 21560
CREATE OR REPLACE PROCEDURE P_Envia_Nybot (V_REPORT IN VARCHAR2,V_CAMINHO_REPORT VARCHAR2) IS
p_sender VARCHAR2(100);
p_recipients VARCHAR2(4000);
p_subject VARCHAR2(100) := 'Transaction Confirmation';
p_filename VARCHAR2(5000);
p_blob blob;
V_NOME_ARQUIVO VARCHAR(50);
conn utl_smtp.connection;
i NUMBER;
len NUMBER;
vFlob BFILE;
vBlob BLOB;
v_arquivo2 VARCHAR2(500);
v_report_novo VARCHAR2(200);
BEGIN
UPDATE CIMASTER SET arquivo_NYBOT = (EMPTY_BLOB())
RETURN arquivo_NYBOT INTO vBlob;
VFlob := BFILENAME('ORALOADNYBOT',RTRIM(v_report));
DBMS_LOB.FILEOPEN(vFlob,DBMS_LOB.FILE_READONLY);
DBMS_LOB.LOADFROMFILE(vBlob,vFlob,DBMS_LOB.GETLENGTH(vFlob));
DBMS_LOB.FILECLOSE(vFlob);
SELECT ARQUIVO_NYBOT INTO P_BLOB FROM CIMASTER;
SELECT SENDER INTO P_SENDER FROM CIMASTER_EMAIL;
conn := Demo_Mail.begin_mail(
sender => p_sender,
recipients => '[email protected]',
subject => 'Transaction Confirmations',
mime_type => Demo_Mail.MULTIPART_MIME_TYPE);
Demo_Mail.begin_attachment(
conn => conn,
mime_type => 'TEXT/PLAIN',
inline => TRUE,
filename => v_REPORT,
transfer_enc => 'base64');
-- split the Base64 encoded attachment into multiple lines
i := 1;
len := DBMS_LOB.getLength(p_blob);
WHILE (i < len) LOOP
IF(i + Demo_Mail.MAX_BASE64_LINE_WIDTH < len)THEN
UTL_SMTP.Write_Raw_Data (conn
, UTL_ENCODE.Base64_Encode(
DBMS_LOB.SUBSTR(p_blob, Demo_Mail.MAX_BASE64_LINE_WIDTH, i)));
ELSE
UTL_SMTP.Write_Raw_Data (conn
, UTL_ENCODE.Base64_Encode(
DBMS_LOB.SUBSTR(p_blob, (len - i)+1, i)));
END IF;
UTL_SMTP.Write_Data(conn, UTL_TCP.CRLF);
i := i + Demo_Mail.MAX_BASE64_LINE_WIDTH;
END LOOP;
Demo_Mail.end_attachment(conn => conn);
Demo_Mail.attach_text(
conn => conn,
data => NULL,
mime_type => 'text/html');
Demo_Mail.end_mail( conn => conn );
i := 1;
len := DBMS_LOB.getLength(p_blob);
WHILE (i < len) LOOP
IF(i + Demo_Mail.MAX_BASE64_LINE_WIDTH < len)THEN
UTL_SMTP.Write_Raw_Data (conn
, UTL_ENCODE.Base64_Encode(
DBMS_LOB.SUBSTR(p_blob, Demo_Mail.MAX_BASE64_LINE_WIDTH, i)));
ELSE
UTL_SMTP.Write_Raw_Data (conn
, UTL_ENCODE.Base64_Encode(
DBMS_LOB.SUBSTR(p_blob, (len - i)+1, i)));
END IF;
UTL_SMTP.Write_Data(conn, UTL_TCP.CRLF);
i := i + Demo_Mail.MAX_BASE64_LINE_WIDTH;
END LOOP;
Demo_Mail.end_attachment(conn => conn);
Demo_Mail.attach_text(
conn => conn,
data => NULL,
mime_type => 'text/html');
Demo_Mail.end_mail( conn => conn );
END;
/ -
Adapter Module Error-Sending excel file as an attachment of the mail
Hi ,
My scenario is as follows
1)I am sending an excel file as an attachment of the mail.I need to read that excel attachment as a payload.
So mail adapter is used in sender side.
To configure this, have used standard PayloadSwapBean module with proper module key.
Next to convert excel to XML another custom adapter module is being used.
Both this adapter module , I configured into the CC of sender mail adapter.
The order in which adapter modules are being used in the sender CC are as follows
1)localejbs/AF_Modules/PayloadSwapBean
2)localejbs/MDPExcelToXMLConversion
3)sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
MDPExcelToXMLConversion-Custom adapter module written to convert excel to xml.
I am getting the following error
exception caught during processing mail message [4899]com.sap.aii.af.lib.mp.module.ModuleException
And also,
no messages in coming MONI of PI.
Pls suggest what to do.
Thanks
AyanShabarish,
Will the ordering in which the adapter modules(In this case there are two-PayloadSwapBean & MDPExcelToXML) are appearing into Module tab of sender adapter matter?
Firstly, what is happenning
1)If I take out the custom adapter module MDPExcelToXML and put only PayloadSwapBean then it is successfully converting mail attachment into the main Payload i.e PayloadSwapBean module is working.
2)Nextly, my local code( i.e java code without including standard Module specific method like ejbActivate(),ejbPassivate(),process() etc etc.)) for MDPExcelToXML is successfuly converting the excel file into the XML file.Then I am making the local code into adapter module specific code and deploying that.
A few question arises here,
Do I need to do any specific configurations here in PI for this particular things.Maybe both the adapter module is clashing with each other.
And also using tracing and logging into my custom adapter module code.Getting the following error,
java.io.IOException: Unable to read entire header; 116 bytes read; expected 512 bytes#
Thanks
Ayan -
Preview 6.0, no send file as email attachment?
Does anyone know where they put the send file command? I need to email pdfs from Preview all the time.
There used to be a "send file as email attachment" command under the edit menu. It's gone. Anyone have any suggestions?Handsomfreddy wrote:
Sorry, I dont understand what you are referring to. Can you calify please "undo the changes."
Thanks,
Andy
Didn't you just post this (below)
Handsomfreddy wrote:
Very bizarrely Parallels had changed this Mail Preference to some weird Windows program [Disk Clean up or something equally random] thus preventing me from emailing anything from any program.
That's the change I am referring to. -
Sending ALV result as Excel file in email and in background mode
Hello,
My need was to developp a generic program to send ALV result in a Excel file by email (as we have already a program to send any spool in PDF format).
I found package SALV_EXPORT which contains very interesting things.
I have done a program with following selection-screen parameters:
- Name of a program to call
- execution variant linked to this program
- several output options (mail, save as local file, save on application server...)
data: g_guid type guid_32.
data : l_xxml_data type xstring.
g_guid = cl_salv_export_db_storage=>create_guid( ).
export l_mode = 'M' to memory id 'ALV_EXTRACT_MODE'.
export l_guid = g_guid to memory id 'ALV_EXTRACT_GUID'.
* call the program with its variant
submit (p_prog)
using selection-set p_vari
and return.
* Get back the data
l_xxml_data = cl_salv_export_db_storage=>import_xmlstring( guid = g_guid ).
Here, we have a XML data (ALVXML or XML for Excel, i don't know) which is the ALV result with the layout applied (either the alv layout specified on selection-screen of called program or default layout).
This solution is so simple that i wonder that it's not documented (or i haven't found the documentation).
If anybody knows any problem with this solution, has anyu remarks or want to add some enhancement, don't hesitate to post..
Hope this help
ChristopheA review of comments in ALV driver code shows references to "Mendocino" which I believe is now called 'Duet". It's part of SAP and Microsoft Office integration suite:
http://www.sap.com/solutions/duet/index.epx
I have used this method of extracting ALV reports in the past but I don't think it's released for general use.
Thanks,
Abdul Rouhi
Washington, DC -
Send file as email attachment not working
any help would be greatly appreciated...
When I click "send file as email attachment" it will open outlook with the PDF attached but when I click send on the email, the email closes like it is sent but never actually gets sent (nothing in sent items and recipient never gets the email)
Adobe Acrobat 11 Pro (Creative Cloud Suite installed)
Outlook 2013Hi sandyw26405588,
Could you please try sending PDF as email attachment via another email apart from Outlook.
Are you able to send the file successfully?
Also, go under 'Help> Check for Updates' and ensure if you are using the latest version of Acrobat XI i.e. 11.0.10
Have you tried sending any other PDF via Outlook?
Let me know.
Regards,
Anubha -
Attach an Excel File with Email for External Email Address
Hi,
I want to send an excel file to an external email address as an attachement.
I am using the function module SO_NEW_DOCUMENT_ATT_SEND_API1 for sending the email.
But as far as I know we can only create and send the excel file in this FM. e.g. we can put the text manually and name the file as excel and add it as packing list and send the document.
Now, my client has a template in excel/word which he wants to send as an attachment always when he sends the mail. I have below Queries:
1. Where and how do i store the template which is in Excel or word? He doesnt want to upload the template each time he runs the report. Can I save the file on AL11? how do i insert the file in this?
2. I have tried standard texts, but his template contains a logo. So, I am not sure if that would work. Can I send the template in Binary and just aapend the file extension? xls or doc? would that do?Hi,
See if you can matintain the required templates in document management and use them in your reports.
Try the link below for reference.
[Document Management|http://wiki.sdn.sap.com/wiki/display/PLM/Templates-Document+Management]]
Regards,
Booma -
Sending email with excel file as an attachment
Hi,
In my procedure I am creating one excel file and keeping that excel file in one location as specified in UTL_FILE_DIR.Now my requirement is to pick that excel file from that path and send it as an attachment through an Email.
Can anyone please give me the code to do that and what are the required set up to be done before sending the mail.
Please help me in this regard. This is an urgent requirement.
Thanks
SubhabrataHi,
Please refer the following link:
http://www.dbasupport.com/oracle/ora10g/10g_PLSQL02.shtml
There is para headed Sending E-Mail and Attachments with UTL_MAIL will clarify all your doubts. Link Listing 2.6
is good example.
If you get stuck while coding, get back to us.
Twinkle -
Sending an excel file as an attachment to email
Hi,
I am using FM 'SO_DOCUMENT_SEND_API1' to send an excel file to an email ID.But the mail is going to the SAP inbox and it is posting not to the external mail ID like ([email protected]).
Please suggest me on this.
Regards'
Ved.Hi
The mail sending process depends on how your company's mail server has been setup. Check the mail server setup with ur basis/network team. Moreover, go to transaction SCOT and manually trigger the mail sending process.
In this transaction check the SMTP settings if it is set to *ALL.
Moreover, try to manually trigger the send process in SCOT. There is a button called 'Start Send process'. After this check if the mails are still in your SAP Outbox. You can even trigger the send process from within your ABAP program by submitting the program RSCONN* (Try to search with this initials)
Please award points if this was helpful. -
Hi Experts
Hope you guys are doing fine.
I have a requirement where i need to send the internal table data as an excel email attachment.I used the FM 'SO_NEW_DOCUMENT_ATT_SEND_API1',but in the email attachment,the data is getting distorted and not coming in a properly manner.Here with,i am pasting the code i used.
(l_pto_tab is the internal table)
FORM report_as_email .
TYPES : BEGIN OF ty_pto_tab,
pernr(10),
nachn(40),
vorna(40),
hdate(15),
supno(10),
supln(40),
supfn(40),
END OF ty_pto_tab.
DATA: wa_pack_list TYPE sopcklsti1,
it_pack_list TYPE TABLE OF sopcklsti1.
DATA: it_email_lines like SOLISTI1 occurs 0 with header line,
it_obj_text like SOLISTI1 occurs 0 with header line.
DATA: wa_object_header TYPE solisti1,
it_object_header TYPE TABLE OF solisti1.
DATA: wa_mail_receiver TYPE somlreci1,
it_mail_receiver TYPE TABLE OF somlreci1.
DATA: wa_mail_data TYPE sodocchgi1,
l_pto_tab type ty_pto_tab occurs 0 with header line.
DATA: w_att_lines(6) TYPE n.
DATA: w_att_lines1(6) TYPE n.
DATA: text1 TYPE c LENGTH 155.
DATA: text2 TYPE c LENGTH 155.
DATA: text3 TYPE c LENGTH 155.
DATA: wa_error_cols TYPE ty_email_lines.
DATA: count TYPE i.
DATA: gv_date1 TYPE c LENGTH 10.
REFRESH: it_pack_list,
it_object_header,
it_mail_receiver.
Set first line to be displayed in the document
wa_object_header-line = 'PTO_Reminder_List.TXT'.
APPEND wa_object_header TO it_object_header.
*-- Document data
CLEAR: wa_mail_data.
wa_mail_data-obj_name = 'Object name'.
wa_mail_data-sensitivty = 'O'.
wa_mail_data-obj_descr = 'PTO Reminder Report'.
Set Mail body
it_obj_text = 'PTO Reminder'.
append it_obj_text.
clear it_obj_text.
*-- Set Attachment values
l_pto_tab-pernr = 'EE Number'.
l_pto_tab-nachn = 'EE LNAME'.
l_pto_tab-vorna = 'EE FNAME'.
l_pto_tab-hdate = 'Hire Date'.
l_pto_tab-supno = 'Sup No'.
l_pto_tab-supln = 'Sup LNAME'.
l_pto_tab-supfn = 'Sup FNAME'.
INSERT l_pto_tab INTO it_email_lines INDEX 1.
CLEAR l_pto_tab.
count = 1.
loop at it_pto_tab.
l_pto_tab-pernr = it_pto_tab-pernr.
l_pto_tab-nachn = it_pto_tab-nachn.
l_pto_tab-vorna = it_pto_tab-vorna.
l_pto_tab-hdate = it_pto_tab-hdate.
l_pto_tab-supno = it_pto_tab-supno.
l_pto_tab-supln = it_pto_tab-supln.
l_pto_tab-supfn = it_pto_tab-supfn.
append l_pto_tab.
clear l_pto_tab.
endloop.
l_pto_tab is the internal table
LOOP AT l_pto_tab.
count = count + 1.
INSERT l_pto_tab INTO it_email_lines INDEX count.
ENDLOOP.
REFRESH l_pto_tab.
wa_pack_list-head_start = 1.
wa_pack_list-head_num = 0.
wa_pack_list-body_start = 1.
wa_pack_list-body_num = 1.
wa_pack_list-doc_type = 'RAW'.
wa_pack_list-doc_size = 255.
APPEND wa_pack_list TO it_pack_list.
CLEAR: wa_pack_list.
DESCRIBE TABLE it_email_lines LINES w_att_lines.
READ TABLE it_email_lines INDEX w_att_lines.
wa_mail_data-doc_size = ( w_att_lines - 1 ) * 255 +
STRLEN( it_email_lines-line ).
Attachment
wa_pack_list-transf_bin = 'X'.
wa_pack_list-head_start = 1.
wa_pack_list-head_num = 1.
wa_pack_list-body_start = 1.
wa_pack_list-body_num = w_att_lines.
Excel attachment
wa_pack_list-doc_type = 'XLS'.
wa_pack_list-obj_name = 'ATTACHMENT'.
wa_pack_list-obj_descr = 'PTO_REMINDER_LIST'.
wa_pack_list-doc_size = wa_mail_data-doc_size.
APPEND wa_pack_list TO it_pack_list.
CLEAR: wa_pack_list.
*-- Set E-Mail Receiver address
wa_mail_receiver-receiver = '[email protected]'.
wa_mail_receiver-rec_type = 'U'.
wa_mail_receiver-express = 'X'.
APPEND wa_mail_receiver TO it_mail_receiver.
*-- Send E-Mail
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = wa_mail_data
put_in_outbox = 'X'
commit_work = 'X'
tables
packing_list = it_pack_list
object_header = it_object_header
contents_bin = it_email_lines
contents_txt = it_obj_text
receivers = it_mail_receiver
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 NOT sy-subrc IS INITIAL.
WRITE: / 'E-mail failed.'.
ENDIF.
ENDFORM. " report_as_email
Can anyone look into this code and let me know what changes i need to make to correct this error.Or if anyone has any sample code,can you pls share it with me.
Your help wud be greatly appreciated.
Thnxalan,
Check the below code.
report y_cr17_mail .
data method1 like sy-ucomm.
data g_user like soudnamei1.
data g_user_data like soudatai1.
data g_owner like soud-usrnam.
data g_receipients like soos1 occurs 0 with header line.
data g_document like sood4 .
data g_header like sood2.
data g_folmam like sofm2.
data g_objcnt like soli occurs 0 with header line.
data g_objhead like soli occurs 0 with header line.
data g_objpara like selc occurs 0 with header line.
data g_objparb like soop1 occurs 0 with header line.
data g_attachments like sood5 occurs 0 with header line.
data g_references like soxrl occurs 0 with header line.
data g_authority like sofa-usracc.
data g_ref_document like sood4.
data g_new_parent like soodk.
data: begin of g_files occurs 10 ,
text(4096) type c,
end of g_files.
data : fold_number(12) type c,
fold_yr(2) type c,
fold_type(3) type c.
parameters ws_file(4096) type c default 'c:\debugger.txt'.
Can me any file fromyour pc ....either xls or word or ppt etc ...
g_user-sapname = sy-uname.
call function 'SO_USER_READ_API1'
exporting
user = g_user
PREPARE_FOR_FOLDER_ACCESS = ' '
importing
user_data = g_user_data
EXCEPTIONS
USER_NOT_EXIST = 1
PARAMETER_ERROR = 2
X_ERROR = 3
OTHERS = 4
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
fold_type = g_user_data-outboxfol+0(3).
fold_yr = g_user_data-outboxfol+3(2).
fold_number = g_user_data-outboxfol+5(12).
clear g_files.
refresh : g_objcnt,
g_objhead,
g_objpara,
g_objparb,
g_receipients,
g_attachments,
g_references,
g_files.
method1 = 'SAVE'.
g_document-foltp = fold_type.
g_document-folyr = fold_yr.
g_document-folno = fold_number.
g_document-objtp = g_user_data-object_typ.
*g_document-OBJYR = '27'.
*g_document-OBJNO = '000000002365'.
*g_document-OBJNAM = 'MESSAGE'.
g_document-objdes = 'Manohar testing by program'.
g_document-folrg = 'O'.
*g_document-okcode = 'CHNG'.
g_document-objlen = '0'.
g_document-file_ext = 'TXT'.
g_header-objdes = 'Manohar testing by program'.
g_header-file_ext = 'TXT'.
call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
exporting
method = method1
office_user = sy-uname
ref_document = g_ref_document
new_parent = g_new_parent
importing
authority = g_authority
tables
objcont = g_objcnt
objhead = g_objhead
objpara = g_objpara
objparb = g_objparb
recipients = g_receipients
attachments = g_attachments
references = g_references
files = g_files
changing
document = g_document
header_data = g_header
FOLMEM_DATA =
RECEIVE_DATA =
File from the pc to send...
method1 = 'ATTCREATEFROMPC'.
g_files-text = ws_file.
append g_files.
call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
exporting
method = method1
office_user = g_owner
ref_document = g_ref_document
new_parent = g_new_parent
importing
authority = g_authority
tables
objcont = g_objcnt
objhead = g_objhead
objpara = g_objpara
objparb = g_objparb
recipients = g_receipients
attachments = g_attachments
references = g_references
files = g_files
changing
document = g_document
header_data = g_header
method1 = 'SEND'.
g_receipients-recnam = 'MK085'.
g_receipients-recesc = 'B'.
g_receipients-sndex = 'X'.
append g_receipients.
call function 'SO_DOCUMENT_REPOSITORY_MANAGER'
exporting
method = method1
office_user = g_owner
ref_document = g_ref_document
new_parent = g_new_parent
importing
authority = g_authority
tables
objcont = g_objcnt
objhead = g_objhead
objpara = g_objpara
objparb = g_objparb
recipients = g_receipients
attachments = g_attachments
references = g_references
files = g_files
changing
document = g_document
header_data = g_header.
Don't forget to reward if useful....... -
Problem viewing Japanese characters in Excel sent via Email attachment
Hi All
I am using FM '''SO_DOCUMENT_SEND_API1'' to send out an e-mail attachment (Excel file). I am able to receive the Excel file successfully. However I am not able to display the Japanese characters properly in my Excel file.
I tried to display some Japanese characters in my e-mail contents and I have no problem viewing these characters in my e-mail (I am using MS Outlook 2003). These statements becomes something illegible when I transfer it over to Excel as an attachment. In my Internal Table, these characters are displayed correctly as well.
Anyone has any advice to solve this issue?
Thanks for your replies.Hi Divya,
refer to the link below:
http://www.sapdevelopment.co.uk/reporting/email/attach_xls.htm
The code in this demonstrates how to send an email to an external email addresswhere the data is stored within a .xls attachment.
Hope this helps.
Reward if helpful.
Regards,
Sipra -
Problem in Attachning an Excel File in Email
Hello Everyone,
I have a problem which sends an email containing an excel as an attachment. However, if I check the excel file in the email, the filename is not properly defined, and there is an error stating that the format is not recognizable in excel format.
I am using the function module SO_DOCUMENT_SEND_API1.
Please help.
Thanks,
JimHi,
i am sending some information how to send mails
please check it once,
please reward points, if it is useful.
A SAP mail is a mail internal to the SAP system. It is a very good forum to exchange information with other users. Using a SAP mail in ABAP code facilitates exchange of automatic messages at various stages of the business process. It is easy to use and saves many hassles involved in using workflows for exchanging messages.
The ABAP code to send a sap mail is built around the FM SO_OBJECT_SEND which has the following pattern.
call function 'SO_OBJECT_SEND'
exporting
EXTERN_ADDRESS = ' '
FOLDER_ID = ' '
FORWARDER = ' '
OBJECT_FL_CHANGE = ' '
OBJECT_HD_CHANGE = ' '
OBJECT_ID = ' '
OBJECT_TYPE = ' '
OUTBOX_FLAG = ' '
OWNER = ' '
STORE_FLAG = ' '
DELETE_FLAG = ' '
SENDER = ' '
CHECK_ALREADY_SENT = ' '
importing
object_id_new =
sent_to_all =
tables
OBJCONT =
OBJHEAD =
OBJPARA =
OBJPARB =
receivers =
PACKING_LIST =
ATT_CONT =
ATT_HEAD =
NOTE_TEXT =
exceptions
active_user_not_exist = 1
communication_failure = 2
component_not_available = 3
folder_not_exist = 4
folder_no_authorization = 5
forwarder_not_exist = 6
note_not_exist = 7
object_not_exist = 8
object_not_sent = 9
object_no_authorization = 10
object_type_not_exist = 11
operation_no_authorization = 12
owner_not_exist = 13
parameter_error = 14
substitute_not_active = 15
substitute_not_defined = 16
system_failure = 17
too_much_receivers = 18
user_not_exist = 19
x_error = 20
others = 21.
Import Parameters Name and Description Field name Field function
Object_hd_change (structure)
Contains the process to be done when SAP mail is marked for execution.
When the Execute Icon in the SAP mail is clicked the corresponding object is executed vmtyp D for dialog module
F for function module
R for report
T for transaction
U for transaction with export
Acnam Name of the object which is to be executed, like name of transaction/report
Skips X to execute first screen in background
Objsns Indicates sensitivity of the object.
P for private object
F for functional object
O for confidential object
C for company confidential object
Sensitivity level is restricted to O for documents in shared folders
Objla Language of the document
E for English
sy-langu for system language
Objnam Name of the document
Objdes Short description (Title) of the document
Objsrt Name of the sort field. This is used to group documents based on certain criteria
Object_type
Type of document to be sent with mail RAW for raw text (default)
DOC for word file
XLS for excel file
All classes can be used except for folders (FOL) and distribution lists (DLI)
Outbox_flag X to indicate that mail should also be stored in outbox of the user after sending (default )
Owner Sap login of the user responsible for transmission
Table Parameters Name and Description Field Name Field function
Objcont
Table to hold the body of the mail Line Text lines up to 255 characters
Objhead
Table to hold number of lines in the body of the mail, i.e size of the table in lines Line Text lines up to 255 characters
Objpara
Table to hold the set/get parameters to be transferred to the processing element Name Name of the parameter. Only first three characters are used
Option Not used
Low Value of the parameter in name
High Not used
Objparb
Table to hold information for mails to which a certain processing type is assigned. For a report or transaction with transfer of values to global memory, the table has to contain the parameters with relevant values. The memory id is taken from the first row. For a FM or dialog module, data in table will be transferred as table parameter msgdial Name For report or transaction with transfer of values to global memory, the field for first row should hold the name of the memory id used for export and the other rows should hold the parameter names. For FM or dialog module this field should hold the values as per the usage of the module
Value For report or transaction with transfer of values to global memory, the field for first row should remain empty and the other rows should hold values of the parameters. For FM or dialog module this field should hold the values as per the usage of the module
Receivers
Table to hold recipient details Recnam SAP login of the recipient. Append all the recipients to this table
Sndcp X for sending mail as a copy
Sndex X for sending as express document. This will prompt a logged on recipient saying that he or she has received an express mail
Recesc B for SAP user
E for external email address
U for unix address
Export Parameters Name and Description Field name Field function
Object_id_new
Contains object id of document created during send process
Sent_to_all
X indicates that document was sent to all recipients. Flag is not activated if sending fails in one or more cases
Main Exceptions Name and Description Description
Too_much_receivers Number of recipients is greater than number for which sender is authorised to send
Object_not_sent Document was not delivered to any of the recipients
Object_not_exist Document class specified does not exist or cannot be sent
Object_no_authorisation Document could not be sent as one of the required authorisations does not exist
Parameter_error Invalid combination of parameter values transferred to FM
X_error Internal error occurred
Once all the parameters and table interfaces are properly filled, call the function module to send the SAP mail to the recipient inbox.
Care should be taken to report the status of execution of the function module to the user using one of the exceptions defined (refer function module pattern above)
Though SAP mail is a very robust method of interacting with users within SAP system, it is always good to receive email in Microsoft inbox. This also works like an additional notification to users in case they do not check SAP mail regularly. The next article covers sending E-mails using ABAP.
regards,
satish. -
How to set up link on icon to forward PDF file as email attachment
HI,
I need urgent help.
I know this used to work but cant find it in Acrobat XI.
We created a file for a client, on the last page is a twitter, facebook and linkedIn icon which are set as links in Indesign to forward to the matching social network. Works fine when I created PDF with Hyperlinks.
We also set up an envelope symbol which shall get, now where it is set up as PDF, a link, so the PDF itself can get forwarded as a email attachment.
I can not find this function on a MAC nor on PC Acrobat XI.
Hope you can help, much appreciated!!!!
THANKSHave a look at this thread:
http://forums.adobe.com/thread/1275490?tstart=0
where there is a script for submitting the PDF by email.
Maybe you are looking for
-
Multiple PO's created for a SC with a Single line item except delvery date
Hi Experts, I have one issue ... SRM - Classic scenario One Shopping Cart created with one line item ... but generated two PO's EX - First one - A and Sec - B Almost the data is ame except the delivery date . There can be a possibility that it was
-
My iPad is not playing sound on music videos...
Suddenly my iPad is not playing the sound on music videos. I have already tried holding down the sleep and home button...still not working.
-
HT4972 Updating IPad operating system
I have an early IPad (version 3.2.1 (7B405) model MB292LL), is it possible to update the operating system to IOS?
-
Please advice how do i create a reference user and associate it with a web user. Thanks in advance Regards, Nitin
-
Odd errors when resuming from sleep
Trying to use my Qosmio in sleep mode, but when I resume from sleep the USB devices all have to be unplugged then plugged back in. The system event viewer logs the following and Microsoft's suggested solution is to contact the manufacturer, which is