How to sending simple text in the mail body
Hi friends,
How to send simple text in the mail body through ABAP code
plz send me the related code and setting for that mail.
Thanks&Regards,
Srinivas
try this...
FORM send_file_as_email_attachment .
DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
DATA: objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA : i_body TYPE soli_tab WITH HEADER LINE.
DATA: it_attach LIKE it_display1 OCCURS 0 WITH HEADER LINE.
DATA: doc_chng LIKE sodocchgi1.
DATA: tab_lines LIKE sy-tabix.
DATA: att_lines TYPE i.
DATA: lv_lines TYPE i.
DATA: file TYPE string.
data: g_datum like sy-datum.
data: g_datum1(10) type c.
DATA: len TYPE n.
LOOP AT it_email.
CLEAR : objpack,
objhead,
objbin,
objtxt,
reclist.
REFRESH: objpack,
objhead,
objbin,
objtxt,
reclist.
g_datum = sy-datum - 1.
concatenate g_datum6(2) '.' g_datum4(2) '.' g_datum+0(4) into
g_datum1.
doc_chng-obj_descr = 'Aged Stock more than 45 Days'.
CONCATENATE 'Aged Stock more than 45 Days' '-' it_email-vkbur INTO
doc_chng-obj_descr.
CONCATENATE 'Please find enclosed Aged Stock Details ( >45days ) report as on'
g_datum1
INTO objtxt-line SEPARATED BY space.
APPEND objtxt.
objtxt-line = ' '.
APPEND objtxt.
objtxt-line = 'Regards'.
APPEND objtxt.
objtxt-line = 'LIS SAP Projects'.
APPEND objtxt.
objtxt-line =
'PS: Pls send feedback for futher improvements to SAP office.'.
APPEND objtxt.
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
objpack-obj_name = 'Run_prog'.
objpack-obj_descr = 'Agestock.txt'.
lv_lines = tab_lines.
APPEND objpack.
*CONCATENATE 'Plant' 'Material Number' 'Qty(More than 45days)'
*'Amount' INTO
it_display SEPARATED BY space.
append objbin.
clear: objbin.
CLEAR:it_display2.
REFRESH it_display2.
it_display2-werks = 'Plant|'.
it_display2-matnr = 'Material Number'.
it_display2-qty = '|Qty > 45 days'.
it_display2-amount = ' |Amount'.
APPEND it_display2.
it_display2-werks = ''.
it_display2-matnr = ''.
it_display2-qty = ''.
it_display2-amount = ''.
APPEND it_display2.
CLEAR : it_display2.
sort it_display1 by amount descending.
LOOP AT it_display1 WHERE werks = it_email-vkbur.
AT FIRST.
*CONCATENATE 'Plant ' 'Material Number' 'Qty(More than 45days)'
*'Amount' INTO
objbin-line SEPARATED BY space.
append objbin.
clear: objbin.
ENDAT.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = it_display1-matnr
IMPORTING
output = it_display1-matnr.
it_display1-qty = TRUNC( it_display1-qty ).
MOVE-CORRESPONDING it_display1 TO it_display2.
APPEND it_display2.
CLEAR:it_display1,it_display2,objbin.
CLEAR:it_display1.
ENDLOOP.
objbin[] = it_display2[].
DESCRIBE TABLE objbin LINES tab_lines.
objhead = 'Suug'.
APPEND objhead.
objpack-transf_bin = 'X'.
objpack-head_start = 3.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'RAW'.
objpack-obj_name = 'Run_prog'.
objpack-obj_descr = 'Agestock.txt'.
APPEND objpack.
reclist-receiver = '[email protected]'.
reclist-rec_type = 'U'.
APPEND reclist.
=====================================================================
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = doc_chng
commit_work = 'X'
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
receivers = reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
CLEAR : it_email.
ENDLOOP.
ENDFORM. "send_mail
Message was edited by:
Sugumar Ganesan
Similar Messages
-
How To Send A Text Attachment Through MAIL Adapter
Hi Experts,
I Did A Scenario that is By using file adapter at the sender side and PI as a middle ware i have sent one text file to database
Now here my question is
I have to send the same text file which i have sent database... my using Mail Adapter
Simply File to Mail Scenario
FILE PI MAIL
But I have to send the same text file which i sent to database... by using mail adapter... Here all the configuration are done ... And the channels are working properly... only thing here is..to send same text file using mail adapter..
It will be good if any one can explain step by step..
Regards
aravindhHi Rajendra,
Tanq for connecting me ... This Blog helped me a lot ....And it is a useful answer to me..
For this file to mail scenario we have got .txt as an attachment ... Its fine ... But her my Client is asking me to add CONTENT in the mail... Content in the sense..
Example of content...
Hi,
Please find the attachment
Regards,
sap pi,
They need in the form of like this... To add content in the mail What i have to do...DO i need to add more configurations if it is what are they...
Please solve the issue.. It is appreciated some one can explain me step by step or .. By sending me screen charts..
Thanks in advance....
Regards
vinay -
How to send binary data in the message body
How can we send binary data in the message body that is base64 encoded? below are the requirements
Mime Header.
Mime-version: 1.0
Content-Type: application/octet_stream; name=test
Content-Transfer-Encoding: Base64
Submission must be named "test.sub" (lowercase)
Submission must be base64 mime-encoded
Submission must be sent in the body of the message (not as an attachment)
Only one submission per mail message
No other comments should be put in the body of the mail message (other than the submission)
I highly appreciate your help. If you can provide few examples, that will be very helpfull.
Thanks,
MadanUse Message.setContent to set the content, or use Message.setDataHandler with
a DataHandler constructed with a ByteArrayDataSource. If the content is not
"naturally" encoded in base64, you can enforce it by setting the Content-Transfer-Encoding
header to "base64". Any reasonable mail reader won't care what encoding you use, as
long as the decoded data is correct. -
Rejection Applicant: How to add plain text to the mail E Mail Letter?
Dear All:
I'm working with a ECC6 version.
In transaction PB60, when we do the candidate rejection activity, the E Mail letter generates a mail with empty body text, and an attachment with the letter in PDF format. The letter is OK, but I would like to know how to add some plain text to this E Mail letter. An empty mail is not a good practise.
I searched across the forums and SAP documentation, but I could not find any clue.
I would appreciate any help regarding to this matter.
Best regards
JordiHere you go ! ( you need to create Text in t-code SO10 for ID = PAML " )
Two Default texts under ID = PAML :
*MAIL-APP-INTERVIEW *EN TEXT PAML SYSTEM
MAIL-APPLICANT EN TEXT PAML SYSTEM
Personnel Management->Applicant Activities->Mail Connection ->Create standard texts for mail connection
Create standard texts for mail connection
In this step you can create the standard texts to be used in mails.
Example
u2022 Request for return of applicant file
u2022 Notification of date of job interview
Requirements
u2022 You should have assigned a standard text to the activity.
u2022 You should also have set the variables which are to be used.
u2022 Finally, you should also have made the settings for supplying the variable with values.
Standard settings
The standard system contains two examples of standard texts. You can use these examples as references to help you create your own standard texts. The standard texts have the following names:
u2022 MAIL-APPLICANT (note on an applicant activity)
u2022 MAIL-APP-INTERVIEW (note on appointment for interview)
Please note that the standard texts are stored under text ID PAML.
Activities
Now create the standard texts you require under text ID PAML.
Further notes
Every mail is made up of a heading and contents. In the first line of the standard text you enter the heading of the mail and from the second line on, the contents.
The standard default settings for style and layout are used for mails.
The SAP System treats standard texts as application data. This is why there is no automatic connection to the transport system. If you want to copy texts from one client to another within the same system, please use the functions of the transaction to create the texts. If you want to send the texts to a different system, please enter the transport manually as follows:
PgmID Obj Objectname
R3TR TEXT TEXT,XYZ,PAML,E
| | | --- Language (e.g. E for English)
| | -
Text ID (e.g. PAML for standard mails)
| -
Text name (probably not XYZ)
Text object (TEXT ist fixed)
Good luck
Saquib Khan -
How to send multiple Recipients using the mail.jar and activation.jar
hi!
could somebody help me. how do i send multiple Recipient using mail.jar. when i would input 2email address in to Recipient
(example: [email protected], [email protected])
i get a DEBUG: setDebug: JavaMail version 1.3.2
but if i send a single email it just works properly.
heres my code
import java.io.*;
import java.util.*;
import javax.mail.*;
import javax.mail.event.*;
import javax.mail.internet.*;
public class SendMail
public SendMail(String to, String from, String subject, String body)
//public SendMail(String to)
String message_recip = to;
String message_subject = subject;
String message_cc = "";
String message_body = body;
//The JavaMail session object
Session session;
//The JavaMail message object
Message mesg;
// Pass info to the mail server as a Properties, since JavaMail (wisely) allows room for LOTS of properties...
Properties props = new Properties( );
// LAN must define the local SMTP server as "mailhost" to be able to send mail...
//props.put("mail.smtp.host","true");
props.put("mail.smtp.host", "mailhost");
// Create the Session object
session = Session.getDefaultInstance(props, null);
session.setDebug(true);
try
// create a message
mesg = new MimeMessage(session);
// From Address - this should come from a Properties...
mesg.setFrom(new InternetAddress(from));
// TO Address
InternetAddress toAddress = new InternetAddress(message_recip);
mesg.addRecipient(Message.RecipientType.TO, toAddress);
// CC Address
InternetAddress ccAddress = new InternetAddress(message_cc);
mesg.addRecipient(Message.RecipientType.CC, ccAddress);
// The Subject
mesg.setSubject(message_subject);
// Now the message body.
mesg.setText(message_body);
// XXX I18N: use setText(msgText.getText( ), charset)
// Finally, send the message!
Transport.send(mesg);
}//end of try
catch (MessagingException ex)
while ((ex = (MessagingException)ex.getNextException( )) != null)
ex.printStackTrace( );
}//end of while
}//end of catch
}//end of SendMail
public static void main(String[] args)
//String t = "[email protected], [email protected]"; - this I think causes error
String t = "[email protected]";
String f = "[email protected]";
String s = "Hello World";
String b = "the quick brown fox jumps over the lazy dog";
SendMail sm = new SendMail(t,f,s,b);
}//end of main
}//end of class
could someone please help me im stuck-up with this. thanx!i need it ASAP
i am a beginner in java and jsp
Need to knw how can I parse the addresss field
Below
is the code
<code>
package
public class EMailBean {
private String smtp,username,password,from,bcc,subject,body,attachments,cc;
/*setter*/
public void setSmtp(String str){this.smtp=str;}
public void setUsername(String str){this.username=str;}
public void setPassword(String str){this.password=str;}
public void setFrom(String str){this.from=str;}
public void setTo(String str){this.to=str;}
public void setCc(String str){this.cc=str;}
public void setBcc(String str){this.bcc=str;}
public void setSubject(String str){this.subject=str;}
public void setBody(String str){this.body=str;}
public void setAttachments(String str){this.attachments=str;}
/*getter*/
public String getSmtp( ){return this.smtp;}
public String getUsername( ){return this.username;}
public String getPassword( ){return this.password;}
public String getFrom( ){return this.from;}
public String getTo( ){return this.to;}
public String getCc( ){return this.cc;}
public String getBcc( ){return this.bcc;}
public String getSubject( ){return this.subject;}
public String getBody( ){return this.body;}
public String getAttachments( ){return this.attachments;}
</code>
Session session = Session.getDefaultInstance(props, null);
session.setDebug(true);
try {
MimeMessage msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(mail.getFrom()));
msg.addRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false));
msg.addRecipient(Message.RecipientType.TO,new InternetAddress(mail.getTo()));
msg.addRecipient(Message.RecipientType.CC, new InternetAddress(mail.getCc()));
msg.addRecipient(Message.RecipientType.CC, new InternetAddress("[email protected]"));
msg.setSubject(mail.getSubject());
// Create the message part
BodyPart messageBodyPart = new MimeBodyPart();
// Fill the message
messageBodyPart.setText(mail.getBody());
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messageBodyPart);
// Part two is attachment
messageBodyPart = new MimeBodyPart();
DataSource source = new FileDataSource(mail.getAttachments());
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setFileName(source.getName());
multipart.addBodyPart(messageBodyPart);
msg.setContent(multipart);
msg.setSentDate(new Date());
Transport t = session.getTransport("smtp");
try {
t.connect(mail.getUsername(), mail.getPassword());
t.sendMessage(msg, msg.getAllRecipients());
} finally {
t.close();
result = result + "<FONT SIZE='4' COLOR='blue'><B>Success!</B>"+"<FONT SIZE='4' COLOR='black'> "+"<HR><FONT color='green'><B>Mail was successfully sent to </B></FONT>: "+mail.getTo()+"<BR>";
if (!("".equals(mail.getCc())))
result = result +"<FONT color='green'><B>CCed To </B></FONT>: "+mail.getCc()+"<BR>";
if (!("".equals(mail.getBcc())))
result = result +"<FONT color='green'><B>BCCed To </B></FONT>: "+mail.getBcc() ;
result = result+"<BR><HR>";
} catch (MessagingException mex) {
result = result + "<FONT SIZE='4' COLOR='blue'> <B>Error : </B><BR><HR> "+"<FONT SIZE='3' COLOR='black'>"+mex.toString()+"<BR><HR>";
} catch (Exception e) {
result = result + "<FONT SIZE='4' COLOR='blue'> <B>Error : </B><BR><HR> "+"<FONT SIZE='3' COLOR='black'>"+e.toString()+"<BR><HR>";
e.printStackTrace();
finally {
return result;
} -
Hi All,
In my BSp application user can enter long text ( can be more than 300 char ) in TextEdit.
problem is as below:
1) i am getting all the text in oninput processing ...
2) using the FM READ_TEXT to get mail template built in SO10.
3) Replacing all dynamic variables in mail template with user enterd text.
4) then passing the data to FM SO_NEW_DOCUMENT_SEND_API1. this FM has table parameter with 255 char ( please check once )
i am able to send the data in mail. But long text more than 256 char is not comming as single paragraph.
For expamle ...user enter the following text in text edit.
Responsible for the development, implementation, and maintenance of human resource information systems (HRIS) associated with the collection, retrieval, accessibility, and usage of employee information for Human Resource department planning and activities. Maintains internal database files and tables, and develops custom reports to meet the requirements of Human Resource management and staff.
in inbox i am getting as below:
Job Description for : Responsible for the development, implementation, and maintenance of human resource information systems (HRIS) associated with the collection, retrieval, accessibility, and usage of employee information for Human Resource depa
Maintains internal database files and tables, and develops custom reports to meet the requirements of Human Resource management and staff.
Job Description for is fixed text from SO10 templete. and remainning text is user text.
some data is missing in mail.
SO10 template is as below :
Job Description for : &INSTRUC1&
&INSTRUC2&
help to solve the above issue.
Regads,
Kishan
Edited by: kishanrao.sap on Oct 11, 2010 3:12 PMHi Krishna,
Please use the object_type parameter of tthe FM as 'HTM'.
Then divide the text by append them into the lines of the object_content. In the begining and end make sure you have
<p> -- in the begining
</p>-- in the end
if i want to type the text in one para " My name is Imran and i am an ABAP developer".
CLEAR: WA_OBJECT_CONTENT.
WA_OBJECT_CONTENT-line = '<html>'<body><p> My name is Imran.
APPEND WA_OBJECT_CONTENT TO T_OBJECT_CONTENT.
CLEAR WA_OBJECT_CONTENT.
WA_OBJECT_CONTENT-line = ' and i am an ABAP developer</p></body><html;>'.
APPEND WA_OBJECT_CONTENT TO T_OBJECT_CONTENT.
Hope this helps you.
Regards
Imran. -
How to send multiple attachments with the mail in jsp
hi.I wrote a code to send mail.but i need to send mail with multiple attachments.when i run this code iam able to send message but not files.i want to send files as attachments with the message.please help me.
<%@ page import="javax.mail.*,javax.mail.internet.*,java.util.Date,java.io.*,java.net.InetAddress,java.sql.*,java.util.Properties,java.net.*,javax.sql.*,javax.activation.*,java.util.*,java.text.*" %>
<%@ page import="java.io.*,java.sql.*,java.net.*,java.util.*,java.text.*" %>
<%
String Attachfiles1="";
String Attachfiles2="";
String Attachfiles3="";
if("Send".equalsIgnoreCase("send"))
try
String subject="",from="",url = null,to="";
String mailhost = "localhost";
Properties props = System.getProperties();
String msg_txt="";
String strStatus="";
String mailer = "MyMailerProgram";
to=request.getParameter("to");
from=request.getParameter("from");
subject=request.getParameter("subject");
msg_txt=request.getParameter("message");
props.put("mail.smtp.host", mailhost);
Session mailsession = Session.getDefaultInstance(props, null);
Message message = new MimeMessage(mailsession);
message.setFrom(new InternetAddress(from));
message.setRecipients(Message.RecipientType.TO,InternetAddress.parse(to, false));
message.setSubject(subject);
message.setHeader("X-Mailer", mailer);
message.setSentDate(new Date());
message.setText(msg_txt);
BodyPart messageBodyPart = new MimeBodyPart();
BodyPart messageBodyPart2 = new MimeBodyPart();
Multipart multipart = new MimeMultipart(); // to add many part to your messge
messageBodyPart = new MimeBodyPart();
javax.activation.DataSource source = new javax.activation.FileDataSource("path of the file");
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setFileName("file_name");
messageBodyPart2.setText("message"); // set the txt message
multipart.addBodyPart(messageBodyPart);
multipart.addBodyPart(messageBodyPart2);
Transport.send(message);
out.println("Message Sent");
catch (Exception e)
e.printStackTrace();
if("Attachfiles".equalsIgnoreCase("attachfiles"))
Attachfiles1=request.getParameter("fieldname1");
Attachfiles2=request.getParameter("fieldname2");
Attachfiles3=request.getParameter("fieldname3");
%>
<html>
<body>
<div class="frame">
<form action="Composemail.jsp" method="post">
<b>SelectPosition:</b> <select name="cars" >
<option value="ABAP">ABAP
<option value="saab">Saab
<option value="fiat">Fiat
<option value="audi">Audi
</select><br><br>
<table border="1" cellpadding="2" cellspacing="2">
<tr><th>Name</th>
<th>EmailId</th>
<th>ContactNumber</th>
<th>Position</th>
</tr>
<tr>
<td>
</td>
</tr>
</table><br>
<b>SelectUser :</b><select name="cars">
<option value="Administrator">Administrator
<option value="saab">Saab
<option value="fiat">Fiat
<option value="audi">Audi
</select>
<br>
<b>To :</b>�����������<input type="text" name="to" size="72"><br>
<b>From :</b>�������<input type="text" name="from" size="72"><br>
<b>Subject :</b>���<input type="text" name="subject" size="72"><br>
<%=Attachfiles1%><br><%=Attachfiles2%><br><%=Attachfiles3%><br><br>
<b>Message:</b><br>
������������<textarea rows="10" cols="50" name="message">
</textarea> <br><br>
<b>AttachedFile:</b>�<input type="file" name="fieldname1" value="filename" size="50"><br><br>
<b>AttachedFile:</b>�<input type="file" name="fieldname2" value="filename" size="50"><br><br>
<b>AttachedFile:</b>�<input type="file" name="fieldname3" value="filename" size="50"><br><br>
������������<input type="submit" name="attachfiles" value="Attachfiles">
<center>
<input type="submit" name="send" value="Send" >
</center>
</form>
</div>
</body>
</html>Most likely you're not specifying the path of a file on the server machine.
-
How to send image as a part of body with java mail
How to send image (.GIF) file in mail body & not as an attachement using java mail API
You need to create a multipart/related message.
You'll probably find examples in this forum. -
I have two phones that share an itunes acct and a notice came up this morning and I hit yes. Now I get a text everytime I send a text to the other phone. How do I turn that off?
search google for "iphone remove picture from contact"
-
How to send a text message to a group of people and save the list for next time?
how to send a text message to a group of people and save the list for next time from an iphone 4s?
Hey there ipremacha,
It sounds like you need to enable Text Message Forwarding on your iPhone for your iPad to send MMS/SMS messages through your phone.
Connect your iPhone, iPad, iPod touch, and Mac using Continuity
Go to Messages > Text Message Forwarding, and enable the device(s) you would like to forward messages to.
Your Mac, iPad, or iPod touch will display a code. Enter this code on your iPhone to verify the SMS feature.
Thank you for using Apple Support Communities.
Regards,
Sterling -
HT4993 How do you turn the weird sound off when sending a text using the iPhone 4S
How do you turn the weird sound off when sending a text using the iPhone 4S?
Go to Settings-Sounds-Text Tone and change to None. You're referring to the sound when posting a message to someone else, correct? The only issue is if you set to none, you will not hear the incoming either.
-
How to clear the send recipient history on the mail?
How to clear the send recipient history on the mail?
If you are talking about clearing the autocomplete email suggestions that are given when addressing emails, these can't be deleted without restoring your phone as new.
-
How to send purchase order via e-mail.
Please could someone let me know how to send purchase order via e-mail.
I am an BC.
e-mailing is functionning however I am not very familiar in settings for MMNo, you do not need to touch ME_PRINT_PO. You need to put code before and after ME_PRINT_PO in the print program.
Step 1 - Copy the standard print program SAPFM06P to make a Z version, lets call it ZSAPFM06P
Step 2 - Copy include FM06PE02 to make a Z version, lets call that ZFM06PE02.
Step 3 - ZSAPFM06P change the statement "Include FM06PE02" to read "Include ZFM06PE02".
Step 4 - In include ZFM06PE02 you will find a subroutine called "ENTRY_NEU". In this subroutine you will see it first calls ME_READ_PO_FOR_PRINTING then calls ME_PRINT_PO. Before it calls ME_PRINT_PO just put:
l_nast-nacha = 1.
CLEAR l_nast-dimme.
This means that ME_PRINT_PO will not e-mail, it will create a spool request.
Step 5 - Still in ZFM06PE02, after ME_PRINT_PO has been called, add new code. First check that ent_retco EQ 0. If it does not then exit.
Step 6 - Get the spool ID created by ME_PRINT_PO by either moving sy-msgv1 to a variable or select from NAST.
Step 7 - Call function CONVERT_OTFSPOOLJOB_2_PDF using the spool ID from step 6, and put the result from table PDF into an internal table you can use later. ALso store the export variable pdf_bytecount, you will need it later.
Step 8 - Call function SX_TABLE_LINE_WIDTH_CHANGE using the table from step 7 as content_in and put the results from content_out into a new internal table.
Step 9 - Add some text into a internal table of type solisti1, this will be the body text of the e-mail.
Step 10 - Add whatever receivers you want into an internal table of type somlreci1. If you just want it to go to the address that the PO would have gone to anyway, select the e-mail address from ADR6 where the address number = l_doc-xekko-adrnr, that is the data from the PO.
Step 11 - Populate an internal table of type sopcklsti1 with data relevant to your PDF table from step 8 and the text table from step 9. You will have to put the size of the PDF from step 7 (pdf_bytecount) on the PDF line and the size of the text will be the number of lines of text * 255.
Step 12 - Add info to a structure of type sodocchgi1. You can add the e-mail title in here, field obj_descr. Also add the size of the PDF and the size of the text from step 12 into doc_size, and give the doc a name in field obj_name. This can be anything, ZPDFPO for example.
Step 13 - Call SO_DOCUMENT_SEND_API1 using the tables from steps 8, 9, 10 and 11 and the structure from step 12. You can amend the sending e-mail also. Set commit_work to space.
Step 14 - That is all you need, but I actually call function RSPO_R_RDELETE_SPOOLREQ to delete the spool request created in step 4, then call NAST_PROTOCOL_UPDATE to add some more messages to the processing log of the PO.
That is all. -
How to attach a file to the mail
How to attach a file to the mail
I know that this can be done when going to any PDF program and push (send as email)
This also can done with multiple files or even with separate pages from that PDF file (Many programs can do that, like: PDF expert, Adobe Reader, iBooks, PDF Provider, Documents, etc)
But what if I begin to wright an email, then I wanted to attach a file (such as PDF, or word, or any file) , FOR BASIC APPLE MAIL IT IS UNAVAILABLE
You can attach Photo or Video but not PDF or other document
There are some email programs that can attach files to email such as my.mail (as you can see from the photo)
But why Apple don't provide such simple service ??? -
How can send a script as a mail.
Hi
this is fazil.
Please tell me any body How can send a script as a mail.
Thanks & Regards
Fazil
[email protected]Hi Fazil,
First convert your script to Smartform and then use this type of coding to mail it.
Check this code.
REPORT zptpfrm202p_pogr_pr_instr MESSAGE-ID zmm.
TABLES *
Database table made for getting information about PRINTPREVIEW and
PRINT command more than one times
TABLES: zgr_table.
TYPE-POOLS:syscr.
GLOBAL TYPE DECLARATION *
DATA: zdoc_output_info TYPE ssfcrespd, "SF:Return Document Inf.
zjob_output_info TYPE ssfcrescl, "SF:Return value at end of
form printing
i_control TYPE ssfctrlop ,
i_output_options TYPE ssfcompop,
zjob_output_opts TYPE ssfcresop. "SF:Return value at start
of form printing
*This internal table is used for storing Document Segment: Material
DATA: BEGIN OF i_mseg.
INCLUDE STRUCTURE mseg.
DATA: END OF i_mseg.
This internal table is used for storing Header: Material Document
DATA: BEGIN OF i_mkpf.
INCLUDE STRUCTURE mkpf.
DATA: END OF i_mkpf.
*Variables
DATA flag(1) TYPE c.
DATA: vfile TYPE string.
SELECTION-SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
PARAMETERS:p_mblnr TYPE mkpf-mblnr OBLIGATORY MATCHCODE OBJECT zganesh,
p_mjahr TYPE mkpf-mjahr OBLIGATORY MATCHCODE OBJECT zganesh1,
p_zeile TYPE mseg-zeile OBLIGATORY MATCHCODE OBJECT zganesh2.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 10.
PARAMETER:r_disp RADIOBUTTON GROUP g1 USER-COMMAND u1 DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 15(10) text-002 .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 10.
PARAMETERS: r_down RADIOBUTTON GROUP g1.
SELECTION-SCREEN:COMMENT 15(10) text-003.
*PARAMETERS: v_file LIKE rlgrap-filename .
*SELECTION-SCREEN:COMMENT 70(50) text-005.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 10.
PARAMETERS: r_print RADIOBUTTON GROUP g1 .
SELECTION-SCREEN:COMMENT 15(10) text-004.
SELECTION-SCREEN END OF LINE.
PARAMETERS: v_file LIKE rlgrap-filename MODIF ID g12.
SELECTION-SCREEN END OF BLOCK b2.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR v_file.
DATA : wlv_field_name LIKE dynpread-fieldname,
wlv_file_name LIKE ibipparms-path.
wlv_field_name = v_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = wlv_field_name
IMPORTING
file_name = wlv_file_name.
IF sy-subrc EQ 0.
vfile = wlv_file_name.
v_file = wlv_file_name.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'V_FILE'.
IF r_disp EQ 'X' OR r_print EQ 'X'.
screen-input = 0.
ELSE.
screen-input = '1'.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
START-OF-SELECTION EVENT *
START-OF-SELECTION.
CALLING CONVERSION FUNCTION MODULE 'CONVERSION_EXIT_ALPHA_INPUT' *
*Conversion function module for appending 00 befor MBLNR FIELD
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = p_mblnr
IMPORTING
output = p_mblnr.
Call subroutine for fetching data from database
PERFORM get_data.
END-OF-SELECTION EVENT *
END-OF-SELECTION.
Call subroutine for calling and processing smartform
PERFORM call_smartform.
*& Form get_data
Subroutine for fetching data from database
FORM get_data .
Fetching data from MKPF table with using parameters MBLNR and MJAHR
SELECT SINGLE * FROM mkpf
INTO i_mkpf
WHERE mblnr = p_mblnr
AND mjahr = p_mjahr.
IF sy-subrc EQ 0.
Fetching data from MSEG with using parameters MBLNR,ZEILE and MJAHR
SELECT SINGLE * FROM mseg
INTO i_mseg
WHERE mblnr = i_mkpf-mblnr
AND mjahr = i_mkpf-mjahr
AND zeile = p_zeile.
IF sy-subrc NE 0.
CLEAR i_mseg.
ENDIF.
ELSE.
MESSAGE i000.
EXIT.
ENDIF.
ENDFORM. " get_data
*& Form call_smartform
Subroutine for calling smartform
FORM call_smartform .
Local template used in the processing output of smartform
TYPES: BEGIN OF lt_ztable,
mandt TYPE sy-mandt,
mblnr TYPE mseg-mblnr,
flag(1) TYPE c,
END OF lt_ztable.
CONSTANTS: c_x(1) TYPE c VALUE 'X'.
Workarea
DATA: lw_ztable TYPE lt_ztable.
*Variable used in the smartform
DATA: lv_form(30) TYPE c,
lv_fm_name(30) TYPE c.
lv_form = 'ZPTPFRM202L_POGR'.
*Calling function module SSF_FUNCTION_MODULE_NAME which gives new name
*to the function module that will generated by smartform.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = lv_form
IMPORTING
fm_name = lv_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*Calling function module that will be generated by smartform
IF r_disp = c_x.
i_output_options-tdimmed = space.
i_output_options-tdnewid = c_x.
i_output_options-tddest = 'LOCL'.
i_control-no_dialog = 'X'.
i_control-preview = 'X'.
ELSEIF r_print = c_x.
i_output_options-tdimmed = c_x.
i_output_options-tddest = 'LOCL'.
i_control-no_dialog = c_x.
ELSE.
i_output_options-tdimmed = space.
i_output_options-tdnewid = c_x.
i_output_options-tddest = 'LOCL'.
i_control-getotf = 'X'.
i_control-preview = space.
i_control-no_dialog = c_x.
flag = c_x.
ENDIF.
CALL FUNCTION lv_fm_name
EXPORTING
control_parameters = i_control
output_options = i_output_options
user_settings = space
zmkpf = i_mkpf
zmseg = i_mseg
IMPORTING
document_output_info = zdoc_output_info
job_output_info = zjob_output_info
job_output_options = zjob_output_opts
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Modify the database table if it found the print command
IF zjob_output_opts-tdpreview NE c_x.
lw_ztable-mandt = sy-mandt.
lw_ztable-mblnr = p_mblnr.
lw_ztable-flag = c_x.
MODIFY zgr_table FROM lw_ztable.
CLEAR lw_ztable.
ENDIF.
IF flag EQ c_x.
DATA: li_lines LIKE tline OCCURS 100 WITH HEADER LINE.
DATA: lv_file TYPE string,
lbin_fsiz TYPE i.
lv_file = v_file.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = lbin_fsiz
TABLES
otf = zjob_output_info-otfdata
lines = li_lines
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = lbin_fsiz
filename = lv_file
filetype = 'BIN'
TABLES
data_tab = li_lines
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
ENDFORM. " call_smartform
Hope this resolves your query.
Reward all the helpful answers.
Regards
Maybe you are looking for
-
Using Field symbol to fetch data from another program
I have a requirement where i need to fetch value of a field from one of the function pool so i have written a sample progam to check the logic but its doest seems to work its giving dump. Basically i want to know how to use <programname><fieldname>
-
How can I change view options for ALL playlists?
How can I change view options for ALL playlists? With one single click or trick? I have a lot playlists and don't want to change every single one of them separatly. Thanks for your help. (I use Windows 7)
-
Developer read only account ?
Is possible to have a "developer" account that only could see the pages' code and unable to modify it ? We have some scenarios where we would appreciate this functionality: 1. One stage of our development process is "Peer Review", where an external d
-
Adobe Media Player Loop Playback
I'm playing back a .flv file created with the on2 vp6 codec question: how can I get AMP to loop playback? I looked in the playback tab under options but there is no option to set playback to loop. AMP seems to be a very "consumerish" program- this is
-
Is Logic Pro 9.1.8 stable with OS X 10.7?
I run Logic pro 9.1.8 with OSX 10.6.8 on an external hard drive and it runs smooth as anything. Very stable, never misses a beat. The reason i have an external as my boot drive is because I updated my internal drive from Snow Leopard to Mountain Lion