Send a file attached to a mail send with sendmail
Hello,
I'd like to send a report with a short mail to a mailing list. This task will be done every day by executing a ksh script.
May I do it with sendmail ? how ?
Is there another way to do it ?
Thanks for your help.
Ncg
Sorry,
question already posted on kernel Forum: "Command line mail - attachment"
Similar Messages
-
How to determine the size of a flat file attachment in a mail sender cc?
Hi
I use PI 7.11
I have a scenario where a flat file attachment is being picked up by a MailSender adapter and if the size of the attached flat file is larger that 500 bytes the receiver is A and if the attachment is less that 500 bytes the receiver is B.
I have checked the Context Object list in the Conditions section of Receiver Determination, and it seems, that only the file adapter allows for validation on the file size.
I contemplated an extended receiver determination but the attachment is a flat file which just needs to be passed thru without being converted to an XML document, so my source document is not of XML format.
An other but not very nice way would be to use an intermediate folder to drop the attachment in and from there use a file sender adapter and thus get access to the filesize attribute in my receiver determination, but I would like to avoid this.
Any suggestions?
BR MIkaelHi
I have decided to make a module, where I plan to place the size of the attachment in the Dynamic Configuration variable "ProcessStep", but to my surprise, it seems that all the context objects in the receiver determination condition section are of type String and hence it is not possible to make a condition where I test for whether the value is smaller than say 500!? Only equal, NOT equal and LIKE are available (EX seems to be disabled as this probably only works in an xpath.
Would one way be to use the xpath expression like this ns1:Main\ProcessStep < 500 where ns1: http://sap.com/xi/XI/System?
MIkael -
To Send HTML Format and excel file attachment in same mail
Dear All,
Have requerment ,to send a mail options HTML table format and same data in excel file attachement.have capable to do the html format using methods BCS .but how to send excel format attachment in same mail.
Please guide me how to do it.
Regards ,
Santhu
Edited by: santosh jajur on Apr 9, 2010 1:54 PMSanthosh,
please check the code:
report bcs_example_7.
This report provides an example for sending an Excel
attachment in Unicode Systems
constants:
gc_tab type c value cl_bcs_convert=>gc_tab,
gc_crlf type c value cl_bcs_convert=>gc_crlf.
parameters:
mailto type ad_smtpadr
default 'ur mail id'. "#EC *
data send_request type ref to cl_bcs.
data document type ref to cl_document_bcs.
data recipient type ref to if_recipient_bcs.
data bcs_exception type ref to cx_bcs.
data main_text type bcsy_text.
data binary_content type solix_tab.
data size type so_obj_len.
data sent_to_all type os_boolean.
start-of-selection.
perform create_content.
perform send.
form send.
try.
send_request = cl_bcs=>create_persistent( ).
create document object from internal table with text
append 'Hello world!' to main_text. "#EC NOTEXT
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = main_text
i_subject = 'Test Created By BCS_EXAMPLE_7' ). "#EC NOTEXT
add the spread sheet as attachment to document object
document->add_attachment(
i_attachment_type = 'xls' "#EC NOTEXT
i_attachment_subject = 'ExampleSpreadSheet' "#EC NOTEXT
i_attachment_size = size
i_att_content_hex = binary_content ).
add document object to send request
send_request->set_document( document ).
--------- add recipient (e-mail address) -----------------------
create recipient object
recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
add recipient object to send request
send_request->add_recipient( recipient ).
---------- send document ---------------------------------------
sent_to_all = send_request->send( i_with_error_screen = 'X' ).
commit work.
if sent_to_all is initial.
message i500(sbcoms) with mailto.
else.
message s022(so).
endif.
endtry.
endform. "send
form create_content.
data lv_string type string.
data ls_t100 type t100.
columns are separated by TAB and each line ends with CRLF
concatenate 'This Is Just Example Text!' "#EC NOTEXT
gc_crlf gc_crlf
into lv_string.
header line
concatenate lv_string
'MSGID' gc_tab
'MSGNO' gc_tab
'Language' gc_tab "#EC NOTEXT
'Text' gc_crlf "#EC NOTEXT
into lv_string.
data lines
select * from t100 into ls_t100
where arbgb = 'SO' and msgnr = '182'.
concatenate lv_string
ls_t100-arbgb gc_tab
ls_t100-msgnr gc_tab
ls_t100-sprsl gc_tab
ls_t100-text gc_crlf
into lv_string.
endselect.
select * from t100 into ls_t100
where arbgb = 'SO' and msgnr = '316'.
concatenate lv_string
ls_t100-arbgb gc_tab
ls_t100-msgnr gc_tab
ls_t100-sprsl gc_tab
ls_t100-text gc_crlf
into lv_string.
endselect.
try.
cl_bcs_convert=>string_to_solix(
exporting
iv_string = lv_string
iv_codepage = '4103' "suitable for MS Excel, leave empty
iv_add_bom = 'X' "for other doc types
importing
et_solix = binary_content
ev_size = size ).
catch cx_bcs.
message e445(so).
endtry.
endform. "create_content
Thanks. -
How to send material jpg attachment from R3 to FTP with XI
Hi All,
I wantto send material JPG attachment from R3 to FTP with XI 3.0. Is there a way ?
Thanks.Check these two blogs:
/people/michal.krawczyk2/blog/2006/04/19/xi-rfc-or-abap-proxy-abap-proxies-with-attachments
http://sapient.xi.googlepages.com/xi-excellentintegration
Regards,
Abhishek. -
Signatures disappear when sending file attachment in iPad Mail
Whenever I send an attachment from GoodReader or Pages the file appears at the bottom of the message and my default signature disappears. How can I send files with a signature?
Hi,
Attachment Content is not Mandatory to enter unless you wish to override the Attachment Property.
Basically we use this content along with Encoded Image Property like chart, spc and image loader action block.
If you are loading file from system using Proper path in Attachment Section then no need to use Attachment Content section.
Ensure that you have set the Attachment Content Type to "application/pdf" to send pdf files and a valid File path in Attachment section.
Hope this helps!!
Regards,
Adarsh -
I downloaded the app "Chess score pad". It was supposed to send an email with a PGN attachement to me, but it didn't worked. it only sends the text but not the attachement. I can send other type of files like photos, audio and videos. Why can't I send PGN files? Help please!
I have already contacted the creator and we have already proved that the problem is with my iPhone only. What can I do? (The app works with other iPhones and iPads.)Chrisj4203, thank you for your kind answer.
I have done a lot of restores to the Iphone, and resets also.
I;ve done holding both buttons as you sugested, but there is no signal appearing.
I am in Uruguay, South America and the original company is Movistar ( Telefonica) and the new sim card is from ANTEL ( the officail and biggest company in my country).
I don;t knoe what todo.
I have been trying for more than one mont.
I have gone several times to both companies. Aldo two times to Apple uruguay, and nobody can help me. -
Sending text files as attachments in mails
Hi Experts,
I want to send some content in a text file as an attachment in the mail. Can anybody provide me the sample code for this.
points guaranteed.
thanks
sanakrHI
Check this one
first create a Include report with the following coding
*& Include ZPA1_INCLFOR_MAIL *
* 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
Then include that report in the following report and copy the same code and paste it there
*& Report ZPA_TEMP147 *
REPORT ZPA_TEMP147 .
INCLUDE zpa1_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
Pavan -
Send multiple files in separate e-mails
Hello!
I want to send multiple files from finder in separate e-mails, but I can't find a way to do this in Mavericks and Apple mail (or gmail). In windows XP it was simple as Send to/Mail recipient. Is there an option similar to this is MacOSX?
Thnx,
Gas#Eric
Of course that would work, but it is tiresome to do for every file (open-attach-write subject-insert recipients-send), and that is exactly what I would like to avoid.
#Csound
My Mail works fine, but I use gmail webmail usually. Now that I changed the preferences, so Mail is the default it works with the shortcut menu :-)
But, when I select more files, it attaches them to one e-mail, and not per/file. Is it possible to split them to different mails so they can be sent individually?
Thanks. -
Want to send PDF as attachement using Java Mail
HI,
I am using Java mail API for sending PDF as attachment. Here is my sample code
messageBodyPart = new MimeBodyPart();
messageBodyPart.setDataHandler(new DataHandler("String data for PDF using iText", "text/plain" ));
I am generating String for PDF file using iTEXT but I am unable to find out mimetype for passing into DataHandler as second paramete.
Any idea?
Thanks
ShaileshDon't convert the data to String. It isn't text so
you'll damage the binary content by doing that. In
the "demos" directory of your JavaMail download
you'll find a ByteArrayDataSource class you can use
instead of a FileDataSource. Yes, this worked for me. I create the pdf in memory as as StringBuffer and I just changed the code from
messageBodyPart.setDataHandler(new DataHandler(pdf.toString(), "application/pdf"));
to
messageBodyPart.setDataHandler(new DataHandler(new ByteArrayDataSource(pdf.toString(), "application/pdf")));
and it worked.
Thanks a lot for your help,
Dennis -
Sending PDF output attachment in e-mail to external users from BSP
Hi All,
Please gothrough the below requirement details :
Requirement Details:
Need to achieve the functionality of sending a PDF attachment of invoice to an external
e-mail address from the BSP Application.
Implementation Details:
The Print out Output determination is already done in the system. We are using SAP R/3 4.7 (620)
In the Transaction VF03 in the initial screen there is a menubar "Billing document" and underneath that menu there is a menu item called "Issue". If we click the "Issue" menu item all the output that are already proposed will be visible and we can select the printout Output determination and can issue a printout.
I had created a FM to call from BSP and that function module will take the Invoice number as input and will call the "VF03" transaction using BDC and will trigger the Sapscript Printout . I see the the sapscript in the spool after I call the Function module .
But I don't know how I can get the Spool request number for that Function module call from BSP page ????
I got struck in this approach...
If I know the Spool number after calling the function module the it's very easy to call the following FM's for sending a e-mail with the Invoice PDF attachment.
CONVERT_OTFSPOOLJOB_2_PDF
QCE1_CONVERT
SO_NEW_DOCUMENT_ATT_SEND_API1
Please let me know if anyone can help me in this ...
Please reply ASAP.
Thanks,
GreetsonCheck out these weblogs.
/people/sap.user72/blog/2004/11/10/bsphowto-generate-pdf-output-from-a-bsp
/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
Regards
Raja -
Workitem in attachment of outlook mail sending from mail step in workflow
Hi Expert,
Presently i am sending a mail to approver of PO to external ID to inform that he has received a workitem in SAP in Box please login into SAP system and Approve the PO....
But now requirment has changed .
They need this workitem in attachment of the mail i am sending to approver. approver click on that attachment it automaticly direct to sap system to the transaction ME21N to approve PO.
Please guide to achive the new requirment..
Deepanker DwivediThere are two ways of doing this stuff...if you are running on WAS 6.4 or above then use second one.
First method:-
Schedule the program RSWUWFML2 as per your requirement. This will route the workitem links to the external mail id like outlook from user can log into sap and approve or reject the workitem.The SCOT should be configured to send and recieve external mails.
Second Method:-
U can use extended notifications for approving the workiten from the outlook or any other extrenal mail id.
The basic configuration required is expalined in these two links
[http://help.sap.com/saphelp_erp2005vp/helpdata/en/d5/581ee8d56f1247bf34cfcd66d16d81/frameset.htm|
[/people/saujanya.gn/blog/2006/12/19/how-to-get-work-items-your-outlook-inbox ]
Please revert back if you require further inputs. -
Error during sending a PDF attachment of a mail
Hi everebody,
I'm using a custom program [ see below ] ( in which there is the call to the std function SO_DOCUMENT_SEND_API1) to send a PDF attachment to an user's SAPOFFICE: in release 4.6C it works correctly but the same programm in ECC6 it doesn't work correctly. I mean: the mail is sent correctly with the attachment, but when I try to open the attachment this one doesn't open correctly showing a PDF error message.
Any help?
gino bonfiglioli
*& Report Z_UT_CONVERT_SPOOL_PDF
REPORT z_ut_convert_spool_pdf.
TABLES: tsp01.
variabili globali
*data: fm_name type rs38l_fnam,
output_options type ssfcompop,
control_parameters type ssfctrlop,
job_output_info type ssfcrescl,
job_output_options type ssfcresop,
DATA: spoolno LIKE tsp01-rqident,
dir_pdf LIKE rlgrap-filename,
numbytes TYPE i,
pagecount TYPE i,
w_cnt TYPE i,
wk_subrc LIKE sy-subrc,
pdfspoolid LIKE tsp01-rqident,
gd_buffer TYPE string,
pdf LIKE tline OCCURS 100 WITH HEADER LINE,
stampante LIKE usr01-spld,
tot_line TYPE sy-tabix,
tot_line2 TYPE sy-tabix,
start_line TYPE sy-tabix.
tabelle interne per 1a mail
DATA: BEGIN OF it_email OCCURS 100.
INCLUDE STRUCTURE solisti1.
DATA: END OF it_email.
DATA: BEGIN OF email_data.
INCLUDE STRUCTURE sodocchgi1.
DATA: END OF email_data.
DATA: BEGIN OF email_send OCCURS 10.
INCLUDE STRUCTURE somlreci1.
DATA: END OF email_send.
DATA: packing_list TYPE STANDARD TABLE OF sopcklsti1 WITH HEADER LINE,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
receivers TYPE STANDARD TABLE OF somlreci1 WITH HEADER LINE.
fine tabelle interne per 1a mail
PARAMETER: p_spool LIKE tsp01-rqident.
START-OF-SELECTION.
PERFORM conversione_spool_pdf USING wk_subrc.
IF wk_subrc EQ 0.
PERFORM invio_mail.
ENDIF.
*& Form CONVERSIONE_SPOOL_PDF
text
-->P_P_SUBRC text
FORM conversione_spool_pdf USING p_subrc.
**- Conversione in PDF
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = p_spool
no_dialog = ' '
DST_DEVICE =
PDF_DESTINATION =
IMPORTING
pdf_bytecount = numbytes
pdf_spoolid = pdfspoolid
otf_pagecount = pagecount
btc_jobname = jobname
btc_jobcount = jobcount
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_dstdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11.
p_subrc = sy-subrc.
ENDFORM. " CONVERSIONE_SPOOL_PDF
*& Form invio_mail
text
--> p1 text
<-- p2 text
FORM invio_mail .
Transfer the 132-long strings to 255-long strings
LOOP AT pdf.
TRANSLATE pdf USING ' ~'.
CONCATENATE gd_buffer pdf INTO gd_buffer.
ENDLOOP.
TRANSLATE gd_buffer USING '~ '.
DO.
it_mess_att = gd_buffer.
APPEND it_mess_att.
SHIFT gd_buffer LEFT BY 255 PLACES.
IF gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
Testo della mail
CLEAR it_email. REFRESH it_email.
it_email-line = 'Testo della mail'.
APPEND it_email.
Creazione messaggio
email_data-obj_name = 'MESSAGE'.
email_data-obj_descr = 'Conversione spool n.'.
email_data-obj_descr+26 = p_spool.
email_data-obj_langu = 'I'.
email_data-sensitivty = 'F'.
READ TABLE it_mess_att INDEX w_cnt.
email_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_mess_att ).
start_line = 1.
DESCRIBE TABLE it_email LINES tot_line.
packing_list-transf_bin = ' '.
packing_list-doc_type = 'RAW'.
packing_list-head_start = 1.
packing_list-head_num = 0.
packing_list-body_start = 1.
packing_list-body_num = tot_line.
packing_list-obj_langu = sy-langu.
APPEND packing_list.
APPEND LINES OF it_mess_att TO it_email.
CLEAR packing_list.
Riga iniziale = ultima riga messaggio precedente + 1
start_line = tot_line + 1.
DESCRIBE TABLE it_mess_att LINES tot_line.
packing_list-transf_bin = 'X'.
packing_list-head_start = 1.
packing_list-head_num = 1.
packing_list-body_start = 1.
DESCRIBE TABLE it_mess_att LINES packing_list-body_num.
packing_list-doc_type = 'PDF'.
packing_list-obj_descr = 'Allegato PDF.'.
packing_list-doc_size = packing_list-body_num * 255.
packing_list-obj_langu = sy-langu.
APPEND packing_list.
destinatario interno a SAP
receivers-receiver = sy-uname.
receivers-rec_type = 'B'.
receivers-express = 'X'.
APPEND receivers.
destinatario esterno a SAP: deve essere un idirizzo email:
receivers-receiver = '[email protected]'.
receivers-rec_type = 'U'.
APPEND receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = email_data
put_in_outbox = 'X'
SENDER_ADDRESS = SY-UNAME
sender_address_type = 'B'
COMMIT_WORK = 'X'
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
SENDER_ID =
TABLES
packing_list = packing_list
contents_bin = it_mess_att
contents_txt = it_email
receivers = receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
errore invio mail
ENDIF.Hi,
Try to use fm 'SO_NEW_DOCUMENT_ATT_SEND_API1' instead of SO_DOCUMENT_SEND_API1.
Please check documentation of fm SO_DOCUMENT_SEND_API1 in ECC 6.
a® -
Sending an Excel Attachment in E-mail, where linesize 255 characters
Hi,
I have a requirement where I need to send an Excel attachment of around 150 columns and the line-size is around 2000 characters.
I was planning to use SO_DOCUMENT_SEND_API1.
But, it appears that because of the restriction of 255 characters as SOLISTI1 structure has the field size of 255 characters.
Please note, I cannot use any of the OLE or foreground Excel functions, as the job runs in the background.
Please let me know if you have any solutions or work around.
Hoiping to hear from all of the experts out there.
Regards,
Anitry to use the following classes :
send_request TYPE REF TO cl_bcs,
document TYPE REF TO cl_document_bcs,
conlengths TYPE so_obj_len,
html TYPE STANDARD TABLE OF w3html,
sender_id TYPE REF TO if_sender_bcs,
recipient TYPE REF TO if_recipient_bcs,
sent_to_all TYPE os_boolean,
bcs_exception TYPE REF TO cx_bcs,
bcs_message TYPE string. -
Text File Attachment in SAP Mail ECC 6.0
Hi,
Is it possible to use a text format 'TXT' on the Function Module "O_NEW_DOCUMENT_ATT_SEND_API1" in ECC 6.0? Because I've seen alot of examples in the forum that are using 'XLS' Format attachments.
I made a program that have been attaching text fomat file in the SAP mail. It is working fine in other SAP boxes but in our current box, as I tested it, opening the text attachment, the result is a file text now contained a long string (max1022 char) instead of a file that is tab-delimited. What would you suggest on this?yes u can attach txt file.refer to the code below!
data: itcpo like itcpo,
tab_lines like sy-tabix.
Variables for EMAIL functionality
data: maildata like sodocchgi1.
data: mailpack like sopcklsti1 occurs 2 with header line.
data: mailhead like solisti1 occurs 1 with header line.
data: mailbin like solisti1 occurs 10 with header line.
data: mailtxt like solisti1 occurs 10 with header line.
data: mailrec like somlrec90 occurs 0 with header line.
data: solisti1 like solisti1 occurs 0 with header line.
perform send_form_via_email.
FORM SEND_FORM_VIA_EMAIL *
form send_form_via_email.
clear: maildata, mailtxt, mailbin, mailpack, mailhead, mailrec.
refresh: mailtxt, mailbin, mailpack, mailhead, mailrec.
Creation of the document to be sent File Name
maildata-obj_name = 'TEST'.
Mail Subject
maildata-obj_descr = 'Subject'.
Mail Contents
mailtxt-line = 'Here is your file'.
append mailtxt.
Prepare Packing List
perform prepare_packing_list.
Set recipient - email address here!!!
mailrec-receiver = [email protected]'.
mailrec-rec_type = 'U'.
append mailrec.
Sending the document
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = maildata
put_in_outbox = ' '
tables
packing_list = mailpack
object_header = mailhead
contents_bin = mailbin
contents_txt = mailtxt
receivers = mailrec
exceptions
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
others = 99.
endform.
Form PREPARE_PACKING_LIST
form prepare_packing_list.
clear: mailpack, mailbin, mailhead.
refresh: mailpack, mailbin, mailhead.
describe table mailtxt lines tab_lines.
read table mailtxt index tab_lines.
maildata-doc_size = ( tab_lines - 1 ) * 255 + strlen( mailtxt ).
Creation of the entry for the compressed document
clear mailpack-transf_bin.
mailpack-head_start = 1.
mailpack-head_num = 0.
mailpack-body_start = 1.
mailpack-body_num = tab_lines.
mailpack-doc_type = 'RAW'.
append mailpack.
mailhead = 'TEST.TXT'.
append mailhead.
File 1
mailbin = 'This is file 1'.
append mailbin.
describe table mailbin lines tab_lines.
mailpack-transf_bin = 'X'.
mailpack-head_start = 1.
mailpack-head_num = 1.
mailpack-body_start = 1.
mailpack-body_num = tab_lines.
mailpack-doc_type = 'TXT'.
mailpack-obj_name = 'TEST1'.
mailpack-obj_descr = 'Subject'.
mailpack-doc_size = tab_lines * 255.
append mailpack.
*File 2
mailbin = 'This is file 2'.
append mailbin.
data: start type i.
data: end type i.
start = tab_lines + 1.
describe table mailbin lines end.
mailpack-transf_bin = 'X'.
mailpack-head_start = 1.
mailpack-head_num = 1.
mailpack-body_start = start.
mailpack-body_num = end.
mailpack-doc_type = 'TXT'.
mailpack-obj_name = 'TEST2'.
mailpack-obj_descr = 'Subject'.
mailpack-doc_size = tab_lines * 255.
append mailpack.
endform.
regards,
madhu -
Can't open a pdf file attachement to e-mail
I canot open an e-mail pdf file attachment..I get a message
You have chosen to open Invoice---pdf
which is: Firefox HTML Document (479kB)
What should Thunderbird do with this file?
Open with Firefox (default)
I do all of the above but nothing happens and I keep getting the same message over andf over again??
Please advise what I should do
ThanksdThanks. I disabled Protected Mode, and I was able to open the pdf attachment. Just to make sure, I enabled it and then disabled it again, and when I tried to open the attachment, it did as before – Adobe Reader (Not Responding) and Internal Error message. Tried it several more times, (enable and then disable Protected Mode) and each time, Adobe Reader wouldn’t launch (Not Responding, Internal Error).
Morris Davidson
Maybe you are looking for
-
EDI IDoc Segment Filtering Transactions
Hi All, Is there any transaction for EDI IDoc segment filtering where partner profile is set up with partner type as 'customer' or 'vendor' (and not partner type as 'logical system' where ALE IDoc segment filtering transactions BD59 & BD64 can be use
-
SQL 2005 and Database Refreshes
We have 2 NW2004S systems both with ABAP+Java. When we copy one database over from one system (A) to another (B), we've noticed that the schema attached to all of the tables in on the B system are now A. Using the SQL Tools application from SAP, we w
-
Can't install Oracle Test Manager
Hi, I'm trying to install Oracle Test Manager and I have got an error message on XE installation step: "installation of OracleXE failed." The first line of log file says : "OXE_Detect: No OATS installed version found. Detecting external OXE version.
-
Protecting long text in MM01 MM02
Hi all my requirements is to protect material basic data long text (trx MM01, MM02) for a specific user. How can I do that? Note that I can't use authority object M_MATE_MAN, cause only long text need to be protected. My SAP release is 4.6C Regards
-
Cannot connect to server on one email on 5s
My iphone 5s says "cannot connect to server" when I attempt to retrieve email on 1 of my email accounts