Problem with attaching files to mail message
Hello,
I have problem with my mail app. I'm using spaces for better organization. When I wanna add some file to mail message I usually go to different desktop (space), where I have the file I wanna attach. I grab it move to right up corner to activate spaces, than move to desktop (space) with mail.app and press spacebar (it activates the desktop immediately). At that time it also start random app, which is in my dock.
You can see it in my youtube video.
How can avoid this strange thing happen?
http://www.youtube.com/watch?v=KUypUnPHZvc
I'm using MacBook Pro 15'', Snow Leopard - latest updates. I've reinstalled my mac two days ago, so no garbage should be in.
Thanks for quick reply.
I don't have selected "always..." so I also tried it with selected "always...".
Now I discovered that it has nothing to do with the mail. I've tried just move some file from one of spaces (desktop) to another using the spacebar for faster switching and it did the same. It opens random app from Dock.
So now this topic is in wrong discussion. I will post it to correct discussion...
Similar Messages
-
Problems with attached documents in Mail and Docs To Go
Hello everybody.
I've found a problem with attached documents in Mail. In fact, if I click on attached documents with .doc (microsoft office word 97-2004) and files in .docx Office Open .xml, the iPad doesn't open them, also if I click in "Open with Docs To Go (which should support these files' format)".
How can I do? There's an application or another way to open these files?
Other Informations:
Docs To Go version: 5.2.2Update the patch to the Sapgui.
Regards,
Ignacio. -
Problem with attaching file to Sales Order
Hello,
In my company we have the possibility to attach files to sales orders, e.g. pdf files with the printing details.
These files are added by the GUI user, this works fine.
Now we have an extra order creation stream in which a pdf file has to be added to the SO without user interaction.
I found a helpful link ( /people/rammanohar.tiwari/blog/2005/10/10/generic-object-services-gos--in-background )
This program creates URL links with no problem, but the file generation is not implemented yet.
I tried to add the file functions to his sample report but still have one problem. The file is uploaded, but not reported as a PDF file in sap. If I select the created attachment SAP allows only the saving of the attachment. After saving the created file is a good PDF file, it opens with PDF-viewers.
Why does SAP not know this is a PDF file and report it as such (and open the pdf viewer when selected).
Thanks, Frank.
source-code:
REPORT zzfb_brc .
* Report Z_RMTIWARI_ATTACH_DOC_TO_BO
* Written By : Ram Manohar Tiwari
* Function : We need to maintain links between Business Object and
* the attachment.Attachment document is basiclally a
* business object of type 'MESSAGE'.In order to maintain
* links, first the attachment will be crated as Business
* Object of type 'MESSAGE' using Message.Create method.
* Need to check if we can also use FM
* 'SO_DOC_INSERT_WITH_ORIG_API1' or SO_OBJECT_INSERT rather
* than using Message.Create method.
* I took this program and removed all the parts for adding URL's and
* notes.
* Include for BO macros
INCLUDE : <cntn01>.
* Load class.
CLASS cl_binary_relation DEFINITION LOAD.
CLASS cl_obl_object DEFINITION LOAD.
PARAMETERS:
* Object_a
p_botype LIKE obl_s_pbor-typeid DEFAULT 'BUS2032', "SO
p_bo_id LIKE obl_s_pbor-instid DEFAULT '0000757830', "example number
* Object_b
p_docty LIKE obl_s_pbor-typeid DEFAULT 'MESSAGE' NO-DISPLAY,
p_msgtyp LIKE sofm-doctp DEFAULT 'EXT' NO-DISPLAY,
* Relationship
p_reltyp LIKE mdoblrel-reltype DEFAULT 'ATTA'.
TYPES: BEGIN OF ty_message_key,
foltp TYPE so_fol_tp,
folyr TYPE so_fol_yr,
folno TYPE so_fol_no,
doctp TYPE so_doc_tp,
docyr TYPE so_doc_yr,
docno TYPE so_doc_no,
fortp TYPE so_for_tp,
foryr TYPE so_for_yr,
forno TYPE so_for_no,
END OF ty_message_key.
DATA : lv_message_key TYPE ty_message_key.
DATA : lo_message TYPE swc_object.
DATA : lt_doc_content TYPE STANDARD TABLE OF soli-line,
ls_doc_content TYPE soli-line.
* Create an initial instance of BO 'MESSAGE' - to call the
* instance-independent method 'Create'.
swc_create_object lo_message 'MESSAGE' lv_message_key.
* Upload the pdf file, for now from the frontend, in the future from
* the server.
DATA:
* dsn(40) TYPE C VALUE '/usr/sap/trans/convert/1.pdf', "server location
l_lines TYPE i. "filelenght
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'c:t1.pdf'
filetype = 'BIN'
IMPORTING
filelength = l_lines
TABLES
data_tab = lt_doc_content.
* no exceptions, the file is there in this example
break brouwersf.
** the coding for the server input, for later
*OPEN DATASET dsn FOR INPUT IN BINARY MODE.
*IF sy-subrc <> 0.
* EXIT.
*ENDIF.
*READ DATASET dsn INTO ls_doc_content.
*WHILE sy-subrc EQ 0.
* APPEND ls_doc_content TO lt_doc_content.
* READ DATASET dsn INTO ls_doc_content.
*ENDWHILE.
*CLEAR ls_doc_content.
*CLOSE DATASET dsn.
* define container to pass the parameter values to the method call
* in next step.
swc_container lt_message_container.
* Populate container with parameters for method
swc_set_element lt_message_container 'DOCUMENTTITLE' 'Title'.
swc_set_element lt_message_container 'DOCUMENTLANGU' 'E'.
swc_set_element lt_message_container 'NO_DIALOG' 'X'.
swc_set_element lt_message_container 'DOCUMENTNAME' p_docty.
swc_set_element lt_message_container 'DOCUMENTTYPE' p_msgtyp.
swc_set_element lt_message_container 'DocumentSize' l_lines.
swc_set_element lt_message_container 'DocumentContent' lt_doc_content.
swc_call_method lo_message 'CREATE' lt_message_container.
* Refresh to get the reference of create 'MESSAGE' object for attachment
swc_refresh_object lo_message.
* Get Key of new object
swc_get_object_key lo_message lv_message_key.
* Now we have attachment as a business object instance. We can now
* attach it to our main business object instance.
* Create main BO object_a
DATA: lo_is_object_a TYPE sibflporb.
lo_is_object_a-instid = p_bo_id.
lo_is_object_a-typeid = p_botype.
lo_is_object_a-catid = 'BO'.
* Create attachment BO object_b
DATA: lo_is_object_b TYPE sibflporb.
lo_is_object_b-instid = lv_message_key.
lo_is_object_b-typeid = p_docty.
lo_is_object_b-catid = 'BO'.
*TRY.
CALL METHOD cl_binary_relation=>create_link
EXPORTING
is_object_a = lo_is_object_a
is_object_b = lo_is_object_b
ip_reltype = p_reltyp.
* Check if everything OK...who cares!!
COMMIT WORK.Hi,
Welcome to the SDN Forums!!!
You need to supply the PC file extension in the container element 'DOCUMENTTYPE'.
swc_set_element lt_message_container 'DOCUMENTTYPE' p_msgtyp.
In your case change the above statement as below:
swc_set_element lt_message_container 'DOCUMENTTYPE' 'pdf'.
<b>OR</b> change the default value of p_msgtyp to 'PDF'.
Cheers,
Ramki Maley.
Please reward points if the answer is helpful.
For info on awarding points click on this link: https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm
Message was edited by: Ramki Maley -
Problems with Attachment location in Mail
I am using mail in Mountain Lion and whenever I forward or reply to an email and add an attachment it puts the attachment all the way at the bottom of the page. It doesn't matter where the cursor is, which is what I'm used to being the indicator as to where the attachment goes, it just puts it at the bottom of the page regardless. I have to cut the original forwarded message, back the attachment up to the message I typed, and then enter down and paste the original message back in it. It doesn't make sense, I'm around 50 Mac computers daily and mine is the only one that is doing this...
Thanks in advance!I'm on a tower running 10.6.8 and have had this problem for months. Any help would be great!
-
Problems reading attached files in Mail 5.2
After moving messages from inbox to different mailboxes, it sometimes happens that the attached file (exel, word...) disappears as an attachment and is no longer readable. > The content converts itself as a long text looking like this "CBAAAAYFAOwVzQfBwAAABgMAAOEAAgCwBMEAAgAAAOIAAABcAHAADQAAYWRtaW5pc3Ry...." and I can no longer save the file because it has disappeared!!!
I don't want to PRINT or SAVE every attachment. I just want to keep the message as long as I might need it's content. But this is no longer possible nor reliable.
CAN SOMEONE HELP ME??? Thank you :-)Disable Mac Mail.app Inline Image Attachments
http://micahgilman.com/play/disable-mac-mailapp-inline-image-attachments/
Force Apple mail.app to display attachments as icon
http://www.sant-media.co.uk/2010/11/apple-mail-inline-attachments/
Mail.app attachment as icon
http://creativebits.org/mac_os_x/mail_app_attachment_as_icon/ -
Hello!
I have problem with attach in e-mail for bidders.
I create a bid invitation and attach any document.
[Attach|http://www.4shared.com/file/67153110/5be21d31/attach01.html]
So, i publish my bid invitation and a e-mail is send to bidder.
But, i go to the SOST and view the e-mail and attach not is there.
[Problem|http://www.4shared.com/file/67153109/3b2594d4/attach02.html]
Who can i resolve this problem? Are there any configuration for that?
Tanks!Hi Rodrigo
You are absolutely correct. please refer this link.check the mentioned BADI in your systems controls ?
Attachment .PDF in Bid Invitation and Auction e-mail
regards
Muthu -
Convert Screen(spool) to PDF file sending mail with attach file
Hi :
I'd like convert spool list to pdf and sending file...
so, I read thread about spool convert to PDF before,
and know how to convert Spool to PDF file and send mail with attach file.
but I have a problem.
my solution as:
step 1. Call function: "CONVERT_ABAPSPOOLJOB_2_PDF"
step 2. Call function: "SO_NEW_DOCUMENT_ATT_SEND_API1"
then, I got a mail with attached PDF file, but the PDF file display limited 255 line.( SO_NEW_DOCUMENT_ATT_SEND_API1 limited)
I want to showing word is wider that 255.
and then I find a manual method as:
After program finished.
Function Menu -> system -> List -> Send
use Prog: "Create Document and Send"
I use this prog sending mail and attached file ,
PDF file do <b>NOT</b> have 255 word limit !
finally. my question is, If I want sending mail as Prog: "Create Document and Send", how to do?
which Function I have to use?...
Please help me, Thanks!Hi,
Check this sample code of sending spool as attachment to an email address..
Parameters.
PARAMETERS: p_email(50) LOWER CASE.
PARAMETERS: p_spool LIKE tsp01-rqident.
Data declarations.
DATA: plist LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: document_data LIKE sodocchgi1.
DATA: so_ali LIKE soli OCCURS 100 WITH HEADER LINE.
DATA: real_type LIKE soodk-objtp.
DATA: sp_lang LIKE tst01-dlang.
DATA: line_size TYPE i VALUE 255.
DATA: v_name LIKE soextreci1-receiver.
DATA rec_tab LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
Get the spool data.
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = p_spool
first_line = 1
last_line = 0
desired_type = ' '
IMPORTING
real_type = real_type
sp_lang = sp_lang
TABLES
buffer = so_ali
EXCEPTIONS
no_such_job = 1
job_contains_no_data = 2
selection_empty = 3
no_permission = 4
can_not_access = 5
read_error = 6
type_no_match = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE s208(00) WITH 'Error'.
LEAVE LIST-PROCESSING.
ENDIF.
Prepare the data.
plist-transf_bin = 'X'.
plist-head_start = 0.
plist-head_num = 0.
plist-body_start = 0.
plist-body_num = 0.
plist-doc_type = 'RAW'.
plist-obj_descr = 'Test ALV'.
APPEND plist.
plist-transf_bin = 'X'.
plist-head_start = 0.
plist-head_num = 0.
plist-body_start = 1.
DESCRIBE TABLE so_ali LINES plist-body_num.
plist-doc_type = real_type.
Get the size.
READ TABLE so_ali INDEX plist-body_num.
plist-doc_size = ( plist-body_num - 1 ) * line_size
+ STRLEN( so_ali ).
APPEND plist.
Move the receiver address.
MOVE: p_email TO rec_tab-receiver,
'U' TO rec_tab-rec_type.
APPEND rec_tab.
IF NOT sp_lang IS INITIAL.
document_data-obj_langu = sp_lang.
ELSE.
document_data-obj_langu = sy-langu.
ENDIF.
v_name = sy-uname.
Send the email.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = document_data
sender_address = v_name
sender_address_type = 'B'
TABLES
packing_list = plist
contents_bin = so_ali
receivers = rec_tab
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 e208(00) WITH 'Error'.
ENDIF.
COMMIT WORK.
Send the email immediately.
SUBMIT rsconn01
WITH mode = 'INT'
AND RETURN.
Thanks,
Naren -
I can no longer attach aperture files to mail messages. Why?
Before the last aperture upgrade I was always able to select an image in my library and use the share command to attach that image to my mac mail message. Now the email opens but no photo is attached. it is a blank message. I know there is an icon in the right hand corner to access aperture files but this is not as convenient on large libraries.
Is this a bug?Yes, I have always done as you have shown:
"File→Share→Email", "right-click→Output→Email", and "{Option}+e" all create a new mail message with the selected Image(s) attached after being exported using the Image Export Preset specified in "Aperture→Preferences→Export".
But for some reason after Idid the lastest aperture update a couple weeks ago (and I am still using snow leopard), I now cannot get files to show up in my messages.
I can attach files while I am in macmail.And I can drag files from my desktop, but I can no longer get files by doing the file>share>email navigation through Aperture.
Anyone else have this problem?
Re: I can no longer attach aperture files to mail messages. Why? -
Attach file to mail with "unusual" characters
Hi
I have made a procedure that can send mail with attached file/files. But when I attach a text file that contains characters like (Å, Ä or Ö) these characters gets like (A, A and ?) when I recieve the mail to my mail client. When I look at the file on the disk before I attach it the characters is OK but when I attach the file and mails it the characters get replaced. So why does the charaters get messed up when I attach the file to a mail??
My procedure looks like this:
procedure mail_files(from_name varchar2,
to_name varchar2,
subject varchar2,
message varchar2,
max_size number default 9999999999,
filename1 varchar2 default null,
filename2 varchar2 default null,
filename3 varchar2 default null,
debug number default 0) is
mottagare VARCHAR2(2048) := to_name;
v_smtp_server varchar2(32) := 'mail.telia.se';
v_smtp_server_port number := 25;
v_directory_name varchar2(100);
v_file_name varchar2(100);
v_line varchar2(1000);
crlf varchar2(2) := chr(13) || chr(10);
mesg varchar2(32767);
conn UTL_SMTP.CONNECTION;
type varchar2_table is table of varchar2(200) index by binary_integer;
file_array varchar2_table;
i binary_integer;
v_file_handle utl_file.file_type;
v_slash_pos number;
mesg_len number;
mesg_too_long exception;
invalid_path exception;
mesg_length_exceeded boolean := false;
begin
-- first load the three filenames into an array for easier handling later ...
file_array(1) := filename1;
file_array(2) := filename2;
file_array(3) := filename3;
-- Open the SMTP connection ...
conn := utl_smtp.open_connection(v_smtp_server, v_smtp_server_port);
-- Initial handshaking ...
utl_smtp.helo(conn, v_smtp_server);
utl_smtp.mail(conn, from_name);
WHILE (mottagare IS NOT NULL) LOOP
utl_smtp.rcpt(conn, get_element(mottagare));
END LOOP;
--utl_smtp.rcpt( conn, to_name );
utl_smtp.open_data(conn);
-- build the start of the mail message ...
mesg := 'Date: ' || TO_CHAR(SYSDATE, 'dd Mon yy hh24:mi:ss') || crlf ||
'From: ' || from_name || crlf || 'Subject: ' || subject || crlf ||
'To: ' || to_name || crlf || 'Mime-Version: 1.0' || crlf ||
'Content-Type: multipart/mixed; boundary="DMW.Boundary.605592468"' || crlf || '' || crlf ||
'This is a Mime message, which your current mail reader may not' || crlf ||
'understand. Parts of the message will appear as text. If the remainder' || crlf ||
'appears as random characters in the message body, instead of as' || crlf ||
'attachments, then you''ll have to extract these parts and decode them' || crlf ||
'manually.' || crlf || '' || crlf ||
'--DMW.Boundary.605592468' || crlf ||
'Content-Type: text/html; charset=8859-1' || crlf ||
'Content-Disposition: inline;' || crlf ||
'Content-Transfer-Encoding: 8bit' || crlf || '' || crlf ||
message || crlf;
mesg_len := length(mesg);
if mesg_len > max_size then
mesg_length_exceeded := true;
end if;
utl_smtp.write_data(conn, mesg);
--utl_smtp.write_raw_data(conn, utl_raw.cast_to_raw(mesg));
-- Append the files ...
for i in 1 .. 3 loop
-- Exit if message length already exceeded ...
exit when mesg_length_exceeded;
-- If the filename has been supplied ...
if file_array(i) is not null then
begin
-- locate the final '/' or '\' in the pathname ...
v_slash_pos := instr(file_array(i), '/', -1);
if v_slash_pos = 0 then
v_slash_pos := instr(file_array(i), '\', -1);
end if;
-- separate the filename from the directory name ...
v_directory_name := substr(file_array(i), 1, v_slash_pos - 1);
v_file_name := substr(file_array(i), v_slash_pos + 1);
-- open the file ...
v_file_handle := utl_file.fopen(v_directory_name, v_file_name, 'r');
-- generate the MIME boundary line ...
mesg := crlf || '--DMW.Boundary.605592468' || crlf ||
'Content-Type: application/octet-stream; name="' ||
v_file_name || '"' || crlf ||
'Content-Disposition: attachment; filename="' ||
v_file_name || '"' || crlf ||
'Content-Transfer-Encoding: 8bit' || crlf || crlf;
mesg_len := mesg_len + length(mesg);
utl_smtp.write_data(conn, mesg);
-- and append the file contents to the end of the message ...
loop
utl_file.get_line(v_file_handle, v_line);
if mesg_len + length(v_line) > max_size then
mesg := '*** truncated ***' || crlf;
utl_smtp.write_data(conn, mesg);
mesg_length_exceeded := true;
raise mesg_too_long;
end if;
mesg := v_line || crlf;
utl_smtp.write_data(conn, mesg);
mesg_len := mesg_len + length(mesg);
end loop;
exception
when utl_file.invalid_path then
-- All other exceptions are ignored ....
when others then
null;
end;
mesg := crlf;
utl_smtp.write_data(conn, mesg);
-- close the file ...
utl_file.fclose(v_file_handle);
end if;
end loop;
-- append the final boundary line ...
mesg := crlf || '--DMW.Boundary.605592468--' || crlf;
utl_smtp.write_data(conn, mesg);
-- and close the SMTP connection ...
utl_smtp.close_data(conn);
utl_smtp.quit(conn);
end;
Any help is highly appreciated.
Regards
NilsHi Madhu,
Using the default modules PayloadSwapBean and MessageTransformBean you can able to send multiple attachments.
swap.keyName :payload-name or payload-description or content-type, content-description. swap.keyValue: If you have a multiple attachments then give the multiple key value.
Like you have payload name
Attachment1, Attachment2 then
swap.keyName payload-name
swap.keyValue Attachment1, Attachment2
Using the MessageTransformBean you can able to change the file name.
PayloadSwapBean:
[http://help.sap.com/saphelp_nw70/helpdata/EN/2e/bf37423cf7ab04e10000000a1550b0/content.htm]
MessageTransformBean:
[http://help.sap.com/saphelp_nw70/helpdata/EN/57/0b2c4142aef623e10000000a155106/content.htm]
Regards,
Prakasu -
Send a mail with attached file .xls but i got file without
i tried to send a mail with attached file .xls. but i am able to send the file , we recived the file without file name. please do the same
thnaks in advance.
END-OF-SELECTION.
Populate message body text
PERFORM POPULATE_EMAIL_MESSAGE_BODY.
Send file by email as .xls speadsheet
PERFORM SEND_FILE_AS_EMAIL_ATTACHMENT
TABLES IT_MESSAGE
IT_ATTACH
USING P_EMAIL
'Example .xls documnet attachment'
'XLS'
'filename'
CHANGING GD_ERROR
GD_RECIEVER.
Instructs mail send program for SAPCONNECT to send email(rsconn01)
PERFORM INITIATE_MAIL_EXECUTE_PROGRAM.
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
FORM DATA_RETRIEVAL.
SELECT EBELN EBELP AEDAT MATNR
UP TO 10 ROWS
FROM EKPO
INTO TABLE IT_EKPO.
ENDFORM. " DATA_RETRIEVAL
*& Form BUILD_XLS_DATA_TABLE
Build data table for .xls document
FORM BUILD_XLS_DATA_TABLE.
CONSTANTS: CON_CRET TYPE X VALUE '0D', "OK for non Unicode
CON_TAB TYPE X VALUE '09'. "OK for non Unicode
*If you have Unicode check active in program attributes thnen 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 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
INTO IT_ATTACH SEPARATED BY ''.
CONCATENATE '' IT_ATTACH INTO IT_ATTACH.
APPEND IT_ATTACH.
LOOP AT IT_EKPO INTO WA_CHAREKPO.
CONCATENATE WA_CHAREKPO-EBELN WA_CHAREKPO-EBELP
WA_CHAREKPO-AEDAT WA_CHAREKPO-MATNR
INTO IT_ATTACH SEPARATED BY ''.
CONCATENATE '' IT_ATTACH INTO IT_ATTACH.
APPEND IT_ATTACH.
ENDLOOP.
ENDFORM. " BUILD_XLS_DATA_TABLE
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
FORM SEND_FILE_AS_EMAIL_ATTACHMENT TABLES PIT_MESSAGE
PIT_ATTACH
USING P_EMAIL
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_EMAIL.
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[] = PIT_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.
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
Instructs mail send program for SAPCONNECT to send email.
FORM INITIATE_MAIL_EXECUTE_PROGRAM.
WAIT UP TO 2 SECONDS.
SUBMIT RSCONN01 WITH MODE = 'INT'
WITH OUTPUT = 'X'
AND RETURN.
ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
*& Form POPULATE_EMAIL_MESSAGE_BODY
Populate message body text
FORM POPULATE_EMAIL_MESSAGE_BODY.
REFRESH IT_MESSAGE.
IT_MESSAGE = 'Please find attached a list test ekpo records'.
APPEND IT_MESSAGE.
ENDFORM. " POPULATE_EMAIL_MESSAGE_BODYPERFORM SEND_FILE_AS_EMAIL_ATTACHMENT
TABLES IT_MESSAGE
IT_ATTACH
USING P_EMAIL
'Failed IDOC Analysis report'(020)
'xls'(021)
'IDOC_REP'(022)
CHANGING GD_ERROR
GD_RECIEVER.
Instructs mail send program for SAPCONNECT to send email(rsconn01)
PERFORM INITIATE_MAIL_EXECUTE_PROGRAM.
ENDFORM. " F_MAIL
*& Form BUILD_XLS_DATA_TABLE
Build data table for .xls document
FORM BUILD_XLS_DATA_TABLE.
*CONSTANTS: CON_CRET TYPE X VALUE '0D', "OK for non Unicode
*CON_TAB TYPE X VALUE '09'. "OK for non Unicode
*If you have Unicode check active in program attributes thnen 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 text-040 text-041 text-042 text-043 text-044 text-045 text-046 text-047 text-048 text-049
INTO IT_ATTACH SEPARATED BY con_tab.
CONCATENATE con_cret IT_ATTACH INTO IT_ATTACH.
APPEND IT_ATTACH.
clear IT_ATTACH.
loop at i_final_t into w_final.
CONCATENATE
w_final-mestyp w_final-docnum w_final-statxt w_final-msgno w_final-rvplant w_final-kunnr w_final-vbeln w_final-credat
w_final-cretim w_final-flag INTO IT_ATTACH SEPARATED BY con_tab.
CONCATENATE con_cret IT_ATTACH INTO IT_ATTACH.
APPEND IT_ATTACH.
clear IT_attach.
endloop.
ENDFORM. " BUILD_XLS_DATA_TABLE
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
FORM SEND_FILE_AS_EMAIL_ATTACHMENT TABLES PIT_MESSAGE
PIT_ATTACH
USING P_EMAIL
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_EMAIL.
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[] = PIT_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. "SEND_FILE_AS_EMAIL_ATTACHMENT
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
Instructs mail send program for SAPCONNECT to send email.
FORM INITIATE_MAIL_EXECUTE_PROGRAM.
WAIT UP TO 2 SECONDS.
SUBMIT RSCONN01 WITH MODE = 'INT'
WITH OUTPUT = 'X'
AND RETURN.
ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
*& Form POPULATE_EMAIL_MESSAGE_BODY
Populate message body text
FORM POPULATE_EMAIL_MESSAGE_BODY.
data: l1(99) type c,
l2(15) type c,
lt_message type standard table of solisti1,
ls_message like line of lt_message.
clear ls_message.
l1 = 'Dear'(007).
l2 = 'Sir/Madam'(008).
concatenate l1 l2 ',' into
ls_message-line separated by space.
append ls_message to lt_message.
*insert Blank Line
clear ls_message.
ls_message-line = space.
append ls_message to lt_message.
*Assign Message text
clear ls_message.
concatenate text-011
text-012
into ls_message-line separated by space.
append ls_message to lt_message.
*insert Blank Line
clear ls_message.
ls_message-line = space.
append ls_message to lt_message.
*Assign Message text
clear ls_message.
concatenate text-013
text-014
text-015
into ls_message-line separated by space.
append ls_message to lt_message.
concatenate text-016
text-017
into ls_message-line separated by space.
append ls_message to lt_message.
*insert Blank Line
clear ls_message.
ls_message-line = space.
append ls_message to lt_message.
ls_message-line = text-018.
append ls_message to lt_message.
ls_message-line = text-019.
append ls_message to lt_message.
clear: ls_message.
REFRESH IT_MESSAGE.
it_message[] = lt_message[].
APPEND IT_MESSAGE.
ENDFORM. " POPULATE_EMAIL_MESSAGE_BODY -
Regarding mail with attached file
hi experts,
i am doing on a report where mail with attached file should fire everyday at 9am. when i am doing it in background,mail is sent to everyone with attached file but when i schedule it in background,mail is firing but attached file is missing.how can i solve this problem?
thanks.try to place ur file onn application server when u run BC.
Thanks
Kiran -
Can SAP send e-mail to external mail with attached file?
Hi ABAP Guru.
Can SAP send the E-Mail to external mail server? (e.g. Hotmail, Yahoo and so on.)
And Can the E-Mail sent with attached file?
And How to do that?
Please give me your advice.
Thank you and Best Regard,
Nattapash C.Thank you very much! Amit Gujargoud.
And I'm so sorry for my question that not clear for you and everyone.
What I need to know is How to do with ABAP Code.
I found the Function Module
'SO_DOCUMENT_REPOSITORY_MANAGER' with method 'SEND' is being used for my case.
but I don't know what field of structure RECIPIENTS (Table parameter of this Func. Module) that used for define recipient's E-Mail Address.
Does anyone know the field or Have any method to solved my case?
Please give me your advice.
Thank you and Best regard.
Nattapash C. -
Send mail with attached file without using Repository
Hello,
I want to know if have a way to Send mail with attached file without using Repository.
Regards
EladElad,
Check this article where a image has been picked by the file adapter and sent as an attachment to the mail adapter.
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5816">Sending an Image File Through XI in a File-to-Mail Scenario</a>
For how to proceed without integration repository content look into this blog,
<a href="/people/william.li/blog/2006/09/08/how-to-send-any-data-even-binary-through-xi-without-using-the-integration-repository">How to send any data (even binary) through XI, without using the Integration Repository</a>
Combining these 2 you have the solution.
Regards
Bhavesh -
What is the exact problem with this file?
Hi all,
There is an old form , which was not in use from many days.
Now when we tried to run the form, i got the error saying "FRM-40734:Internal Error:Pl/SQL error occured.", in the login form.
When i tried to open the fmb file in Oracle Forms Builder 6i, i got the following error:
FRM-10102: Cannot attach PL/SQL library d2kwutil. This library attachment will be lost if the module is saved., but the fmb file got open.
The login button has the following code:
DECLARE
UNAME VARCHAR2(30);
--USER_ID PARAMLIST;
V_USER APUSERMA.USER_NAME%TYPE;
V_PASSWED APUSERMA.USER_PASSWD%TYPE;
BEGIN
select user_CD INTO :GLOBAL.USER_ID from apuserma
where user_CD = :TI_USER_NAME AND user_PASSWD = :IT_USER_PASSWD
AND SYSDATE BETWEEN USER_VALID_FRM AND USER_VALID_TO;
:global.user_id := substr(win_api_environment.read_registry('HKEY_LOCAL_MACHINE\system\currentcontrolset\control\computername\computername','computername'),1,10);
:global.compname := :compname;
compnm(:compname);
--USER_ID := CREATE_PARAMETER_LIST('USER_id_NAME');
call_form('Forms\MAIN_SCREEN',hide,DO_REPLACE);
exception
when no_data_found then
MESSAGE('Incorrect Username or Password. Please Re-Enter');
message(' ');
RAISE FORM_TRIGGER_FAILURE;
END;
EXIT_FORM;
When i tried to compile, i got error saying ,
Error 201 at line 10, column 28
identifier 'WIN_API_ENVIRONMENT.READ_REGISTRY' must be declared.
I am not getting to know What is the exact problem with this file?
Help me with this please.
Thank You.
Oracle forms builder 6i.
Oracle 9i.Vijetha wrote:
I also want to know what is the use of win_api_environment.read_registry('HKEY_LOCAL_MACHINE\system\currentcontrolset\control\computername\computername','computername') ??
What does it do??
If i comment the following line , will it be a problem??
:global.user_id := substr(win_api_environment.read_registry('HKEY_LOCAL_MACHINE\system\currentcontrolset\control\computername\computername','computername'),1,10);
Because i commented the above line & compiled, so it is not giving any error now.
So please tell me what win_api_environment.read_registry does??
it's read windows registry value. So, no problem if you comment it.
Thanks -
When I attach files to mails (.pdf, .jpg, .docx etc.), they arrive in Windows Outlook embedded. My mail settings are "Always Send Windows-Friendly Attachments" and "Always Insert Attachments at End of Message".
I know how to open these attachments in Windows Outlook but my recipients do not. To suggest that they learn how to, as I have seen in some places, is arrogant. If I apply for a job by email and attach my resume with instructions on how to open it will reduce my chances of getting that job close to zero.
How can I attach files that will be received as files and can be opened by the MS Windows recipient with left mouse clicks?Another way to send files to others is to use Dropbox.
In your email you don't attach the file, but rather include a link that you reciepeints then use to download the file.
I use this method for particularly large files, but it can be used for any file.
Matt
Maybe you are looking for
-
Will ATV play .avi files/films?
Hi, I am thinking of getting rid of my Cisco Kiss 1600 as I am having codec error messages spring up frequently. Does anyone know if ATV will play my library of .avi files that I have? Will I have to convert or import them to iTunes? Any advice aroun
-
Hi, I know this has been queried before - but I can't find any helpful answers. I'm running DW MX 6.1.1842.0, on Vista Business SP1, and the Insert Table button/menu commands do not work. I have uninstalled/rebooted/installed to new folder, and still
-
'Classic' RFC library - password limited for rfc calls ?
Hi , we are using the 'classic' RFC library to connect to SAP for calling RFC function modules. Due to the fact that there are often older SAP systems involed, we use only passwords with 8 digits. But now we have the requirement to use passwords fo
-
Hi I want to print the user name in the report. How can I ? Here username is the one which i am using to login into apex. Thanks Nav. Edited by: user13129164 on May 18, 2010 11:53 PM
-
Querying RESOURCE_VIEW using /Resource/XMLRef as key
Hi: I am trying to query resource_view efficiently but instead of using equals_path or under_path which uses the domain index XDB.XDBHI_IDX using /Resource/XMLRef column. For example, for a resource stored in a object relational table with a register