Send file as attachment
Hi,
I recently switch from a complete Windows envrionment to a Mac one. I use a MacBook air with Mac OS X Lion.
I recently installed Office for Mac 2011 to use Outlook 2011 with my Exchange. I changed the setting in the Mail app and Outlook to use my Outlook as default mail client.
There's still something I need to correct. When I "right-click" a file and select send file as attachment, it opens the Mail App to send it. I don't know how to completely switch to Outlook. I don't care about not using mail app at all.
I've tried a couple of things, like deleting com.apple.LaunchServices.plist but I still have the same issue.
Any suggestions ?
Thanks
That service is hard-coded to Mail and can't be changed through any user setting. Try this workaround:
http://www.officeformachelp.com/2010/11/create-a-service-to-attach-files-to-a-ne w-outlook-for-mac-mail-message/
If Library in Automator does not list Microsoft Outlook, the "Create New Outlook Mail Message" action should be listed in the second pane (along with all the other Microsoft application actions).
Regards.
Similar Messages
-
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. -
Converting Sender File as attachment using PayloadSwapBean module
Hi Expert,
I have a scenario where I have to pick up a file from PI & send it to another PI server as an attachement using XI Adapter.
I went through SDN & found several messages describing configuration for attachement for mail & SOAP adapter.
I attached PayloadSwapBean in my sender File channel & passed keyname as Conent-Disposition & keyValue as attachment however I dont see file being converted as an attachment in SXMB_MONI. It still shows it as main payload.
Please help me on how to convert a sender file payload into attachement. I would like to keep attachment name same as file name. Let me know how we can do that. I also noticed that on receiver XI adapter (which I would be using to send data to next PI system), you can't attach modules. Let me know if there is some other standard way of achieving this requirement.
Thanks
Regards
SushilHi Stefan,
No, I dont see dynamic configuration values in second PI system. I am able to see them in first system.
Hi Amol,
Do you see dynamic configuration in second PI? I am still referring ASMA in second PI system as file parameters? Should it be HTTP header? (How are you referring ASMA in second PI). Below is my code which give me null at run time.
DynamicConfiguration dCon =(DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey dKey = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","Directory");
String FileDirectory = dCon.get(dKey);
return FileDirectory; -
Send files as attachment with BCS-methods
Hi,
I want to load file(s) from application server
and send it as attachment per mail.
In 4.6c I had a program with fm 'SO_DOCUMENT_SEND_API1'
that worked fine. But not any longer in 7.01.
So i tried it with the new method of BCS*
But it worked not fully correct.
German mutations are not correct.
and e.g. in excel ther is a message "too many columns" although there're only 130 col.
In 4.6 I opend the data file(s) in binary mode and saved it to solix
Which addition I must choose to the open-command?
And what I have to note by the converting method cl_bcs_convert=>string_to_solix?
Do you know a sample program to my problem ?
In BCS_EXAMPLE* I did not found anyone
thanks
Andreas
Edited by: Andreas Mann on Oct 25, 2011 4:22 PMI do have sample code
sending email with attachment using BCS,
i can only post it by thursday,
currently refer this.. i will post sample code later
DATA lt_message TYPE bcsy_text.
DATA lv_mail_title TYPE so_obj_des.
DATA document TYPE REF TO cl_document_bcs.
DATA recipient TYPE REF TO if_recipient_bcs.
DATA send_request TYPE REF TO cl_bcs.
DATA sent_to_all TYPE os_boolean.
DATA bcs_execption TYPE REF TO cx_bcs.
DATA email_id TYPE ADR6-SMTP_ADDR
send_request = cl_bcs=>create_persistent( ).
*Create Title
CONCATENATE 'Mail Subject' '-' 'xxx'
INTO lv_mail_title RESPECTING BLANKS.
*Create Message(EMAIL Body)
APPEND '<p>Dear Sir/Madam</p>' TO lt_message.
APPEND '<p>The Message body.......</p>' TO lt_message.
APPEND '<br>' TO lt_message.
*Create Document
document = cl_document_bcs=>create_document(
i_type = 'HTM'
i_text = message_body
i_subject = subject ).
*Add Attachement
document->add_attachment(..
...). "Check this method
*Add document to email
send_request->set_document( document ).
recipient = cl_cam_address_bcs=>create_internet_address(
i_address_string = email_id ).
*add recipients to send request
send_request->add_recipient( i_recipient = recipient ).
sent_to_all = send_request->send(
i_with_error_screen = 'X' ).
COMMIT WORK.
IF sent_to_all = 'X'.
MESSAGE s398(00) WITH 'Message Sent Succesfully'.
RETURN.
ENDIF.
thanks & regards,
suji -
Finder: Right Click to send file as attachment of new thunderbird email
Hi,
I am working with Thunderbird.
To open Thunderbird from the Terminal with a new message and an attachment, I have to write in Terminal:
/Applications/Thunderbird.app/Contents/MacOS/thunderbird-bin -compose attachment='/Users/JoergMeier/Documents/2010/OpenOfficeHilfeInhaltsVerzeichnis. pdf'
Now I would like to add an action to the context menu, to use in finder, to send the marked file as attachment of a new thunderbird email.
How can I do this?
Automator?
Thx
JoergThat service is hard-coded to Mail and can't be changed through any user setting. Try this workaround:
http://www.officeformachelp.com/2010/11/create-a-service-to-attach-files-to-a-ne w-outlook-for-mac-mail-message/
If Library in Automator does not list Microsoft Outlook, the "Create New Outlook Mail Message" action should be listed in the second pane (along with all the other Microsoft application actions).
Regards. -
FTP Sender - file as attachment
Hi all,
I need to build a scenario where I have two files that needs to be picked up from ftp location.
One file needs to be attached as binary document to the second file (xml).
How can I achieve this?
We are using SAP PI 7.31.
Thanks in advance!Hi Tim,
Option1: You can consider the files as single zip file and then use payloadzipbean to unzip them in sender file adapter.
Option2: You can write an adapter module with similar functionality of "Specifying Additional Files"
Regards,
Praveen Gujjeti -
How to send file as attachment in Email in Oracle UCM
Hi All,
I have created a simple html form which executes my custom service( internally calls java method) to send a email "forms data" to the user. I need to send file as attchment in email so how i can do it in oracle ucm.Currently i am using intradoc api.I am using a jquery plugin for sending forms data including uploaded file.
function which i am using in java for sending emails:-
InternetFunctions.sendMailTo(emailStr, "MyMail", subject, this.m_service);
I have set method="post" and enctype="multipart/form-data" in the form
So plz help to provide a solution to send a file as attchment in email
Thanks,
user9018217From what I remember, there isn't an "out of the box" solution since InternetFunctions only provides some basic email functions (try decompiling the class to see what's available).
Here's the link for the original Stellent 10gR3 sample components: http://www.oracle.com/technetwork/middleware/content-management/index-092832.html. Take a look at the AcmeMail component within the HowTo Components sample. It shows how to create a custom idcservice that sends basic emails. You can use that as a baseline for creating your own email service and then use something like JavaMail to implement attachments. That's what I did.
Good luck, and please award points as necessary. -
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 file as attachment and call RFC to trigger event in ECC?
Hello,
A file is retrieved from FTP into PI (w/ NO MAPPING required - just pass through) and placed on the ECC appl. Server. Then, a RFC is made to trigger an event to process the file in ECC. However, a RFC cannot be called in the graphical mapping if there is no mapping required.
I have seen this Blog, u201CFile to R/3 via ABAP Proxyu201D, http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/1847. [original link is broken] [original link is broken] [original link is broken] But we are told not to touch the file as it will be converted in ECC by a program.
Also, I read that using ABAP proxy-PI-FTP, I can do a pseudo mapping, simple one node, (just so a RFC can be triggered) and also pass the file as an attachment. Letu2019s say this works:
Question 1: What configuration steps in the FTP adapter that will allow me to u201Calsou201D send the file as an attachment?
Question 2: (Continue with ABAP proxy option) How do I control where will it be deposited so that the program can access it?
Question 3: If this is not the best approach, how many steps would I need to do it in BPM (i.e. pick up the file from FTP, place it on appl server, and trigger a RFC to call an event to process file)?
Thanks for any suggestions!
John_XiI have read those two help file and was able to use it in the ABAP proxy code. Thanks.
This is the current outcome. I totally understand that SAP PI communicates via XML. So when PI picks up a file that contains XML tags, the Inbound proxy is triggered. I can see its processing in SM50. However, when I give the Sender FTP adapter a non-XML file to pick up, the Inbound Proxy does not trigger. The file itself should be read into memory so that I can save it to the application server via ABAP code (with no mapping). That is why there is no operation mapping
The reason I am using using FTP to ABAP proxy is because I need to call a subsequent RFC step to process the file. Else, I will just use FTP to File Adapter scenario.
Question 1: I am thinking that that file is the attachment. Is that where I am incorrect and I still need to send in an XML file with the attachment as an addition?
Question 2: Is this the best approach or should I use BPM? If BPM, what steps do I need? -
Regarding sending Email as attachment
Hi guys.
One unique issue.
I meed to send a file as an attachment to one perticular address. Got to knowt that some function module like So_attmail would work. But that sends the content as body of the mail. But i want the file to be sent as attachment. Could someone help me this plz.
If possible also let me know what are the parameters that i need to pass in short.
Thanks in advance.
Abhi.Hi Abhi,
Have a look at this example:
http://www.sap-img.com/abap/sending-email-with-attachment.htm
http://www.sap-img.com/abap/sending-mail-with-attachment-report-in-background.htm
http://www.sap-img.com/fu016.htm
1. We can send files with attachment.
However, 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
<b>PS : Reward points if helpful</b>
Thanks,
Ramya. -
Help regd in sending mails with attachment
Hi All,
I have a requirement to send mails with attachements.The attachments can be simple word , excel anything. Please help.Is there a way I can send these from workflows also?hi use this , this is one of the best examples for sending mail ....
1. We can send files with attachment.
However, 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,
venkat. -
Not able to send pdf file as attachment in my apple mail.
Hi, I was easily able to attach pdf files to my apple mail. infact I could just open a pdf file and then send it as attachment in the email earlier. but after downloading and upgrading to os X Mountain lion, I am neither being able to attach and send pdf files in my apple mail, nor can I send PDF file as an attachment.
Is there any issue with OS X Mountain Lion.
Issue 1. I compose Email , then click attach > Browse > select pdf file > click attach > it shows in my Email body either as an icon or as first page of the pdf document > I send it. >>> But when the receipient opens the Email, that pdf attachment is missing. In fact When I put a cc to my self and I open the Email, the attachment is mssing in the incoming E amil.
Issue 2. I open the PDF document > Click on File > send as attachment in E-Mail > on right, a menu appears where I select the File and click attach> I get a message
The SendMail doesnot know how to talk to your default mail client. Please select a different mail application to use. Attaching a screen shot.
I never had these issues earlier with my Lion OS . but since the time I have upgraded to mountain Lion OS, I am having these issues.
Are these the Mountain Lion issues, how to fix these please.I believe, the software team forgot to put a button for send or share as an attachment to preview.
-
Sending PDF file as Attachment
Hello Guys,
My requirement is to send an PDF attachment which could have content in any of four languages( English,spanish,German or french).
I am planning to use Function Module SO_NEW_DOCUMENT_SEND_API1 to send Email.
Please let me know if it is possible to achieve this without using smartforms.
If yes, how ?
if no, how to achieve this using smartform.
Appreciate your help in advance.
Regards,
HemaHi,
Yes But you can use ADOBE FORMS for that... Check this link for presentation...
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c0c139d3-3eae-2910-01a1-d253f2587b0e?prtmode=navigate
Check this BLOG for sending Email through ABAP..
Sending E-Mail from ABAP - Version 610 and Higher - BCS Interface
One more thing... You can download your data to a PDF file and send that PDF file via program...
Search this Forum for more answers.. you would get plenty out of it...
Check this thread for further information..
Sending mail with 2 attachments
Hope this would help you.
Any queries plz revert back
Good luck
Narin -
.pdf file changed into .tmp when trying to send pdf file as attachment
Dears,
A few days now, .pdf files are exported as .tmp files if we try to send them as attachment directly from the adobe reader plug-in in internet explorer 8.
Unfortunatly Outlook interprets .tmp files as harmfull, so we are no longer able to send pdf files directly.
(screenshot in attachment)
Is there any chance we can configure this so, pdf files are exported as .pdf instead of .tmp
More details:
OS : Win XP SP3
browser : ie 8
plug in : Adobe PDF Link Helper (not sure this is the one that provides us the pdf reader functionallity dough)I cannot reproduce that (Adobe Reader 11.0.3, IE8, Win XP-SP3). In fact, I cannot even see the Attach to Email option, but the file name is correct.
-
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.
Maybe you are looking for
-
How to check connection from SAP to reservation system?
Dear Experts, May I know how to check whether the connection between SAP and the reservation system has been set up and ready to use? Thanks.
-
10.6.8 Macbook Pro firmware update problem
I installed a couple of updates for my MBP 10.6.8. One was Safari, the other was brand new, released within the last week, I think it was a firmware update, and now the machine will not boot into OSX. I have a Bootcamp Windows 7 partition that star
-
How to Create a Dimension Table in OBIEE11g
Hello, Chapter 9, page 221(if pdf) of the Build Repository manual of OBIEE 11g explains following. Creating Dimensions in Level-Based Hierarchies After creating a dimension, each dimension can be associated with attributes (columns) from one or more
-
Bex analyzer connection problem
hello i have a problem when i want to connect from excel with the bex add-on to the application server. i geht the following error: RFC_ERROR_COMMUNICATION Nachricht CMALLC : rc=20 > Connect from SAP gateway to RFC server failed Connect_PM GWHOST=ex
-
-24994 runtime environment error while starting MAXDB J2E instance
Hello, I have a SAPDB installation on my Windows XP machine that came along with SAP WAS 640 SP12. I was trying to explore the dbmcli commands basically to shrink the log files. Its strange but when I went to SAPMMC and checked the database, it went