Forward mail with attachment (not WorkItem) from SBWP to Outlook
Hallo,
we want to forward mails (not WorkItems) form SBWP to Outlook.
The forwarding works fine for the mail but if the mail includes an attachment from type object (e.g. send object with note in MM03) we are not able to open the object in the mail. We want to open the object so that automatically SAP GUI is started and the corresponding object is shown in SAP.
In SBWP we are able to open the attachment in Outlook not. Are there any settings in SAP where we can define that.
Have we to define something parameters of the Integrated ITS?
We want the same behaviour for mails with attachments as for WorkItems if they are forwarded to Outlook.
We get an HTML mail in Outlook like
If you are not forwarded automatically, use the following link:
If the link is not to a valid server, log on to the SAP system and check the following object:
System: XYZ
Client: 300
BOR Object Type BUS1001006
BOR Object Key 0000700075
But there is no link to follow in the mail and nothing happens.
Thanks
Edited by: Arnfried Doetsch on Sep 29, 2010 10:28 AM
Hello,
Check if your SMTP node in transaction SCOT is configured to send attachments of all types.
Have a look at the following link:
http://help.sap.com/saphelp_47x200/helpdata/en/08/e043c4c18711d2a27b00a0c943858e/frameset.htm
Regards,
Siddhesh
Similar Messages
-
Is there a way to create a PDF from outlook e-mail that does not embed the attachment? better, is there a way to convert the e-mail with attachement (not embeded) as pdf pages?
- Problem: I have 1400 e-mails with attachments that need to be converted into pdf and the attachments cannot be embeded.
System: PC Windows 7 using Acrobat X Prof. - Thank you!Hi ,
There is an option of embedding index for faster search while converting email to a PDF .
However I am not sure that will serve your purpose or not .
I would recommend you to get in touch with Microsoft support as well .
Meanwhile I'll work on it and get back to you in case I get a desired solution .
Regards
Sukrit Dhingra -
Apple MAIL e-mail with attachment not arriving in GMail accounts
Serious problem...
If I send an e-mail FROM my mac account TO a GMail account...
... No attachment: E-mail arrives
... With attachment: E-MAIL DOES NOT ARRIVE
I've tested this from my MAIL account to our principal on our school's GMail account.
I've tested this from my MAIL account to my own GMail account.
Repeatedly: if my MAIL-generated e-mail includes an attachement, it DOES NOT ARRIVE in GMail acocunts.
This is a serious problem...
Can anyone help?
Thanks.
Cat
PS Just did an experiment: sent a MAIL-generated e-mail with attachment to my GMail account -- e-mail arrived, but had been stripped of attachment. Immediately sent another MAIL e-mail with two small attachments -- it never arrived in my GMail account but the cc arrived immediately in my MAIL account with both attachments intact.I too am experiencing this behavior, however, for some reason that I do not know, the attachments appear ok one day and then they appear embedded. This is becoming detrimental to my work!
Is anyone looking into this at Apple?
C
--Boundary(IDD652jjiT9bsdspgfbLeNSA)
Content-type: application/msword; name=vzw-swd-mmsc.doc
Content-transfer-encoding: BASE64
Content-disposition: attachment; filename=vzw-swd-mmsc.doc
0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAA
PAAAAAAAAAAAEAAAPgAAAAEAAAD+////AAAAADsAAAD/////////////////////
///////////////////////////////////////////spcEAMyAJBAAA8BK/AAAA
AAAAEAAAAAAABAAAhCIAAA4AYmpiamSiZKIAAAAAAAAAAAAAAAAAAAAAAAAJBBYA
An e-mail message with a Word-attachment that was
sent by forwarding was not interpreted correctly by
Mail. The attachment is shown as inline undecoded
data:
--------------060401070608000609090303
Content-Type: application/msword;
name="linuxhandleiding.doc"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="linuxhandleiding.doc"
0M8R4KGxGuEA(...)
To reproduce this, I sent an e-mail with a Word
attachment to my own address, using Thunderbird on a
Linux machine. After that, I forwarded the received
message with the attachment again to my own address.
In Thunderbird, the forwarded message shows the
attachment correctly, but in Apple Mail (2.1), that I
use with the same e-mail account (IMAP), the original
message shows the attachment correctly, but in the
forwarded message it appears undecoded in the message
body (see above).
I searched the forum and found similar issues, but
not exactly what happens here. Also, no solutions
provided helped me to solve this problem. Any
ideas?
iBook G4 / Mac
mini G4 Mac OS X (10.4.7) Mail
2.1
PowerBook G4 Mac OS X (10.4.7) -
Configuration receiving mails with attached adobe forms from BPM
System: CE7.20 SP2
Hi,
I am using Adobe Forms in SAP NW BPM. Therefore I have to configure the Mail, Notification Messages, and Forms Services described [here|http://help.sap.com/saphelp_nwce72/helpdata/en/e4/32ff7865fa483dba3686160f5c6dd0/content.htm].
To get this running at "Java System Properties - Applications - tcbpembase~ear"
I have to configure the mailbox which receives this adobe forms but actually I can not apply a mailbox from the exchange admin! That's always a very big bureaucratic effort, if you know what I mean
Do anybody of you have some experience how this could be solved in a big concern scenario with running exchange?
RegardsMartin,
I want to give points to your helpful answer, but I can´t do it here because you are the owner of the thread and just you can give points, so I have created a thread where you can answer me and there I can give points to anyone. -
Send mail with attachment from the uploaded file
hi,
From a form thread i got the following code to send mail with attachment with the file uploaded from the file upload ui element.
public void onActionLoadFile(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionLoadFile(ServerEvent)
WDWebResourceType FileType = null;
String FileName = new String();
//get attribute info for context attribute 'FileUpload'
IWDAttributeInfo attributeInfo =
wdContext.getNodeInfo().getAttribute(
IPrivateEmailView.IContextElement.FILE_UPLOAD);
//get modifiable binary type from the attribute info,requires type cast.
IWDModifiableBinaryType binaryType =
(IWDModifiableBinaryType) attributeInfo.getModifiableSimpleType();
IPrivateEmailView.IContextElement element =
wdContext.currentContextElement();
//if a file in the 'FileResource' attribute exists
if (element.getFileUpload() != null) {
try {
String mimeType = binaryType.getMimeType().toString();
byte[] file = element.getFileUpload();
//get the size of the uploaded file
element.setFileSize(this.getFileSize(file));
//get the extension of the uploaded file
element.setFileExtension(binaryType.getMimeType().getFileExtension());
//NOTE: context attribute 'FileName' must not be set
//because the FileUpload-UI-element property 'fileName'
//is bound to it. Consequently the fileName is automatically
//written to the context after file upload.
//report success message
wdComponentAPI.getMessageManager().reportMessage(
IMessageEmailComp.SF_UPLOAD,
new Object[] { binaryType.getFileName()},
false);
FileType = binaryType.getMimeType();
FileName = binaryType.getFileName();
} catch (Exception e) {
throw new WDRuntimeException(e);
//if no file in the 'FileResource' attribute exists
else {
//report error message
IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
msgMgr.reportContextAttributeMessage(
element,
attributeInfo,
IMessageEmailComp.NO_FILE,
new Object[] { "" },
true);
//clear the FileResource context value attribute
//element.setFileUpload(null);
String URL;
URL = this.CreateAndGetPathFileUpload(
wdContext.currentContextElement().getFileUpload(),
FileName);
// if (URL.length() == 1){
// //ERRORE
wdContext.currentContextElement().setPATHFileUploaded(URL);
//@@end
public boolean send( java.lang.String subj, java.lang.String mess, java.lang.String dest, java.lang.String attach, java.lang.String FileName )
//@@begin send()
InitialContext ctx = null;
Address[] address = null;
Message msg = null;
Session sess = null;
MimeBodyPart bodyPart = null;
Multipart mp = null;
// "141.29.193.71" == milvl2ja.icn.siemens.it (SMTP di Siemens)
try {
Properties props = new Properties();
props.put("domain","true");
ctx = new InitialContext(props);
sess = (Session) ctx.lookup("java:comp/env/mail/MailSession");
msg = new MimeMessage(sess);
IWDClientUser utente = WDClientUser.getCurrentUser();
String senderEmail = utente.getSAPUser().getEmail();
InternetAddress addressFrom = new InternetAddress(senderEmail);
msg.setFrom(addressFrom);
String EmailDEST = dest;
InternetAddress addressTo = new InternetAddress(EmailDEST);
msg.setRecipient(Message.RecipientType.TO, addressTo);
msg.setSubject(subj);
// if ((mess != null) && (mess.length()>0)) {
// msg.setContent(mess, "text/plain");
// } else {
// msg.setContent("", "text/plain");
//Gestione ATTACHMENT...
String attachedFileName = new String(wdContext.currentContextElement().getFileName());
boolean hasAttachment = (attachedFileName != null) && (attachedFileName.length() > 0);
boolean isMultiPart = (mess != null) && (mess.length() > 1);
//adding an attachment makes the message multipart
if (isMultiPart || hasAttachment) {
mp = new MimeMultipart();
// add text parts
if (mess != null) {
for (int i = 0; i < mess.length(); i++) {
bodyPart = new MimeBodyPart();
bodyPart.setContent(mess,"text/plain");
mp.addBodyPart(bodyPart);
//attach the file to the message if needed
if (hasAttachment) { // avoid the case with no text parts
bodyPart = new MimeBodyPart();
bodyPart.setContent("Allegato incluso nel messaggio.","text/plain");
mp.addBodyPart(bodyPart);
// the part with the file
FileDataSource fds = new FileDataSource(attach);
MimeBodyPart attachmentBodyPart = new MimeBodyPart();
attachmentBodyPart.setDataHandler(new DataHandler(fds));
//URL URLattachedFileName = new URL(attach);
//attachmentBodyPart.setDataHandler(new DataHandler(URLattachedFileName));
attachmentBodyPart.setFileName(FileName);
mp.addBodyPart(attachmentBodyPart);
msg.setContent(mp);
} else {
if ((mess != null) && (mess.length() > 0)) {
msg.setContent(mess, "text/plain");
} else {
msg.setContent("", "text/plain");
//fine ATTACHMENT
msg.setSentDate(new GregorianCalendar().getTime());
msg.saveChanges();
address = msg.getAllRecipients();
Transport.send(msg, address);
} catch (Exception e) {
e.printStackTrace();
return false;
return true;
//@@end
When i used the same code in my application i am gett ing error in many places..
1)FileDataSource fds = new FileDataSource(<b>attach</b>);
attach cannot be resolved
2)attachmentBodyPart.setFileName(<b>FileName</b>);
fliename cannot be resolved
3)byte[] file = element.getFileUpload();
type mismatch cannot convert sting to byte[]
4)element.setFileSize(this.getFileSize(file));
method getFileSize() is undefined
5)element.setFileExtension(binaryType.getMimeType().getFileExtension());
method getFilExtension() is undefined
6)URL = this.CreateAndGetPathFileUpload(wdContext.currentContextElement().getFileUpload(),FileName);
method CreateAndGetPathFileUpload() is undefined.
7)wdContext.currentContextElement().setPATHFileUploaded(URL);
from the above error i can understand that only i have got the part of the code.
Please send me the complete coding.
some method definitions are missing....
Please help me to send the mail with attachment from the file uploaded from the file upload ui element.
Thanks in advance,
shami.hi,
I got this from the following link
Re: Attaching an excel file
plz help me ...
I am using 2004s with nwds 7.0.06.
also tell me what should be the type of the context variable FileUpload
Thanks in advance,
shami. -
Send mail with attachment from webdynpro application
hi,
From a webdynpro application, the user will upload any files through the File upload ui element.These uploaded files has to go as an attachment in the mail which is being send to a particular ID ,when the user clicks the submit button in the form.
can you please give me the code regarding this and help me in sending mail with attachment from a webdynpro application.
Thanks in advance,
shami.Hai,
Properties props = System.getProperties();
props.put("mail.smtp.host", "xx.xx.x.xx");
Session session = Session.getDefaultInstance(props, null);
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress("[email protected]"));
msg.setRecipients(Message.RecipientType.TO,
InternetAddress.parse("[email protected]", false));
msg.setSubject(subject);
msg.setText(body);
msg.setHeader("X-Mailer", " Email");
msg.setSentDate(new Date());
MimeBodyPart messageBodyPart = new MimeBodyPart();
messageBodyPart.setText("Hai , This mail Generated By the Program");
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messageBodyPart);
messageBodyPart = new MimeBodyPart();
DataSource source = new FileDataSource("C:\nag.xls");//Here you need to give the Path of uploaded File
messageBodyPart.setDataHandler( new DataHandler(source));
messageBodyPart.setFileName("nag.xls");
multipart.addBodyPart(messageBodyPart);
// Put parts in message
msg.setContent(multipart);
Transport.send(msg);
Regards,
Naga -
Sending an E-mail with attachment with PHP from Flex
Hey,
I've made a custom compontent wich mails your own drawings to you. But I have a problem to send an e-mail with attachment.
I use the HttpService to send the data to the php-file, but I always get the Fault message (form phpFault()).
This is my code in Flex:
<mx:Script>
<![CDATA[
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.graphics.codec.PNGEncoder;
import mx.events.ValidationResultEvent;
import mx.controls.Alert;
[Bindable]
private var byteArray:ByteArray;
private function mailImage(comp:DisplayObject):void
var emailValidation:ValidationResultEvent = validEmail.validate();
if(emailValidation.type == ValidationResultEvent.INVALID)
Alert.show("Invalid E-mail");
else
var bitmapData:BitmapData = new BitmapData(comp.width, comp.height);
bitmapData.draw(comp);
var png:PNGEncoder = new PNGEncoder();
byteArray = png.encode(bitmapData);
httpMail.send();
private function phpResult(evt:ResultEvent):void
Alert.show("You've got mail.");
private function phpFault(evt:FaultEvent):void
Alert.show("Something went wrong. /n" + evt.message.toString());
]]>
</mx:Script>
<mx:EmailValidator id="validEmail" source="{ipEmail}" property="text"/>
<mx:HTTPService id="httpMail" url="php/byte-receiver.php" method="POST" result="phpResult(event)" fault="phpFault(event)">
<mx:request>
<img>{byteArray}</img>
<mail>{ipEmail.text}</mail>
</mx:request>
</mx:HTTPService>
<mx:Label text="draw your own image" styleName="h1" x="10" y="0" width="493" height="60"/>
<mx:Canvas
id="drawCanvas"
x="10" y="77"
width="561" height="245"
borderStyle="solid" borderColor="#A6A6A6">
</mx:Canvas>
<mx:Label x="10" y="329" text="Your e-mail:" styleName="text"/>
<mx:TextInput
id="ipEmail"
x="86" y="324" width="417"/>
<mx:Label
id="lblMailImage"
x="10" y="383"
text="Mail my image"
click="mailImage(drawCanvas)"
mouseOver="lblMailImage.setStyle('color', '#00067b')"
mouseOut="lblMailImage.setStyle('color', '#717171')"
styleName="button"/>
</mx:Canvas>
This is my PHP code
<?php
$fileatt_type = "application/octet-stream"; // File Type
$fileatt_name = "ImgContact.png"; // Filename that will be used for the file as the attachment
$email_from = "[email protected]"; //Who the email is from
$email_subject = "Contact Winckelmans.net"; // The Subject of the email
$email_message = "Mail send by winckelmans.net. Your drawing is in the attachment"; // Message that the email has in it
$email_to = $_POST['mail']; // Who the email is too
$headers = "From: $email_from";
$data= $_POST['img'];
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";
$email_message = "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type:text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$email_message . "\n\n";
$email_message .= "--{$mime_boundary}\n" .
"Content-Type: {$fileatt_type};\n" .
" name=\"{$fileatt_name}\"\n" .
//"Content-Disposition: attachment;\n" .
//" filename=\"{$fileatt_name}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$mime_boundary}--\n";
$mailsend = mail($email_to, $email_subject, $email_message, $headers);
echo $mailsend;
?>
This is the error I get in an Alert:
(mx.messaging.messages::ErrorMessage)#0
body = ""
clientId = "DirectHTTPChannel0"
correlationId = "F3C16CE1-65CF-E690-1907-D28293FD6BB9"
destination = ""
extendedData = (null)
faultCode = "Server.Error.Request"
faultDetail = "Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: php/byte-receiver.php"]. URL: php/byte-receiver.php"
faultString = "HTTP request error"
headers = (Object)#1
DSStatusCode = 0
messageId = "7A1DCDBE-0358-7E39-3AF8-D282945A7748"
rootCause = (flash.events::IOErrorEvent)#2
bubbles = false
cancelable = false
currentTarget = (flash.net::URLLoader)#3
bytesLoaded = 0
bytesTotal = 0
data = ""
dataFormat = "text"
eventPhase = 2
target = (flash.net::URLLoader)#3
text = "Error #2032: Stream Error. URL: php/byte-receiver.php"
type = "ioError"
timestamp = 0
timeToLive = 0
Thanks in advance
VincentHi
I'm having the same issue, except my application actually sends the email but the attachment is 0 octet and it doesn't even give me an error... Any chance you found a solution for this and could share it ?
Thanks -
Sending E-mail with attachment within a loop not working.
Hi,
I'm trying to send e-mails with attachment to multiple users with "subject & an attachment" within an ITAB loop.
SUBJECT for each mail to corresponding user is being sent properly.
But ATTACHMENT contents are not being sent properly.
1st ATTACHMENT contents are going to 2nd user(supposed to go to 1st user) & 2nd ATTACHMENT contents are going to 3rd user etc..
in almost all attempts, last ATTACHMENT contents within the loop were delivered properly to the last user.
As a test, I'm debugging by sending with same "SUBJECT" & "ATTACHMENT CONTENTS". still it's not working.
Following is the code for sending mail with same "SUBJECT" & "ATTACHMENT CONTENTS".
I even refreshed the file contents for each record within the ITAB. Greatly appreciate any help.
assume that ITAB has a field GROUP with values 501, 502, 503 & 504.
SUBJECT is the subject of e-mail & DIST_LIST is the e-mail id of the corresponding user.
DATA:
MAIL_FILE(20) TYPE C,
MAIL_TEXT(200) TYPE C,
COMMAND(512) TYPE C,
DIST_LIST(425) TYPE C,
SUBJECT(60) TYPE C.
DATA: BEGIN OF ITAB OCCURS 0.
DATA GROUP LIKE /BI0/PGRP-GRP.
DATA: END OF ITAB.
LOOP AT ITAB.
SUBJECT = ITAB-GROUP.
IF ITAB-GROUP = '501'.
DIST_LIST = '[email protected]'.
ENDIF.
IF ITAB-GROUP = '502'.
DIST_LIST = '[email protected]'.
ENDIF.
IF ITAB-GROUP = '503'.
DIST_LIST = '[email protected]'.
ENDIF.
IF ITAB-GROUP = '504'.
DIST_LIST = '[email protected]'.
ENDIF.
clear MAIL_FILE.
clear MAIL_TEXT.
UNASSIGN <FILE1>.
CONCATENATE '/tmp/' SY-UNAME '.txt' INTO MAIL_FILE.
TRANSLATE MAIL_FILE TO LOWER CASE.
OPEN DATASET MAIL_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
MAIL_TEXT = ITAB-GROUP.
TRANSFER MAIL_TEXT TO MAIL_FILE LENGTH 200.
CLOSE DATASET MAIL_FILE.
clear MAIL_TEXT.
CONCATENATE '< ' MAIL_FILE INTO MAIL_TEXT SEPARATED BY SPACE.
ASSIGN MAIL_TEXT TO <FILE1>.
*Create UNIX MAIL Command
CONCATENATE 'mailx -s'
'"' SUBJECT '"' '"' DIST_LIST '"' <FILE1>
INTO COMMAND SEPARATED BY SPACE.
Send the E-mail
CALL FUNCTION 'RFC_REMOTE_EXEC'
DESTINATION 'SERVER_EXEC'
EXPORTING
COMMAND = COMMAND
EXCEPTIONS
OTHERS = 04.
ENDLOOP.Hi Zhenglin,
thanks for your reply.
Now, it's working after I changed attachment file name (user name) with ITAB-GROUP.
but, I'm not clear on why it was not working even if the file name is same in every loop, as I'm unassigning the file contents and loading new contents at the start of each loop.
anyhow, it's working and many thanks for your help. -
Sending mail with attachment and body.
Hi Experts,
I have a requirement of sending a mail with an attachment and also the mail will have a body whose content will be same as that in the attachment.Subject of the mail will also be configured dynamically.Though I am able to send the mail with the attachment but I am not able to configure the body whose content will be same as that of the attachment.
I have unchecked the "Use Mail Package" and has hard-coded the "TO","From" field for sending the mail with attachment.
Can you please check and let me know how to configure the body which will be same as that of the attachment.
Thanks and Regards
Atanu MazumdarHi,
Use MTB module and then one of the parameter which can allow you to send message in attachment as well as in message body.
Transform.ContentDisposition: it helps us to decide if we want to send the payload as an attachment or in the message body. If we give the Parameter value as u201Cattachmentu201D then we will have the payload attached in the mail and if we assign this value as u201Cinlineu201D the payload will go in the mail body.
Hope this helps you..
Regards.... -
Sending mail with attachment fails on MAC Mail and WRP400.
Sending mail with attachment fails on MAC Mail and WRP400.
We have hundreds of WRP400 connected with Mac (Machintosh) computers. No special configurations are applied (no virtual server or DMZ). Web navigation, P2P programs and sending mail without attachment work right.
The problem is the impossibility to send mails with medium or big size files attachment from MAC Mail.
If we use Windows PCs or a different linksys routers (eg. WRT54G) the problem not happens.
We have upgraded WRP400 firmware version from 1.00.06 to 2.00.05 but the result is the same. Sending mail with attachment using Mac fails.
We tried to configure WRP400 with DMZ to a particular MAC. We tried to configure Virtual server on tcp 25 port of a MAC. The result is always the same.
This is a WRP400 bug? Windows PCs work right. MAC and MAC mail works right with other linksys router.
We need help. Thanks.The problem was fixed since beta firmware 2.00.11.
I think that this issue was caused from a bug that decrease upload bitrate of WRP400 after some days of activity.
See more details on Cisco forum under title "WRP400 stops responding after browsing certain websites".
Thanks. -
Mail with attachment; dynamic receiver
Hi everybody,
we are sending a mail with attachment though mail adapter.
In Micosoft Exchange the mail is received correct und the attachment is displayed.
We got also a signature server.
There the attachment is not regocnized.
Any ideas.
Is MS Exchange more error toleranting that onther mail servers?
Any ideas are appreciated
Regards MarioHi,
1) XML payload as attachment (with dynamic name)
2) recipient (recipient email id is part of input xml payload, but not part of the mapped XML payload)
These two is possible by using Mail Package. You have a standard xsd for mail package which you can download from the SAP Note 748024.
The xml created in you java mapping which will be your attachment should be put into the <content> tag of the mail package xml structure. and the file name can be set in the <Content_Type> tag.
<?xml version="1.0"; encoding="UTF-8"?>
<p2:Mail xmlns:p2="http://sap.com/xi/XI/Mail/30">
<Subject>My Invoice</Subject>
<From>from email address<;/From>
<To>to email address</To>
<Content_Type>text/plain;name="MyFile.csv";</Content_Type> --> file name here
<Content>123;A49;aaa</Content> -> attachment xml here
</p2:Mail>
And you have to select MailPackage in the receiver mail adapter.
Regards,
Aravind -
C3-01 can´t delete mails with attachment
Hi,
since one week I have the C3 touch & type. It`s a very nice mobile phone. But I have a problem: I can not delete mails with attachment in the mail programm. Mails without attachment are no problem. I have an mailaccount from "1und1" (Germany). Has anybody an idea, how I can solve this?
Thanks alot.
pastoresThe only way I've been able to delete them is to delete the email account from the phone, then add the account, again.
Pretty painful solution. -
Problem in sending mail with attachment
Hi All,
I am using the function module <b>'SO_NEW_DOCUMENT_ATT_SEND_API1'</b> to send mail with attachment.
the program executes properly and shows a message <b>'Document Sent'</b>. But neither the sent mail appears in <b>'SOST'</b> nor I get it on the specified email id.
Below is my code:
<b>***</b> As attachment I am sending resume whose contents are stored in table 'ZResume' corresponding to personnel no.(pernr) and serial No.(srno).
<b>START OF PROGRAM</b>----
REPORT ZPTEST_SEND_MAIL_ATTATCHMENT.
DATA : w_name TYPE sos04-l_adr_name.
DATA: RESUME TYPE table of XSTRING with header line.
START-OF-SELECTION.
<b>* Data Declaration</b>
DATA:
l_datum(10),
ls_docdata TYPE sodocchgi1,
lt_objpack TYPE TABLE OF sopcklsti1 WITH HEADER LINE,
lt_objhead TYPE TABLE OF solisti1 WITH HEADER LINE,
lt_objtxt TYPE TABLE OF solisti1 WITH HEADER LINE,
lt_objbin TYPE TABLE OF solisti1 WITH HEADER LINE,
lt_reclist TYPE TABLE OF somlreci1 WITH HEADER LINE,
lt_listobject TYPE TABLE OF abaplist WITH HEADER LINE,
l_tab_lines TYPE i,
l_att_type LIKE soodk-objtp.
WRITE sy-datum TO l_datum.
SELECT SINGLE RESUME FROM ZRESUME INTO RESUME
WHERE PERNR EQ '00001182'
AND SRNO EQ '1'.
APPEND RESUME.
<b>* Because RESUME may be of size RAW(1000)
and objbin is of size CHAR(255) we make this table copy</b>
CALL FUNCTION 'TABLE_COMPRESS'
TABLES
in = resume
out = lt_objbin
EXCEPTIONS
compress_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
Error in function module &1
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
<b>* Create the message and send the document.
Create Message Body</b>
<b>* Title and Description</b>
ls_docdata-obj_name = 'Resume'.
ls_docdata-obj_descr = 'Resume'.
<b>* Main Text</b>
lt_objtxt = 'Resume of the candidate' .
APPEND lt_objtxt.
<b>* Write Packing List (Main)</b>
DESCRIBE TABLE lt_objtxt LINES l_tab_lines.
READ TABLE lt_objtxt INDEX l_tab_lines.
ls_docdata-doc_size = ( l_tab_lines - 1 ) * 255 + STRLEN( lt_objtxt ).
CLEAR lt_objpack-transf_bin.
lt_objpack-head_start = 1.
lt_objpack-head_num = 0.
lt_objpack-body_start = 1.
lt_objpack-body_num = l_tab_lines.
lt_objpack-doc_type = 'RAW'.
APPEND lt_objpack.
<b>* Create Message Attachment
Write Packing List (Attachment)</b>
l_att_type = 'ALI'.
DESCRIBE TABLE lt_objbin LINES l_tab_lines.
READ TABLE lt_objbin INDEX l_tab_lines.
lt_objpack-doc_size = ( l_tab_lines - 1 ) * 255 + STRLEN( lt_objbin ).
lt_objpack-transf_bin = 'X'.
lt_objpack-head_start = 1.
lt_objpack-head_num = 0.
lt_objpack-body_start = 1.
lt_objpack-body_num = l_tab_lines.
lt_objpack-doc_type = l_att_type.
lt_objpack-obj_name = 'ATTACHMENT'.
lt_objpack-obj_descr = 'Resume'.
APPEND lt_objpack.
<b>* Create receiver list</b>
lt_reclist-receiver = '[email protected]'.
lt_reclist-rec_type = 'U'.
APPEND lt_reclist.
<b>* Send Message</b>
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = ls_docdata
put_in_outbox = ''
TABLES
packing_list = lt_objpack
object_header = lt_objhead
contents_bin = lt_objbin
contents_txt = lt_objtxt
receivers = lt_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.
Document sent
MESSAGE ID 'SO' TYPE 'S' NUMBER '022'.
ELSE.
Document <&> could not be sent
MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
WITH ls_docdata-obj_name.
ENDIF.
<b>END OF PROGRAM</b>----
Can anybody tell me where I am making mistake?
Thanks in advance,
PragyaHi Pragya,
Refer the code below. It's working fine and try to match up the things from your program.
REPORT ZSAMPL_001 .
INCLUDE ZINCLUDE_01.
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
***INCLUDE ZINCLUDE_01 .
10.08.2005 Amit M - Created
Include For Mail (First Req F16)
Modification Log
Data
tables crmrfcpar.
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.
data v_rfcdest LIKE crmrfcpar-rfcdest.
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
FORM
FORM ml_saveforbp USING jobname jobcount.
Data
*data : yhead like yhrt_bp_head.
*DATA : ydocdata LIKE yhrt_bp_docdata,
*yobjtxt LIKE yhrt_bp_objtxt OCCURS 0 WITH HEADER LINE,
*yreclist LIKE yhrt_bp_reclist OCCURS 0 WITH HEADER LINE.
*DATA : seqnr TYPE i.
Head
*yhead-jobname = jobname.
*yhead-jobcount = jobcount..
*MODIFY yhrt_bp_head FROM yhead.
Doc Data
*ydocdata-jobname = jobname.
*ydocdata-jobcount = jobcount.
*MOVE-CORRESPONDING docdata TO ydocdata.
*MODIFY yhrt_bp_docdata FROM ydocdata.
Objtxt
*seqnr = 0.
*LOOP AT objtxt.
*seqnr = seqnr + 1.
*yobjtxt-jobname = jobname.
*yobjtxt-jobcount = jobcount.
*yobjtxt-seqnr = seqnr.
*MOVE-CORRESPONDING objtxt TO yobjtxt.
*MODIFY yhrt_bp_objtxt FROM yobjtxt.
*ENDLOOP.
RecList
*seqnr = 0.
*LOOP AT reclist.
*seqnr = seqnr + 1.
*yreclist-jobname = jobname.
*yreclist-jobcount = jobcount.
*yreclist-seqnr = seqnr.
*MOVE-CORRESPONDING reclist TO yreclist.
*MODIFY yhrt_bp_reclist FROM yreclist.
*ENDLOOP.
ENDFORM. "ml_saveforbp
FORM
FORM ml_fetchfrombp USING jobname jobcount.
*CLEAR docdata.
*REFRESH objtxt.
*REFRESH reclist.
*SELECT SINGLE * FROM yhrt_bp_docdata
*INTO corresponding fields of docdata
*WHERE jobname = jobname
*AND jobcount = jobcount.
*SELECT * FROM yhrt_bp_objtxt
*INTO corresponding fields of TABLE objtxt
*WHERE jobname = jobname
*AND jobcount = jobcount
*ORDER BY seqnr.
*SELECT * FROM yhrt_bp_reclist
*INTO corresponding fields of TABLE reclist
*WHERE jobname = jobname
*AND jobcount = jobcount
*ORDER BY seqnr.
ENDFORM. "ml_fetchfrombp
<b>Please reward points if it helps.</b>
Regards,
Amit Mishra -
Send mail with attachment and more recipients
Hi to all,
I have this procedure :
PROCEDURE SPEDISCI_MAIL
Mittente IN VARCHAR2,
Destinatario IN VARCHAR2,
Oggetto IN VARCHAR2,
Messaggio IN VARCHAR2
IS
mailhost VARCHAR2(40) := 'pippo.com';
conn utl_smtp.connection;
crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
mesg VARCHAR2( 1000 );
local_mittente VARCHAR2(2000) := mittente;
BEGIN
conn := utl_smtp.open_connection (mailhost,25);
mesg:='Date:'||TO_CHAR(SYSDATE,'dd mon yy hh24:mi:ss')||crlf||
'From:<'||mittente||'>'||crlf||
'Subject:'||Oggetto||crlf||
'To:'||destinatario||crlf||''
||crlf||messaggio;
utl_smtp.helo(conn, mailhost);
utl_smtp.mail(conn,local_mittente);
utl_smtp.rcpt(conn,destinatario);
utl_smtp.data(conn, mesg);
utl_smtp.quit(conn);
END;
Can I send mail with attachment and more recipients?
Thank you
SilviaConsider using UTL_MAIL package:
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_mail.htm
(Note: it's not installed and configured by default, but the scripts are supplied with the Oracle database, see documentation for instructions) -
Send Mail with Attachment to Outlook - Version 3.1i
Hi Every one,
I need to draft a logic in 3.1i system that sends a mail to Microsoft outlook inbox with attachments.
The below flow of logic is the core part of the code that I am using for mails without attachments.
OPEN DATASET P_FNAME FOR OUTPUT IN TEXT MODE.
IF P_FROM NE SPACE.
CONCATENATE 'From:'(MFR) P_FROM INTO P_FROM SEPARATED BY SPACE.
TRANSFER P_FROM TO P_FNAME.
ENDIF.
IF P_TO NE SPACE.
CONCATENATE 'To:'(MTO) P_TO INTO P_TO SEPARATED BY SPACE.
TRANSFER P_TO TO P_FNAME.
ENDIF.
IF P_CC NE SPACE.
CONCATENATE 'Cc:'(MCC) P_CC INTO P_CC SEPARATED BY SPACE.
TRANSFER P_CC TO P_FNAME.
ENDIF.
IF P_BCC NE SPACE.
CONCATENATE 'Bcc:'(MBC) P_BCC INTO P_BCC SEPARATED BY SPACE.
TRANSFER P_BCC TO P_FNAME.
ENDIF.
IF P_SUB NE SPACE.
CONCATENATE 'Subject:'(MSB) P_SUB INTO P_SUB SEPARATED BY SPACE.
TRANSFER P_SUB TO P_FNAME.
ENDIF.
LOOP AT S_BODY.
TRANSFER S_BODY-LOW TO P_FNAME.
ENDLOOP.
CLOSE DATASET P_FNAME.
Run External Command: SENDMAIL
CLEAR PARCOM.
REFRESH OUT_LINES.
concatenate 'sendmail -t < ' p_fname into parcom.
Execute Command
call 'system' id 'COMMAND' field PARCOM id 'TAB' field out_lines-SYS .
I have tried creating another file in AL11 and using it as attachment after the transfer of subject text in the above code, like -
CONCATENATE 'Attach:'(MAT) '/usr/sap/GS1/DVEBMGS20/work/attach.txt INTO P_ATTACH SEPARATED BY SPACE.
TRANSFER P_ATTACH TO P_FNAME.
But, this did not work.
Need your help in extending the code to send attachments.
Thanks in Advance,
Regards
Govardhan
Edited by: Gova12 on Sep 8, 2009 12:25 PM
Edited by: Gova12 on Sep 8, 2009 12:57 PM< DATA: i_message TYPE STANDARD TABLE OF solisti1,
i_attach TYPE STANDARD TABLE OF solisti1,
i_attach_body TYPE STANDARD TABLE OF solisti1,
i_suc_notify TYPE STANDARD TABLE OF zifdl,
i_mail_rcpnts TYPE STANDARD TABLE OF zbss_mail.
Populate table with detaisl to be entered into .xls file
PERFORM build_xls_data_table.
Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment.
*& Form BUILD_XLS_DATA_TABLE
Populate table with detaisl to be entered into .xls file
FORM build_xls_data_table .
CONSTANTS: l_c_head1 TYPE char20 VALUE 'Credit Card Type', "#EC NOTEXT
l_c_head2 TYPE char20 VALUE 'OrigSysRef',
l_c_head3 TYPE char20 VALUE 'OrderNum',
l_c_head4 TYPE char20 VALUE 'OrigSysLineRef',
l_c_head5 TYPE char20 VALUE 'LineNum',
l_c_head6 TYPE char20 VALUE 'ItemNum',
l_c_head7 TYPE char20 VALUE 'LineAmt',
l_c_head8 TYPE char20 VALUE 'ScheduleDate',
l_c_head9 TYPE char20 VALUE 'ReqDate',
l_c_head10 TYPE char20 VALUE 'PromiseDate',
l_c_head11 TYPE char20 VALUE 'AuthReqDate'.
DATA:
l_vtext TYPE char50, "Credit Card Type
l_bstnk TYPE char20, "OrigSysRef
l_vbeln TYPE char20, "OrderNum
l_posex TYPE char20, "OrigSysLineRef
l_posnr TYPE char20, "LineNum
l_matnr TYPE char20, "ItemNum
l_netwr TYPE char20, "LineAmt
l_lddat TYPE char20, "ScheduleDate
l_vdatu TYPE char20, "ReqDate
l_edatu TYPE char20, "PromiseDate
l_req_date TYPE char20, "AuthReqDate
l_sub_tot TYPE vbap-netwr,
l_sto TYPE char20,
l_v_datum TYPE char10,
l_v_time TYPE char10,
l_dummy TYPE char20.
DATA: l_wa_attach TYPE solisti1,
l_wa_attach_body TYPE solisti1,
l_wa_final TYPE t_final.
CLEAR: l_dummy.
CONCATENATE sy-datum(4) sy-datum4(2) sy-datum6(2) INTO l_v_datum SEPARATED BY '/'.
CONCATENATE sy-uzeit(2) sy-uzeit2(2) sy-uzeit4(2) INTO l_v_time SEPARATED BY ':'.
This table contain actual column headings for the fields in the attachment
CLEAR: l_wa_attach.
CONCATENATE text-011
cl_abap_char_utilities=>horizontal_tab
text-003
cl_abap_char_utilities=>horizontal_tab
cl_abap_char_utilities=>horizontal_tab
cl_abap_char_utilities=>horizontal_tab
text-021
l_v_datum
l_v_time
cl_abap_char_utilities=>cr_lf
cl_abap_char_utilities=>cr_lf
INTO l_wa_attach SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
APPEND l_wa_attach TO i_attach.
CLEAR: l_wa_attach.
This table contain actual column headings for the fields in the attachment
CONCATENATE l_c_head1 l_c_head2 l_c_head3 l_c_head4 l_c_head5
l_c_head6 l_c_head7 l_c_head8 l_c_head9 l_c_head10
l_c_head11 cl_abap_char_utilities=>cr_lf
INTO l_wa_attach SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
APPEND l_wa_attach TO i_attach.
CLEAR: l_wa_attach.
This table contain the actual contents of the attachment
SORT i_final BY vbeln posnr.
CLEAR: l_wa_final,l_wa_attach_body.
LOOP AT i_final INTO l_wa_final.
WRITE :
l_wa_final-vtext TO l_vtext,
l_wa_final-bstnk TO l_bstnk,
l_wa_final-vbeln TO l_vbeln,
l_wa_final-posex TO l_posex,
l_wa_final-posnr TO l_posnr,
l_wa_final-matnr TO l_matnr,
l_wa_final-netwr TO l_netwr CURRENCY 'VBAP-WAERK',
l_wa_final-lddat TO l_lddat,
l_wa_final-vdatu TO l_vdatu,
l_wa_final-edatu TO l_edatu,
l_wa_final-req_date TO l_req_date.
l_sub_tot = l_sub_tot + l_wa_final-netwr.
CONCATENATE l_dummy
l_vtext l_bstnk l_vbeln l_posex l_posnr l_matnr
l_netwr l_lddat l_vdatu l_edatu l_req_date
INTO l_wa_attach_body SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
APPEND l_wa_attach_body TO i_attach_body.
CLEAR: l_wa_attach_body.
AT END OF vbeln.
READ TABLE i_final INTO l_wa_final INDEX sy-tabix.
MOVE l_sub_tot TO l_sto.
CONCATENATE cl_abap_char_utilities=>horizontal_tab
cl_abap_char_utilities=>horizontal_tab
cl_abap_char_utilities=>horizontal_tab
'Order total'
l_sto
cl_abap_char_utilities=>cr_lf
INTO l_wa_attach_body SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
APPEND l_wa_attach_body TO i_attach_body.
CLEAR: l_sub_tot,l_sto,l_wa_attach_body.
ENDAT.
ENDLOOP.
ENDFORM. " BUILD_XLS_DATA_TABLE
DATA: l_v_desc TYPE sood1-objdes,
l_wa_suc_notify TYPE zifdl,
l_wa_mail_rcpnts TYPE zbss_mail.
Get the mail ids from distribution list
REFRESH: i_suc_notify.
SELECT * INTO TABLE i_suc_notify
FROM zifdl
WHERE zdstlist EQ p_disid.
IF sy-subrc <> c_zero.
Show exit msg if there is no distribution list maintained
MESSAGE e002 WITH text-014 p_disid.
ENDIF.
format the email id details
CLEAR: l_wa_suc_notify,l_wa_mail_rcpnts.
LOOP AT i_suc_notify INTO l_wa_suc_notify .
IF l_wa_suc_notify-zuserid CA '@'.
l_wa_mail_rcpnts-l_adr_name = l_wa_suc_notify-zuserid.
ELSE.
l_wa_mail_rcpnts-usrnam = l_wa_suc_notify-zuserid.
ENDIF.
APPEND l_wa_mail_rcpnts TO i_mail_rcpnts.
CLEAR: l_wa_mail_rcpnts,l_wa_suc_notify.
ENDLOOP.
Populate message body text
PERFORM populate_email_message_body.
Send the report output generated to the list of recipients
MOVE text-012 TO l_v_desc.
Send the e-mail with attachment
TRY.
-------- create persistent send request ------------------------
send_request = cl_bcs=>create_persistent( ).
-------- create and set document with attachment ---------------
create document from internal table with text
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = i_content_body[]
i_subject = subject ).
Check if Attachment should be sent in mail
IF p_skip_attach IS INITIAL.
IF i_attachment_type = 'ALI'.
CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = i_attachment_type
i_attachment_subject = l_filename
i_att_content_hex = i_content_hex.
ELSE.
Get No of lines
DESCRIBE TABLE i_attach LINES l_lines.
Size to multiplied by no of lines
l_size = l_lines * 255.
CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = i_attachment_type
i_attachment_size = l_size
i_attachment_subject = i_filename
i_att_content_text = i_attach[].
ENDIF.
ENDIF.
add document to send request
CALL METHOD send_request->set_document( document ).
--------- add recipient (e-mail address) -----------------------
LOOP AT i_receivers INTO l_receiver_wa.
CLEAR l_mailaddr.
l_mailaddr = l_receiver_wa-receiver.
recipient = cl_cam_address_bcs=>create_internet_address(
l_mailaddr ).
add recipient with its respective attributes to send request
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = express
i_copy = ' '
i_blind_copy = ' '
i_copy = l_receiver_wa-copy
i_blind_copy = l_receiver_wa-blind_copy
i_no_forward = ' '.
ENDLOOP.
*Set sender based on l_userid
lo_sender = cl_sapuser_bcs=>create( l_userid ).
CALL METHOD send_request->set_sender( EXPORTING i_sender = lo_sender ).
---------- send document ---------------------------------------
CALL METHOD send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = sent_to_all ).
IF i_bypass_commit IS INITIAL.
COMMIT WORK.
ENDIF.
* exception handling
CATCH cx_bcs INTO bcs_exception.
ENDTRY. >
Edited by: sugunav on Sep 8, 2009 4:41 PM
Maybe you are looking for
-
Bapi or Function module for getting Bom Item Details (Urgent)
Hi All, I Want to get the Bom Item Details Corresponding to Production Order Number. So Please Provide me Some Function Module or Bapi So that by giving the Production Order number I will get all material related to that PO. Thanks In Advance.
-
This has been going on for a few days and I can not get anyone on the phone at tech support - or on chat! I've got a huge site to finish and I can't make any changes - what can I do? I did notice that I suddenly have 2 Dreamweaver apps - the old DWc
-
the name reserved for me is wrong. how can I change it?
-
Phantom Reads / Data Concurrency
I am using OWB 10.2. I am encountering phantom reads within some of my OWB maps. These phantom reads are caused by activity on the source system when I am sucking the data from the source tables. The problem is my map does an update and then an inser
-
Problems and problems on my nokia n8! x-plore not ...
m usin nokia n8....i hd installed x-plore successfully on my n8 successfully.....njoyd using it. Bt jus aftr da pr1.1 it stoppdd wrkin! **bleep**!!! When i click on da icon, da scree light dims as a nrml fone does b4 ne app clicks open, da same here