HTML content in Email from ALSB 2.6
HI, I am trying to send an email consistig of HTML content from ALSB 2.6.
I have set the Content-Type to 'text/HTML' and made the following assignment to $body:
<soap-env:Body>
<HTML>
<HEAD>
</HEAD>
<BODY>
<H2><center>Error in {fn:string($body/notificationmessage/servicename)} Service for Operation - {fn:string($body/notificationmessage/operationname)}</center></H2>
<p>For more details please see the logs at {fn:concat(fn:string($logfileDetails/rootlocation),fn:string($body/notificationmessage/logfilepath))}</p>
<H2>Following is the Error Message from {fn:string($body/notificationmessage/operationname)} Operation</H2>
<p>{$body/notificationmessage/faultmessage}</p>
</BODY>
</HTML>
</soap-env:Body>
But the message I receive is
<?xml version="1.0" encoding="utf-8"?>
<HTML><HEAD/><BODY><H2><center>Error in PreScreen-SFDC Service for Operation - UpdateLead</center></H2><p>For more details please see the logs at D:/SampleLogs/PreScreen-SFDC/2010/7/23/690b14f2-9a2d-41c4-8869-0d52e6cc4668_00QQ0000003wJ2bMAE_UpdateLead.log</p><H2>Following is the Error Message from UpdateLead Operation</H2><p><faultmessage><con:fault xmlns:con="http://www.bea.com/wli/sb/context"><con:errorCode>BEA-382505</con:errorCode><con:reason>ALSB Validate action failed validation</con:reason><con:details><con1:ValidationFailureDetail xmlns:con1="http://www.bea.com/wli/sb/stages/transform/config"> </con1:ValidationFailureDetail></con:details><con:location><con:node>PipelinePairNode1</con:node><con:pipeline>PipelinePairNode1_request</con:pipeline><con:stage>Validate Request</con:stage><con:path>request-pipeline</con:path></con:location></con:fault></faultmessage></p></BODY></HTML>
Can anybody please help?
Cant figure out what is the issue from your description. Can you explain what is the problem?
Similar Messages
-
Urgent help -- Printing HTML Content to printer from servlet
I am wanting know if there is a way to Print Reports from servlet.I have some idea about JPS API but it shows some errors on printer services. Pls help me, if any onme having sample code mail to me [email protected]
I want to print a html content to printer.Use the JavaScript window.print() function to print out the current window. However used the HTML LINK tag it can print out a report generated by a servlet without displaying the contents of the report in the browser window.
-
HTML Content in Email Notifications
Hi
I was wondering if HTML content is supported in BPM Email notifications. The html code in the BPM UI task email notification is coming as plain HTML in the email, can you please let me know if there is any flag that needs to be turned on to process the HTML code before the email is sent out?
Thanks
Sasii think standard notification doesn't support this.
-
Subject & Message content in emails from XI
All,
We need to send an email from the XI system. The message that we use is the following,
<target>
<name> John Doe</name><designation>manager</designation>
<name> Mary Jane</name><designation>supervisor</designation>
<name> Foo Bar</name><designation>customer associate</designation>
</target>
we need to send the email with the message body as follows,
John Doe, manager
Mary Jane, supervisor
Foo Bar, customer associate
How do we strip the xml nodes from the message? Also currently this email has a subject of "Employee New Hire Report". How can we add the current date also to this subject ("Employee New Hire Report 07/21/2007") ?
Thanks.If you requirement was only the mail with flat fields (no xml), then you could simply use Content Conversion Module (http://help.sap.com/saphelp_nw70/helpdata/en/44/748d595dab6fb5e10000000a155369/frameset.htm) before your receiver mail adapter module.
But since you have the requirement for the date in the subject, you could try to use Mail Package (check this blog for a reference: /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address).
With simple logics within your message mapping, you could have your subject with date and the content field as required (for line feeds in UDF, use "\n" character in the concatenated string).
Regards,
Henrique. -
Sending Web Dynpro table contents via Email
Hi,
I have a requirement where in I need to send an email from the Web Dynpro Application.
I am using JavaMail for this purpose. And I am able to send text messages to the required Email Id.
But my requirement is that I need to send the contents of one of the Web Dynpro table along with the text message.
Is it possible to send the table contents via mail?
Kindly let me know if there is any other approach.
Regards,
Shilpa B.VHi,
I don't think there are any methods in IWDTable or the IWDNode which can dump entire data on to something which we can pickup.
The only way is to iterate through the elements in the node and construct a big string buffer with HTML Table code and include the other part of the mail also in the same string buffer as html. Then set the MIME type of your mail to HTML and send the mail.
Check sending HTML content via email
http://java.sun.com/developer/onlineTraining/JavaMail/contents.html#ProcessingHTMLMessages
Regards
Srini -
HTML content with images and links blocked
Hello,
I very much need some help here because my company needs to send out newsletters to our clients in HTML format soon and so far the email with HTML content is being blocked as spam while text content works fine. Specifically, whenever I add a link or an image in HTML content, the email doesn't go through. I tried sending in multipart format but it is also not sending HTML with images and links. Here is my attempt:
props.setProperty("mail.transport.protocol", "smtp");
props.setProperty("mail.host", "mail.server.com");
props.setProperty("mail.user", "joeuser");
Session mailSession = Session.getDefaultInstance(props, null);
mailSession.setDebug(true);
Transport transport = mailSession.getTransport();
MimeMultipart mp = new MimeMultipart("alternative");
MimeBodyPart htmlPart = new MimeBodyPart();
MimeBodyPart textPart = new MimeBodyPart();
textPart.setText("Just to make it multipart");
htmlPart.setHeader("MIME-Version", "1.0");
htmlPart.setHeader("Content-Type", htmlPart.getContentType());
htmlPart.setContent(strHtmlMessage, "text/html");
mp.addBodyPart(textPart);
mp.addBodyPart(htmlPart);
MimeMessage message = new MimeMessage(mailSession);
message.setHeader("MIME-Version", "1.0");
message.setHeader("Content-Type", mp.getContentType());
message.setHeader("X-Mailer", "Recommend-It Mailer V2.03c02");
message.setContent(mp);
message.setSubject(strSubject);
message.setFrom(new InternetAddress("[email protected]"));
message.addRecipient(Message.RecipientType.TO,
new InternetAddress("[email protected]"));
transport.connect();
transport.sendMessage(message,
message.getRecipients(Message.RecipientType.TO));
transport.close();This code is one of my numerous attempts to make HTML send images and links. Please, let me know if there is a workaround way to make JavaMail send HTML with links and images in the message body. Your help will be greatly appreciated.The JavaMail FAQ has information on creating HTML messages, including
messages with both plain text and HTML. Did you find it?
BTW, your code has many unnecessary statements, such as setting
the Mime-Version header, which JavaMail will do for you, and setting
the Content-Type header, which JavaMail does as a side-effect of the
setContent or setText calls.
Other than that, it looks like your code should be correctly creating a
multipart/alternative message. If the recipient is still rejecting it you
need to figure out what it is about the message that makes the recipient
think it's spam. Can you send a similar message using another mailer?
Can you send the message to a different recipient? -
Fetching Dynamic email address from the HTML content sent in the email body
Hi All,
I have a scenario where in i have to send an html content via an email body . while doing so , i need to fetch the email address from the html content and send a mail to the specified email adrress in the html content .
How to fetch the email address from the html content.
Regards
Vinay P.Hi ,
Dynamic configuration means ...do i need to come up with a mapping which contains the To,From,Subject fields & all...so that when i click on the mail package in mail adapter ...this "To" email id will be fetched dynamically
Regards
Vinay P -
How to feed html content in Mail App from Indesign
Anyone knows how Martha Stewart Everday Food Magzine achieved launching the ipad Mail App filled in with HTML body content directly from their digital magazine?
At the end of each recipe, there is an email icon displayed, and when you click on it ipad mail launches with html content filled in and ready to share with a friend.
Please help
StanlyPlease refer to this, "Scenario eMail/a: Share your article text as eMail"
http://digitalpublishing.tumblr.com/tagged/Working_in_InDesign
Hope it helps.
shimoawazu -
When I forward or reply to the email from Mail, the receiver gets it as multiple attachments with no content in the mail., When I forward or reply to the email from Mail, the receiver gets it as multiple attachments with no content in the mail.
That's probably because the message is in HTML format. Send the reply as plain text.
-
Sending content in an html page via email as body
Hi
I am really in need of a prompt help for sending a web page which contains some html content as an email body.
I really have no clue about this.
I have tried searching in google but could not find any thing in java.
I have everything ready for sending an email, i.e. to, from and subject.
The only thing i need is the content from an html.
I can set the content type as text/html.
I need some help on content Id and content.
Any quick help is really appreciated.
Thank you.I have tried searching in google but could not find
any thing in java.You actually didn't. Go take a look:
http://java.sun.com/developer/EJTechTips/2004/tt0426.html#1 -
Sending Unicode HTML email from Oracle
Dear All,
How we can send the HTML email from Oracle in Unicode format (I am using Arabic Language, to be specific). So far I have tried the following solutions (using utl_smpt) without any success (either i see junk characters in the email or see question marks). Would you please help me in solving this?
Options Tried*
Option 1
SQL> ed
Wrote file afiedt.buf
1 CREATE OR REPLACE PROCEDURE p_send_mail_test (
2 sender IN VARCHAR2,
3 recipient IN VARCHAR2,
4 subj IN VARCHAR2,
5 message IN VARCHAR2)
6 IS
7 mailhost VARCHAR2(30) := '<smtp Server>';
8 c utl_smtp.connection;
9 PROCEDURE send_header( name IN VARCHAR2, header IN VARCHAR2) AS
10 BEGIN
11 utl_smtp.write_data(c, name || ': ' || header || utl_tcp.CRLF);
12 END;
13 BEGIN
14 c := utl_smtp.open_connection(mailhost,25);
15 utl_smtp.helo(c, mailhost);
16 utl_smtp.mail(c, sender);
17 utl_smtp.rcpt(c, recipient);
18 utl_smtp.open_data(c);
19 send_header('From', sender);
20 send_header('To', recipient);
21 -- If you need to send mail to more than one receipient, uncomment the
22 -- following line(s) as appropriate. Please don't forget the ","
23 -- in the "To" line before the next receipient's email id. You can't
24 -- use a comma separated list in the receipient parameter.
25 -- For variable number of "To"'s and "Cc"'s have multiple calls to
26 -- "send_header" function inside a cursor for loop.
27 -- Similar comments apply for "Cc" too.
28 -- send_header('To', ',<email@domain>');
29 send_header('Cc', ',<email@domain>');
30 send_header('Subject', subj);
31 utl_smtp.write_data(c, utl_tcp.CRLF || message);
32 utl_smtp.close_data(c);
33 utl_smtp.quit(c);
34 EXCEPTION
35 WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN
36 utl_smtp.quit(c);
37 raise_application_error(-20000,
38 'Failed to send mail due to the following error: ' || sqlerrm);
39* END;
SQL>
SQL> /
Procedure created.
SQL> ed
Wrote file afiedt.buf
1 declare
2 email_text varchar2(2000);
3 contract_end_date_v date := sysdate;
4 name_v varchar2(200) := 'Riaz';
5 begin
6 email_text :='<br/><div align="right"><font size="4"><b>السيد '||name_v||' المحترم</b><br/><br/> يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'<br/>. وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى <br/>.ولكم جزيل الشكر والتقدير </font></div>';
7 p_send_mail_test('<email@domain>','<email@domain>','Hello',email_text);
8* end;
SQL> /
PL/SQL procedure successfully completed.
Result_
<div align="right"><font size="4"><b>????? Riaz ???????</b>
???? ?????? ?????? ?? ????? ????? ??? ?????? ?????? 12-07-2011
.???? ???? ????? ???????? </font></div>
[Question marks along with all tags; this OTN page is converting that to HTML output]
Option2
SQL> ed
Wrote file afiedt.buf
1 create or replace procedure html_email(
2 p_to in varchar2,
3 p_from in varchar2,
4 p_subject in varchar2,
5 p_text in varchar2 default null,
6 p_html in varchar2 default null
7 )
8 is
9 l_boundary varchar2(255) default 'a1b2c3d4e3f2g1';
10 l_connection utl_smtp.connection;
11 l_body_html clob := empty_clob; --This LOB will be the email message
12 l_offset number;
13 l_ammount number;
14 l_temp varchar2(32767) default null;
15 l_smtp_hostname varchar2(50) := '<smtp Server>';
16 begin
17 l_connection := utl_smtp.open_connection( l_smtp_hostname, 25);
18 utl_smtp.helo( l_connection, l_smtp_hostname );
19 utl_smtp.mail( l_connection, p_from );
20 utl_smtp.rcpt( l_connection, p_to );
21 l_temp := l_temp || 'MIME-Version: 1.0' || chr(13) || chr(10);
22 l_temp := l_temp || 'To: ' || p_to || chr(13) || chr(10);
23 l_temp := l_temp || 'From: ' || p_from || chr(13) || chr(10);
24 l_temp := l_temp || 'Subject: ' || p_subject || chr(13) || chr(10);
25 l_temp := l_temp || 'Reply-To: ' || p_from || chr(13) || chr(10);
26 l_temp := l_temp || 'Content-Type: multipart/alternative; boundary=' ||
27 chr(34) || l_boundary || chr(34) || chr(13) ||
28 chr(10);
29 ----------------------------------------------------
30 -- Write the headers
31 dbms_lob.createtemporary( l_body_html, false, 10 );
32 dbms_lob.write(l_body_html,length(l_temp),1,l_temp);
33 ----------------------------------------------------
34 -- Write the text boundary
35 l_offset := dbms_lob.getlength(l_body_html) + 1;
36 l_temp := '--' || l_boundary || chr(13)||chr(10);
37 l_temp := l_temp || 'content-type: text/plain;charset=utf-8' ||
38 chr(13) || chr(10) || chr(13) || chr(10);
39 dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
40 ----------------------------------------------------
41 -- Write the plain text portion of the email
42 l_offset := dbms_lob.getlength(l_body_html) + 1;
43 dbms_lob.write(l_body_html,length(p_text),l_offset,p_text);
44 ----------------------------------------------------
45 -- Write the HTML boundary
46 l_temp := chr(13)||chr(10)||chr(13)||chr(10)||'--' || l_boundary ||
47 chr(13) || chr(10);
48 l_temp := l_temp || 'content-type: text/html;charset=utf-8' ||
49 chr(13) || chr(10) || chr(13) || chr(10);
50 l_offset := dbms_lob.getlength(l_body_html) + 1;
51 dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
52 ----------------------------------------------------
53 -- Write the HTML portion of the message
54 l_offset := dbms_lob.getlength(l_body_html) + 1;
55 dbms_lob.write(l_body_html,length(p_html),l_offset,p_html);
56 ----------------------------------------------------
57 -- Write the final html boundary
58 l_temp := chr(13) || chr(10) || '--' || l_boundary || '--' || chr(13);
59 l_offset := dbms_lob.getlength(l_body_html) + 1;
60 dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
61 ----------------------------------------------------
62 -- Send the email in 1900 byte chunks to UTL_SMTP
63 l_offset := 1;
64 l_ammount := 1900;
65 utl_smtp.open_data(l_connection);
66 while l_offset < dbms_lob.getlength(l_body_html) loop
67 utl_smtp.write_data(l_connection,
68 dbms_lob.substr(l_body_html,l_ammount,l_offset));
69 l_offset := l_offset + l_ammount ;
70 l_ammount := least(1900,dbms_lob.getlength(l_body_html) - l_ammount);
71 end loop;
72 utl_smtp.close_data(l_connection);
73 utl_smtp.quit( l_connection );
74 dbms_lob.freetemporary(l_body_html);
75* end;
SQL> /
Procedure created.
SQL> ed
Wrote file afiedt.buf
1 declare
2 email_text varchar2(2000);
3 contract_end_date_v date := sysdate;
4 name_v varchar2(200) := 'Riaz';
5 begin
6 email_text :='<br/><div align="right"><font size="4"><b>السيد '||name_v||' المحترم</b><br/><br/> يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'<br/>. وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى <br/>.ولكم جزيل الشكر والتقدير </font></div>';
7 html_email(p_to=>'<email@domain>',p_from=>'<email@domain>',p_subject=>'Hello',p_text=>'Hi', p_html=>email_text);
8* end;
SQL> /
PL/SQL procedure successfully completed.
Result*
????? Riaz ???????
???? ?????? ?????? ?? ????? ????? ??? ?????? ?????? 12-07-2011
Option3
SQL> ed
Wrote file afiedt.buf
1 create or replace procedure p_html_email_riaz(
2 p_to in varchar2,
3 p_from in varchar2,
4 p_subject in varchar2,
5 p_text in varchar2 default null,
6 p_html in varchar2 default null
7 )
8 is
9 l_boundary varchar2(255) default 'a1b2c3d4e3f2g1';
10 l_connection utl_smtp.connection;
11 l_body_html clob := empty_clob; --This LOB will be the email message
12 l_offset number;
13 l_ammount number;
14 l_temp varchar2(32767) default null;
15 l_smtp_hostname varchar2(50) := '<smtp Server>';
16 begin
17 l_connection := utl_smtp.open_connection( l_smtp_hostname, 25);
18 utl_smtp.helo( l_connection, l_smtp_hostname );
19 utl_smtp.mail( l_connection, p_from );
20 utl_smtp.rcpt( l_connection, p_to );
21 l_temp := l_temp || 'MIME-Version: 1.0' || chr(13) || chr(10);
22 l_temp := l_temp || 'To: ' || p_to || chr(13) || chr(10);
23 l_temp := l_temp || 'From: ' || p_from || chr(13) || chr(10);
24 l_temp := l_temp || 'Subject: ' || p_subject || chr(13) || chr(10);
25 l_temp := l_temp || 'Reply-To: ' || p_from || chr(13) || chr(10);
26 l_temp := l_temp || 'Content-Type: multipart/alternative; boundary=' ||
27 chr(34) || l_boundary || chr(34) || chr(13) ||
28 chr(10);
29 ----------------------------------------------------
30 -- Write the headers
31 dbms_lob.createtemporary( l_body_html, false, 10 );
32 dbms_lob.write(l_body_html,length(l_temp),1,l_temp);
33 ----------------------------------------------------
34 -- Write the text boundary
35 l_offset := dbms_lob.getlength(l_body_html) + 1;
36 l_temp := '--' || l_boundary || chr(13)||chr(10);
37 l_temp := l_temp || 'content-type: text/plain; charset=UTF-8' ||
38 chr(13) || chr(10) || chr(13) || chr(10);
39 dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
40 ----------------------------------------------------
41 -- Write the plain text portion of the email
42 /**
43 l_offset := dbms_lob.getlength(l_body_html) + 1;
44 dbms_lob.write(l_body_html,length(p_text),l_offset,p_text);
45 **/
46 ----------------------------------------------------
47 -- Write the HTML boundary
48 l_temp := chr(13)||chr(10)||chr(13)||chr(10)||'--' || l_boundary ||
49 chr(13) || chr(10);
50 l_temp := l_temp || 'content-type: text/html;' ||
51 chr(13) || chr(10) || chr(13) || chr(10);
52 l_offset := dbms_lob.getlength(l_body_html) + 1;
53 dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
54 ----------------------------------------------------
55 -- Write the HTML portion of the message
56 l_offset := dbms_lob.getlength(l_body_html) + 1;
57 dbms_lob.write(l_body_html,length(p_html),l_offset,p_html);
58 ----------------------------------------------------
59 -- Write the final html boundary
60 l_temp := chr(13) || chr(10) || '--' || l_boundary || '--' || chr(13);
61 l_offset := dbms_lob.getlength(l_body_html) + 1;
62 dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
63 ----------------------------------------------------
64 -- Send the email in 1900 byte chunks to UTL_SMTP
65 l_offset := 1;
66 l_ammount := 1900;
67 utl_smtp.open_data(l_connection);
68 while l_offset < dbms_lob.getlength(l_body_html) loop
69 utl_smtp.write_raw_data(l_connection,
70 utl_raw.cast_to_raw(
71 dbms_lob.substr(l_body_html,l_ammount,l_offset ) ) );
72 l_offset := l_offset + l_ammount ;
73 l_ammount := least(1900,dbms_lob.getlength(l_body_html) - l_ammount);
74 end loop;
75 utl_smtp.close_data(l_connection);
76 utl_smtp.quit( l_connection );
77 dbms_lob.freetemporary(l_body_html);
78* end;
SQL>
SQL> /
Procedure created.
SQL> ed
Wrote file afiedt.buf
1 declare
2 email_text varchar2(2000);
3 contract_end_date_v date := sysdate;
4 name_v varchar2(200) := 'Riaz';
5 begin
6 email_text :='<br/><div align="right"><font size="4"><b>السيد '||name_v||' المحترم</b><br/><br/> يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'<br/>. وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى <br/>.ولكم جزيل الشكر والتقدير </font></div>';
7 p_html_email_riaz(p_to=>'<email@domain>',p_from=>'<email@domain>',p_subject=>'Hello',p_text=>'Hi', p_html=>email_text);
8* end;
SQL> /
PL/SQL procedure successfully completed.
Result*
GaSmO Riaz GacMJQc
mQLl GaJ_Qc HGaZac Cd GaZ^O GaNGU H_c SmdJem HJGQmN 12-07-2011
. fZame mQL\l GaJ_\Qc HE]GOI EOGQI GacfGQO GaHTQmI ]m MGa ZOc Q[HJ_c HJLOmO GaZ^O NaGa cOI C^UeG CSHfZmd cd Gamfc fPa_ aaCecmI Ga^Ufl
.fa_c LRma GaT_Q fGaJ^OmQ
*Option4*
[code]
SQL> ed
Wrote file afiedt.buf
1 CREATE OR REPLACE PROCEDURE send_email_html_test(
2 pi_from IN Varchar,
3 pi_to IN VARCHAR,
4 pi_cc IN Varchar,
5 pi_subj IN VARCHAR,
6 pi_msg CLOB
7 )
8 IS
9 conn utl_smtp.connection;
10 lv_mailhost varchar2(1000);
11 lv_port number;
12 BEGIN
13 lv_mailhost := '<smtp Server>';
14 lv_port := 25;
15 conn := utl_smtp.open_connection(lv_mailhost, lv_port);
16 utl_smtp.helo(conn, lv_mailhost);
17 utl_smtp.mail(conn, pi_from);
18 utl_smtp.rcpt(conn, pi_to);
19 IF pi_cc is not null THEN
20 utl_smtp.rcpt(conn, pi_cc);
21 END IF;
22 utl_smtp.open_data(conn);
23 utl_smtp.write_data(conn, 'MIME-version: 1.0' || utl_tcp.CRLF);
24 utl_smtp.write_data(conn, 'Content-Type: text/html; charset=iso-8859-6' ||
25 utl_tcp.CRLF);
26 utl_smtp.write_data(conn, 'Content-Transfer-Encoding: 8bit' ||
27 utl_tcp.CRLF);
28 utl_smtp.write_data(conn, 'From:' ||pi_from || utl_tcp.CRLF);
29 utl_smtp.write_data(conn, 'To:' ||pi_to || utl_tcp.CRLF);
30 utl_smtp.write_data(conn, 'Cc:' ||pi_cc || utl_tcp.CRLF);
31 utl_smtp.write_data(conn, 'Reply-To:' ||pi_from || utl_tcp.CRLF);
32 utl_smtp.write_data(conn, 'Subject:' ||pi_subj|| utl_tcp.CRLF);
33 utl_smtp.write_data(conn, utl_tcp.crlf);
34 utl_smtp.write_raw_data(conn, utl_raw.cast_to_raw(pi_msg));
35 utl_smtp.close_data(conn);
36 utl_smtp.quit(conn);
37 EXCEPTION WHEN others THEN
38 dbms_output.put_line(sqlerrm);
39* END;
40 /
Procedure created.
SQL> ed
Wrote file afiedt.buf
1 declare
2 email_text varchar2(2000);
3 contract_end_date_v date := sysdate;
4 name_v varchar2(200) := 'Riaz';
5 begin
6 email_text :='
<div align="right"><font size="4"><b>السيد '||name_v||' المحترم</b>
يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'
. وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى
.ولكم جزيل الشكر والتقدير </font></div>';
7 send_email_html_test('<email@domain>',
8 '<email@domain>',
9 '<email@domain>',
10 'Hello',email_text);
11* end;
SQL> /
PL/SQL procedure successfully completed.
Result*
Riaz افكحترك
ٍرجٌ افترك بافغفك أل افغد افخاص بك سٍلتمٍ بتارٍخ 12-07-2011
. نغفٍم ٍرجٌ افترك بإادة إدارة افكنارد افبشرٍة ٍ حاف غدك ربتك بتجدٍد افغد خفاف كدة أصما أسبنغٍل كل افٍنك نذف ففأمكٍة افصنٌ
.نفك جزٍف افشر نافتدٍر
Option5
SQL> ed
Wrote file afiedt.buf
1 CREATE OR REPLACE PROCEDURE send_mail_test1 (p_to IN VARCHAR2,
2 p_from IN VARCHAR2,
3 p_subject IN VARCHAR2,
4 p_text_msg IN VARCHAR2 DEFAULT NULL,
5 p_html_msg IN VARCHAR2 DEFAULT NULL,
6 p_smtp_host IN VARCHAR2,
7 p_smtp_port IN NUMBER DEFAULT 25)
8 AS
9 l_mail_conn UTL_SMTP.connection;
10 l_boundary VARCHAR2(50) := '----=*#abc1234321cba#*=';
11 BEGIN
12 l_mail_conn := UTL_SMTP.open_connection(p_smtp_host, p_smtp_port);
13 UTL_SMTP.helo(l_mail_conn, p_smtp_host);
14 UTL_SMTP.mail(l_mail_conn, p_from);
15 UTL_SMTP.rcpt(l_mail_conn, p_to);
16 UTL_SMTP.open_data(l_mail_conn);
17 UTL_SMTP.write_data(l_mail_conn, 'Date: ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS') || UTL_TCP.crlf);
18 UTL_SMTP.write_data(l_mail_conn, 'To: ' || p_to || UTL_TCP.crlf);
19 UTL_SMTP.write_data(l_mail_conn, 'From: ' || p_from || UTL_TCP.crlf);
20 UTL_SMTP.write_data(l_mail_conn, 'Subject: ' || p_subject || UTL_TCP.crlf);
21 UTL_SMTP.write_data(l_mail_conn, 'Reply-To: ' || p_from || UTL_TCP.crlf);
22 UTL_SMTP.write_data(l_mail_conn, 'MIME-Version: 1.0' || UTL_TCP.crlf);
23 UTL_SMTP.write_data(l_mail_conn, 'Content-Type: multipart/alternative; boundary="' || l_boundary || '"' || UTL_TCP.crlf || UTL_TCP.crlf);
24 IF p_text_msg IS NOT NULL THEN
25 UTL_SMTP.write_data(l_mail_conn, '--' || l_boundary || UTL_TCP.crlf);
26 UTL_SMTP.write_data(l_mail_conn, 'Content-Type: text/plain; charset="utf-8"' || UTL_TCP.crlf || UTL_TCP.crlf);
27 UTL_SMTP.write_data(l_mail_conn, p_text_msg);
28 UTL_SMTP.write_data(l_mail_conn, UTL_TCP.crlf || UTL_TCP.crlf);
29 END IF;
30 IF p_html_msg IS NOT NULL THEN
31 UTL_SMTP.write_data(l_mail_conn, '--' || l_boundary || UTL_TCP.crlf);
32 UTL_SMTP.write_data(l_mail_conn, 'Content-Type: text/html; charset="utf-8"' || UTL_TCP.crlf || UTL_TCP.crlf);
33 UTL_SMTP.write_data(l_mail_conn, p_html_msg);
34 UTL_SMTP.write_data(l_mail_conn, UTL_TCP.crlf || UTL_TCP.crlf);
35 END IF;
36 UTL_SMTP.write_data(l_mail_conn, '--' || l_boundary || '--' || UTL_TCP.crlf);
37 UTL_SMTP.close_data(l_mail_conn);
38 UTL_SMTP.quit(l_mail_conn);
39* END;
SQL> /
Procedure created.
SQL> ed
Wrote file afiedt.buf
1 declare
2 email_text varchar2(2000);
3 contract_end_date_v date := sysdate;
4 name_v varchar2(200) := 'Riaz';
5 begin
6 email_text :='<br/><div align="right"><font size="4"><b>السيد '||name_v||' المحترم</b><br/><br/> يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'<br/>. وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى <br/>.ولكم جزيل الشكر والتقدير </font></div>';
7 send_mail_test1('<email@domain>',
8 '<email@domain>',
9 'Hello',
10 'msg',
11 email_text,
12 '<smtp Server>',
13 25);
14* end;
SQL> /
PL/SQL procedure successfully completed.
Result*
????? Riaz ???????
???? ?????? ?????? ?? ????? ????? ??? ?????? ?????? 12-07-2011
.???? ???? ????? ????????I worked with Oracle support and was able to find solution. The helping document ids were: 752309.1 & 404389.1
-
Hi,
I want to open the default mail client with the HTML content when I click on the button from the form.
I tried MailTo: function but in vain.Is there any other way to do it.
Please help me out.In mailto URLs, you can specify values for (some) headers as query parameters, such as Content-Type. An example for HTML would be:
Link
If the client does not support HTML composition, this will not work. Likewise, if the client does not support setting the Content-type header, it will not work.
If you want any real control over an email message, you will have to send it from your side. You might find the Mailer Tag Library useful:
http://jakarta.apache.org/taglibs/doc/mailer-doc/intro.html -
Send HTML email from C4C?
Hello Experts,
We are trying to email from the Event-BeforeSave of our BusinessPartner extension object. Emailing seems to work just fine (plain text or PDF attachment), until the moment we add HTML content.
This is the code that we currently are using:
// create email activity
elEmailRoot.Name.content = "Test HTML";
instEmail = EmailActivity.Create(elEmailRoot);
// add receiver
elEmailParty.PartyKey.PartyID.content = "<myemail>";
instEmail.MessageToParty.Create(elEmailParty);
//Create att folder
instEmailAttFld = instEmail.AttachmentFolder.Create();
//Add attachment (html body)
docName = "body.html";
doctype.content = "10001";
binaryObject.mimeCode = "text/html";
//binaryObject.content = Binary.ParseFromString( resultData.GetFirst().EmailTemplate );
binaryObject.content = Binary.ParseFromString("<html><head></head><body><div>test</div></body></html>");
instEmailAttFld.CreateFile(doctype, docName, docAltName, docDesc, binaryObject);
// send email
instEmail.Send();
Is there an error within my code or is it possible that the system is blocking HTML email? Thanks for your help!Hi Alessandro,
I can confirm that with SDK 1408 the following code works:
elActivityRoot.TypeCode = "39"; // create Email
elActivityRoot.SubjectName = "Subject";
instActivity = Activity.Create(elActivityRoot);
elActivityParty.PartyName = "[email protected]";
instActivity.MessageToParty.Create(elActivityParty);
// Create a text of type "Body Text"
instActivityAttachm = instActivity.AttachmentFolder.Create();
elActivityAttachmDoc.VisibleIndicator = true;
elActivityAttachmDoc.MIMECode = "text/html";
elActivityAttachmDoc.Name = "body.html";
elActivityAttachmDoc.AlternativeName = "body.html";
elActivityAttachmDoc.CategoryCode = "2";
elActivityAttachmDoc.TypeCode.content = "10001";
instActivityAttachm.Document.Create(elActivityAttachmDoc);
var bin = Binary.ParseFromString( "<html><head></head><body><div>test <strong>HTML</strong>mail</div></body></html>" );
var doc = instActivityAttachm.Document.GetFirst();
var filecontent = doc.FileContent.Create();
filecontent.BinaryObject.content = bin;
instActivity.Send();
Thanks for your input! -
Unable to send email from content server
Hi,
I have a requirement of sending the notification email to user from the stellent when he subscribe to it.To test it i logged in to content server as sysadmin.
Administration->Actions->Send test email.
I had filled some dummy data and when i click on send it gives me a error
Content Server Request Failed
Unable to send email. Could not send mail message from [email protected] with subject line: Test email from Content Server.
intradoc.common.ServiceException: !csMailCouldNotSend,[email protected],Test email from Content Server
at intradoc.server.InternetFunctions.sendMailToEx(Unknown Source)
at intradoc.server.SystemAuditHandler.sendEmail(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at intradoc.common.IdcMethodHolder.invokeMethod(Unknown Source)
at intradoc.common.ClassHelperUtils.executeMethodReportStatus(Unknown Source)
at intradoc.server.ServiceHandler.executeAction(Unknown Source)
at intradoc.server.Service.doCodeEx(Unknown Source)
at intradoc.server.Service.doCode(Unknown Source)
at intradoc.server.ServiceRequestImplementor.doAction(Unknown Source)
at intradoc.server.Service.doAction(Unknown Source)
at intradoc.server.ServiceRequestImplementor.doActions(Unknown Source)
at intradoc.server.Service.doActions(Unknown Source)
at intradoc.server.ServiceRequestImplementor.executeActions(Unknown Source)
at intradoc.server.Service.executeActions(Unknown Source)
at intradoc.server.ServiceRequestImplementor.doRequest(Unknown Source)
at intradoc.server.Service.doRequest(Unknown Source)
at intradoc.server.ServiceManager.processCommand(Unknown Source)
at intradoc.server.IdcServerThread.run(Unknown Source)
Caused by: intradoc.common.ServiceException:
at intradoc.common.SmtpClient.sendMail(Unknown Source)
at intradoc.server.InternetFunctions.sendMail(Unknown Source)
... 21 more
Caused by: java.lang.Exception: !csSMTPInvalidMessage,"System Administrator" <[email protected]>!csSMTPUnableToFindRecipients,1
at intradoc.common.SmtpClient.writeMultiMsg(Unknown Source)
... 23 more
Caused by: java.lang.Exception: !csSMTPResponseIndicatesFailure,550 5.7.1 Unable to relay for [email protected]
at intradoc.common.SmtpClient.writeMsg(Unknown Source)
... 24 more
I had set the internet configration in admin server to this values..
HttpServerAddress=blrdxp-rchithul.corp.capgemini.com
MailServer=BLREX002.corp.capgemini.com
[email protected]
SmtpPort=25
HttpRelativeWebRoot=/idc/
CgiFileName=idcplg
UseSSL=No
WebProxyAdminServer=true
But i am still getting the error.kindly help me...
Thanks in Advance
Regards
RakeshHi Rakesh,
You have to request you Network team to add the ip address of the machine where you have installed content server to your Exchange Server.
Let me know if it works.
Deepak -
To avoid the attachment for the body content while sending email from ABAP
SAP Version : 4.7
When i tried to send an external email from the abap report program, the body content of the mail is coming as an attachment for the same. I need to avoid this. Please give the suggestion. Am attaching the code.
DECLARATION PART *
TYPE-POOLS : SLIS.
TABLES : VBAK.
DECLARATION FOR ALV.
DATA : F_FIELD TYPE SLIS_T_FIELDCAT_ALV,
W_FIELD TYPE SLIS_FIELDCAT_ALV,
L_HEADER TYPE SLIS_T_LISTHEADER,
W_HEADER TYPE SLIS_LISTHEADER,
W_LAYOUT TYPE SLIS_LAYOUT_ALV,
t_sort type slis_t_sortinfo_alv,
w_sort type slis_sortinfo_alv.
TYPES : BEGIN OF T_VBAK,
VBELN LIKE VBAK-VBELN,
VKGRP LIKE VBAK-VKGRP,
KUNNR LIKE VBAK-KUNNR,
ERDAT LIKE VBAK-ERDAT,
VTWEG LIKE VBAK-VTWEG,
LIFSK LIKE VBAK-LIFSK,
VKBUR LIKE VBAK-VKBUR,
END OF T_VBAK.
TYPES : BEGIN OF T_VBAP,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
MATNR LIKE VBAP-MATNR,
WERKS LIKE VBAP-WERKS,
ARKTX LIKE VBAP-ARKTX,
KWMENG LIKE VBAP-KWMENG,
CUOBJ LIKE VBAP-CUOBJ,
NETWR LIKE VBAP-NETWR,
ZSCHL_K LIKE VBAP-ZSCHL_K,
KONDM LIKE VBAP-KONDM,
ZZURWN LIKE VBAP-ZZURWN,
END OF T_VBAP.
TYPES : BEGIN OF T_LIPS,
VBELN LIKE LIPS-VBELN,
POSNR LIKE LIPS-POSNR,
VGBEL LIKE LIPS-VGBEL,
VGPOS LIKE LIPS-VGPOS,
END OF T_LIPS.
TYPES : BEGIN OF T_KNA1,
KUNNR LIKE KNA1-KUNNR,
NAME1 LIKE KNA1-NAME1,
ADRNR LIKE KNA1-ADRNR,
END OF T_KNA1.
TYPES : BEGIN OF T_VBKD,
VBELN LIKE VBKD-VBELN,
POSNR LIKE VBKD-POSNR,
BSTKD LIKE VBKD-BSTKD,
BSTDK LIKE VBKD-BSTDK,
KURSK LIKE VBKD-KURSK, " CURRENCY CHECK
BZIRK LIKE VBKD-BZIRK, " SALES DISTRICT
KDGRP LIKE VBKD-KDGRP,
IHREZ LIKE VBKD-IHREZ,
END OF T_VBKD.
TYPES : BEGIN OF T_LIKP,
VBELN LIKE LIKP-VBELN,
ERDAT LIKE LIKP-ERDAT,
END OF T_LIKP.
TYPES : BEGIN OF T_ADR6,
ADDRNUMBER LIKE ADR6-ADDRNUMBER,
SMTP_ADDR LIKE ADR6-SMTP_ADDR,
END OF T_ADR6.
DATA : BEGIN OF IT_CUST OCCURS 0,
KUNNR LIKE VBAK-KUNNR,
END OF IT_CUST.
TYPES : BEGIN OF T_VBUP,
VBELN LIKE VBUP-VBELN,
POSNR LIKE VBUP-POSNR,
KOSTA LIKE VBUP-KOSTA,
WBSTA LIKE VBUP-WBSTA,
END OF T_VBUP.
TYPES : BEGIN OF T_TVLST,
LIFSP LIKE TVLST-LIFSP,
VTEXT LIKE TVLST-VTEXT,
END OF T_TVLST.
TYPES : BEGIN OF T_CONFIG.
INCLUDE STRUCTURE CONF_OUT.
TYPES : END OF T_CONFIG.
DATA : TMP LIKE VBAK-KUNNR.
DATA : NAME_TEXT LIKE THEAD-TDNAME.
DATA : TLINE1 LIKE TLINE OCCURS 0 WITH HEADER LINE.
DATA : TMP_BRAKET LIKE CONF_OUT-ATWRT,
TMP_BRAKET1 LIKE CONF_OUT-ATWRT.
DATA : BEGIN OF IT_FINAL OCCURS 0,
WERKS LIKE VBAP-WERKS,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
KUNNR LIKE VBAK-KUNNR,
NAME1 LIKE KNA1-NAME1,
VBELN1 LIKE LIKP-VBELN,
ERDAT LIKE LIKP-ERDAT,
LIFSK LIKE VBAK-LIFSK,
ZZURWN LIKE VBAP-ZZURWN,
IHREZ LIKE VBKD-IHREZ,
ERDAT1 LIKE VBAK-ERDAT,
NETWR(25) type C,
BSTKD LIKE VBKD-BSTKD,
BSTDK LIKE VBKD-BSTDK,
SALORD(17) TYPE C,
PUMP_TYPE LIKE CONF_OUT-ATWRT,
PUMP_SIZE LIKE CONF_OUT-ATWRT,
VTEXT LIKE TVLST-VTEXT,
KWMENG(25) TYPE C,
FOOTER(330) TYPE C,
ITMTXT(330) TYPE C,
END OF IT_FINAL.
DATA : IT_VBAK TYPE STANDARD TABLE OF T_VBAK,
IT_VBAP TYPE STANDARD TABLE OF T_VBAP,
IT_VBKD TYPE STANDARD TABLE OF T_VBKD,
IT_LIKP TYPE STANDARD TABLE OF T_LIKP,
IT_LIPS TYPE STANDARD TABLE OF T_LIPS,
IT_VBUP TYPE STANDARD TABLE OF T_VBUP,
IT_KNA1 TYPE STANDARD TABLE OF T_KNA1,
IT_ADR6 TYPE STANDARD TABLE OF T_ADR6,
IT_FINAL1 LIKE IT_FINAL OCCURS 0 with header line,
IT_TVLST TYPE STANDARD TABLE OF T_TVLST,
IT_CONFIG TYPE STANDARD TABLE OF T_CONFIG,
W_VBAK TYPE T_VBAK,
W_VBAP TYPE T_VBAP,
W_VBKD TYPE T_VBKD,
W_LIKP TYPE T_LIKP,
W_ADR6 TYPE T_ADR6,
W_LIPS TYPE T_LIPS,
W_VBUP TYPE T_VBUP,
W_KNA1 TYPE T_KNA1,
W_TVLST TYPE T_TVLST,
W_CONFIG TYPE T_CONFIG.
DATA: it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
w_cnt TYPE i,
w_sent_all(1) TYPE c,
w_doc_data LIKE sodocchgi1,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
SELECTION-CRITERIA *
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : R2 RADIOBUTTON GROUP G1 USER-COMMAND radio DEFAULT 'X',
R1 RADIOBUTTON GROUP G1 .
selection-screen end of block b1.
selection-screen begin of block b2 with frame title text-002.
PARAMETERS: p_email TYPE somlreci1-receiver
DEFAULT '[email protected]'.
PARAMETERS : P_VTWEG LIKE W_VBAK-VTWEG ,
P_WERKS LIKE W_VBAP-WERKS.
select-options : s_vkgrp for w_vbak-vkgrp,
s_ERDAT for w_LIKP-ERDAT.
selection-screen end of block b2.
Initialization
INITIALIZATION.
s_vkgrp-sign = 'I'.
s_vkgrp-option = 'BT'.
s_vkgrp-low = '313'.
s_vkgrp-high = '324'.
APPEND s_vkgrp.
s_erdat-sign = 'I'.
s_erdat-option = 'BT'.
s_erdat-low = '20080108'.
s_erdat-high = '20080108'.
s_erdat-low = '20070101'.
s_erdat-high = sy-datum.
APPEND s_erdat.
selection-screen validations
AT SELECTION-SCREEN.
Validation for Plant.
IF p_werks NE '7210'.
MESSAGE : 'Plant entered should be 7210' TYPE 'E'.
ENDIF.
START OF SELECTION *
start-of-selection.
GETTING THE DATA FROM THE DATABASE TABLE
PERFORM DATA_FETCH.
FILLING THE FINAL INTERNAL TABLE
PERFORM FILL_FINAL.
GETTING THE LIST FOR SENDING MAIL OR DISPLAY.
IF R1 = 'X'.
Populate table with details to be entered into .xls file
LOOP AT IT_CUST.
PERFORM build_xls_data_table using it_cust-kunnr.
ENDLOOP.
Instructs mail send program for SAPCONNECT to send email(rsconn01)
PERFORM initiate_mail_execute_program.
ELSEIF R2 = 'X'.
PERFORM LIST_DISPLAY.
ENDIF.
END OF SELECTION *
end-of-selection.
*& Form DATA_FETCH
text
--> p1 text
<-- p2 text
FORM DATA_FETCH .
SELECT VBELN
VKGRP
KUNNR
ERDAT
VTWEG
LIFSK
VKBUR
INTO TABLE IT_VBAK
FROM VBAK
WHERE VTWEG = P_VTWEG
AND VKGRP IN S_VKGRP
AND LIFSK NE ''.
IF IT_VBAK[] IS NOT INITIAL.
SELECT LIFSP
VTEXT
INTO TABLE IT_TVLST
FROM TVLST
FOR ALL ENTRIES IN IT_VBAK
WHERE LIFSP = IT_VBAK-LIFSK
AND SPRAS = 'EN'.
SELECT VBELN
POSNR
MATNR
WERKS
ARKTX
KWMENG
CUOBJ
NETWR
ZSCHL_K
KONDM
ZZURWN
INTO TABLE IT_VBAP
FROM VBAP
FOR ALL ENTRIES IN IT_VBAK
WHERE VBELN = IT_VBAK-VBELN
AND WERKS = P_WERKS.
SELECT KUNNR
NAME1
ADRNR
INTO TABLE IT_KNA1
FROM KNA1
FOR ALL ENTRIES IN IT_VBAK
WHERE KUNNR = IT_VBAK-KUNNR.
SELECT VBELN
POSNR
BSTKD
BSTDK
KURSK
BZIRK
KDGRP
INTO TABLE IT_VBKD
FROM VBKD
FOR ALL ENTRIES IN IT_VBAK
WHERE VBELN = IT_VBAK-VBELN.
ENDIF.
IF IT_VBAP[] IS NOT INITIAL.
SELECT VBELN
POSNR
VGBEL
VGPOS
INTO TABLE IT_LIPS
FROM LIPS
FOR ALL ENTRIES IN IT_VBAP
WHERE VGBEL = IT_VBAP-VBELN
AND VGPOS = IT_VBAP-POSNR.
ENDIF.
IF IT_LIPS[] IS NOT INITIAL.
SELECT VBELN
ERDAT
INTO TABLE IT_LIKP
FROM LIKP
FOR ALL ENTRIES IN IT_LIPS
WHERE VBELN = IT_LIPS-VBELN
AND ERDAT IN S_ERDAT.
SELECT VBELN
POSNR
KOSTA
WBSTA
INTO TABLE IT_VBUP
FROM VBUP
FOR ALL ENTRIES IN IT_LIPS
WHERE VBELN = IT_LIPS-VBELN
AND POSNR = IT_LIPS-POSNR
AND KOSTA EQ 'C'
AND WBSTA NE 'C'.
ENDIF.
IF IT_KNA1[] IS NOT INITIAL.
SELECT ADDRNUMBER
SMTP_ADDR
INTO TABLE IT_ADR6
FROM ADR6
FOR ALL ENTRIES IN IT_KNA1
WHERE ADDRNUMBER = IT_KNA1-ADRNR.
ENDIF.
ENDFORM. " DATA_FETCH
*& Form LIST_DISPLAY
text
--> p1 text
<-- p2 text
FORM LIST_DISPLAY .
REFRESH F_FIELD.
IF R2 = 'X'.
W_FIELD-col_pos = 1.
W_FIELD-fieldname = 'WERKS'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Plant'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 2.
W_FIELD-fieldname = 'VBELN'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Sales Order'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 3.
W_FIELD-fieldname = 'KUNNR'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Customer Code'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 4.
W_FIELD-fieldname = 'NAME1'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Customer Name'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 5.
W_FIELD-fieldname = 'VBELN1'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Delivery Number'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 6.
W_FIELD-fieldname = 'ERDAT'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Delivery Date'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 7.
W_FIELD-fieldname = 'LIFSK'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Delivery Block'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 8.
W_FIELD-fieldname = 'PUMP_TYPE'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Pump Type'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 9.
W_FIELD-fieldname = 'PUMP_SIZE'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_l = 'Pump Size'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 10.
W_FIELD-fieldname = 'ZZURWN'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Pump Srno'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 11.
W_FIELD-fieldname = 'IHREZ'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Indent No.'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 12.
W_FIELD-fieldname = 'ERDAT'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Order Booking Dt'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 13.
W_FIELD-fieldname = 'NETWR'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C710'.
W_FIELD-seltext_m = 'Net Value'.
w_field-do_sum = 'X'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 14.
W_FIELD-fieldname = 'KWMENG'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C710'.
W_FIELD-seltext_m = 'Qty'.
w_field-do_sum = 'X'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 15.
W_FIELD-fieldname = 'BSTKD'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Customer PONO'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 16.
W_FIELD-fieldname = 'BSTDK'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Customer PODT'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 17.
W_FIELD-fieldname = 'SALORD'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Sales Order/Item'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 18.
W_FIELD-fieldname = 'VTEXT'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Delivery Block Desc.'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 19.
W_FIELD-fieldname = 'FOOTER'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Footer Text'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
W_FIELD-col_pos = 20.
W_FIELD-fieldname = 'ITMTXT'.
W_FIELD-tabname = 'IT_FINAL'.
W_FIELD-emphasize = 'C410'.
W_FIELD-seltext_m = 'Item Text'.
APPEND W_FIELD TO F_FIELD.
CLEAR W_FIELD.
PERFORM SORT_FIELD.
PERFORM LAYOUT_DISPLAY.
PERFORM GRID_DISPLAY.
ENDIF.
ENDFORM. " LIST_DISPLAY
*& Form FILL_FINAL
text
--> p1 text
<-- p2 text
FORM FILL_FINAL .
REFRESH IT_FINAL.
LOOP AT IT_VBUP INTO W_VBUP.
READ TABLE IT_LIPS INTO W_LIPS WITH KEY VBELN = W_VBUP-VBELN POSNR = W_VBUP-POSNR.
READ TABLE IT_LIKP INTO W_LIKP WITH KEY VBELN = W_LIPS-VBELN.
IF SY-SUBRC EQ 0.
READ TABLE IT_VBAP INTO W_VBAP WITH KEY VBELN = W_LIPS-VGBEL POSNR = W_LIPS-VGPOS.
READ TABLE IT_VBAK INTO W_VBAK WITH KEY VBELN = W_VBAP-VBELN.
READ TABLE IT_VBKD INTO W_VBKD WITH KEY VBELN = W_VBAK-VBELN.
READ TABLE IT_KNA1 INTO W_KNA1 WITH KEY KUNNR = W_VBAK-KUNNR.
READ TABLE IT_TVLST INTO W_TVLST WITH KEY LIFSP = W_VBAK-LIFSK.
IT_FINAL-WERKS = W_VBAP-WERKS.
IT_FINAL-VBELN = W_VBAP-VBELN.
IT_FINAL-KUNNR = W_VBAK-KUNNR.
IT_FINAL-NAME1 = W_KNA1-NAME1.
IT_FINAL-VBELN1 = W_LIKP-VBELN.
IT_FINAL-ERDAT = W_LIKP-ERDAT.
IT_FINAL-LIFSK = W_VBAK-LIFSK.
IT_FINAL-ZZURWN = W_VBAP-ZZURWN.
IT_FINAL-IHREZ = W_VBKD-IHREZ.
IT_FINAL-ERDAT1 = W_VBAK-ERDAT.
IT_FINAL-NETWR = W_VBAP-NETWR.
IT_FINAL-BSTKD = W_VBKD-BSTKD.
IT_FINAL-BSTDK = W_VBKD-BSTDK.
IT_FINAL-POSNR = W_VBAP-POSNR.
IT_FINAL-VTEXT = W_TVLST-VTEXT.
IT_FINAL-KWMENG = W_VBAP-KWMENG.
CONCATENATE W_VBAP-VBELN W_VBAP-POSNR INTO IT_FINAL-SALORD SEPARATED BY '/'.
IF W_VBAP-CUOBJ NE '000000000000000000'.
REFRESH IT_CONFIG.
CALL FUNCTION 'VC_I_GET_CONFIGURATION'
EXPORTING
INSTANCE = W_VBAP-CUOBJ
LANGUAGE = SY-LANGU
TABLES
CONFIGURATION = IT_CONFIG
EXCEPTIONS
INSTANCE_NOT_FOUND = 1
INTERNAL_ERROR = 2
NO_CLASS_ALLOCATION = 3
INSTANCE_NOT_VALID = 4
OTHERS = 5.
IF SY-SUBRC = 0.
READ TABLE IT_CONFIG INTO W_CONFIG WITH KEY ATNAM = 'IN_PUMP_TYPE'.
IT_FINAL-PUMP_TYPE = W_CONFIG-ATWRT.
CLEAR W_CONFIG.
READ TABLE IT_CONFIG INTO W_CONFIG WITH KEY ATNAM = 'IN_PUMP_SIZE' .
IT_FINAL-PUMP_SIZE = W_CONFIG-ATWRT.
CLEAR W_CONFIG.
ENDIF.
ENDIF.
move w_vbap-vbeln to name_text.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'ZKT1'
language = 'E'
name = name_text
object = 'VBBK'
TABLES
lines = tline1
EXCEPTIONS
OTHERS = 8.
LOOP AT TLINE1.
CONCATENATE IT_FINAL-FOOTER TLINE1-TDLINE+0(65) INTO IT_FINAL-FOOTER.
CLEAR : TLINE1.
ENDLOOP.
clear : name_text,tline1[].
concatenate w_vbap-vbeln w_vbap-posnr into name_text.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'ZKT3'
language = 'E'
name = name_text
object = 'VBBP'
TABLES
lines = tline1
EXCEPTIONS
OTHERS = 8.
LOOP AT TLINE1.
CONCATENATE IT_FINAL-ITMTXT TLINE1-TDLINE+0(65) INTO IT_FINAL-ITMTXT.
CLEAR : TLINE1.
ENDLOOP.
APPEND IT_FINAL.
ENDIF.
CLEAR : IT_FINAL,W_VBAP,W_VBKD,W_VBUP,W_LIPS,W_LIKP,W_KNA1,W_VBAK,W_TVLST,name_text,tline1[].
ENDLOOP.
IT_FINAL1[] = IT_FINAL[].
SORT IT_FINAL1 BY KUNNR.
LOOP AT IT_FINAL1.
IF TMP NE IT_FINAL1-KUNNR.
IT_CUST-KUNNR = IT_FINAL1-KUNNR.
APPEND IT_CUST.
clear : tmp,it_cust.
TMP = IT_FINAL1-KUNNR.
ENDIF.
CLEAR : IT_FINAL1.
ENDLOOP.
ENDFORM. " FILL_FINAL
*& Form LAYOUT_DISPLAY
text
--> p1 text
<-- p2 text
FORM LAYOUT_DISPLAY .
W_LAYOUT-colwidth_optimize = 'X'.
ENDFORM. " LAYOUT_DISPLAY
*& Form GRID_DISPLAY
text
--> p1 text
<-- p2 text
FORM GRID_DISPLAY .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = W_LAYOUT
IT_FIELDCAT = F_FIELD
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = T_SORT
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_FINAL
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " GRID_DISPLAY
*& Form SORT_FIELD
text
--> p1 text
<-- p2 text
FORM SORT_FIELD .
w_sort-spos = 1.
w_sort-fieldname = 'KUNNR'.
w_sort-up = 'X'.
append w_sort to t_sort.
clear w_sort.
w_sort-spos = 2.
w_sort-fieldname = 'VBELN'.
w_sort-up = 'X'.
append w_sort to t_sort.
clear w_sort.
ENDFORM. " SORT_FIELD
*& Form TOP_OF_PAGE
text
FORM top_of_page.
IF R2 = 'X'.
REFRESH l_header.
w_header-typ = 'S'.
w_header-key = 'Delivery Block : '.
w_header-info = 'Outbound delivery created but not despatched'.
APPEND w_header TO l_header.
CLEAR w_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = l_header.
ENDIF.
ENDFORM. "TOP_OF_PAGE
*& Form BUILD_XLS_DATA_TABLE
Build data table for .xls document
FORM build_xls_data_table using custcode.
CONSTANTS: con_cret TYPE X VALUE '0D', "OK for non Unicode
con_tab TYPE x VALUE '09'. "OK for non Unicode
data : it_custcode like vbak-kunnr.
*If you have Unicode check active in program attributes thnen you will
*need to declare constants as follows
*class cl_abap_char_utilities definition load.
constants:
con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
con_cret type c value cl_abap_char_utilities=>CR_LF.
clear : it_attach,it_attach[].
CONCATENATE 'Customer PONO' 'Customer PODT' 'Sales Order No' 'Item No'
'Pump Type' 'Pump Size' 'Order Value Rs' 'Delivery No.' 'Delivery Dt.'
'Quantity' 'Reasons for not getting Despatch'
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
it_custcode = custcode.
CLEAR : W_KNA1,W_ADR6. "Code need to be added once testing is over.
READ TABLE IT_KNA1 INTO W_KNA1 WITH KEY KUNNR = IT_CUSTCODE.
READ TABLE IT_ADR6 INTO W_ADR6 WITH KEY ADDRNUMBER = W_KNA1-ADRNR.
P_EMAIL = W_ADR6-SMTP_ADDR.
LOOP AT it_final where kunnr = it_custcode.
CONCATENATE
IT_FINAL-BSTKD
IT_FINAL-BSTDK
IT_FINAL-VBELN
IT_FINAL-POSNR
IT_FINAL-PUMP_TYPE
IT_FINAL-PUMP_SIZE
IT_FINAL-NETWR
IT_FINAL-VBELN1
IT_FINAL-ERDAT
IT_FINAL-KWMENG
IT_FINAL-VTEXT
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
clear it_final.
ENDLOOP.
if R1 = 'X'.
Populate message body text
perform populate_email_message_body.
Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_message
it_attach
using p_email
'AWAITING DESPATCH CLEARANCE'
'XLS'
'Delivery_Block'
'Delivery_Blk'
'[email protected]'
'INT'
changing gd_error
gd_reciever.
endif.
ENDFORM. " BUILD_XLS_DATA_TABLE
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
FORM send_file_as_email_attachment tables pit_message
pit_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR : w_doc_data,w_cnt.
DESCRIBE TABLE it_attach LINES w_cnt.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = pit_attach[].
Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
object_header = objhead
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
Populate zerror return code
ld_error = sy-subrc.
Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
Instructs mail send program for SAPCONNECT to send email.
FORM initiate_mail_execute_program.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
*& Form POPULATE_EMAIL_MESSAGE_BODY
Populate message body text
form populate_email_message_body.
REFRESH it_message.
it_message = 'We have manufactured the pump/s against your purchase order and regret to inform'.
APPEND it_message.
it_message = 'you that same cannot be despatched for the reason/s indicated below.'.
APPEND it_message.
it_message = ' '.
APPEND it_message.
it_message = 'Please find the below attachment "Delivery_Blk.xls" for the details.'.
APPEND it_message.
it_message = ' '.
APPEND it_message.
it_message = 'We now request you to send the required detail/s by return mail/post to enable us '.
APPEND it_message.
it_message = 'to despatch the pump/s at the earliest.'.
APPEND it_message.
it_message = ' '.
APPEND it_message.
it_message = ' '.
APPEND it_message.
it_message = 'Best Regards'.
APPEND it_message.
it_message = 'O.E. ENGINEER'.
APPEND it_message.
endform. " POPULATE_EMAIL_MESSAGE_BODYHi,
Refer to the following piece of code. This is the simple code to send email with content and attachment.
Declaration
DATA: lwa_hd_change TYPE sood1,
lt_objcont TYPE STANDARD TABLE OF soli,
lwa_objcont TYPE soli,
lt_receivers TYPE STANDARD TABLE OF soos1,
lwa_receivers TYPE soos1 ,
lt_att_cont TYPE STANDARD TABLE OF soli,
lwa_att_cont TYPE soli,
lt_packing TYPE STANDARD TABLE OF soxpl,
lwa_packing TYPE soxpl,
lf_sent TYPE sonv-flag,
lf_size TYPE i.
CONSTANTS: lc_obj(11) TYPE c VALUE 'BOMSouthco',
lc_desc(20) TYPE c VALUE 'BOM Download',
lc_lang(1) TYPE c VALUE 'E',
lc_raw(3) TYPE c VALUE 'RAW',
lc_net(1) TYPE c VALUE 'U',
lc_mail(4) TYPE c VALUE 'MAIL',
lc_xls(3) TYPE c VALUE 'XLS',
lc_ext(3) TYPE c VALUE 'EXT'.
Passing values to the strutures used in SO_OBJECT_SEND function module
lwa_hd_change-objla = lc_lang.
lwa_hd_change-objnam = lc_obj.
lwa_hd_change-objdes = lc_desc.
lwa_hd_change-objlen = 255.
lwa_objcont-line = text-t29.
APPEND lwa_objcont TO lt_objcont.
CLEAR lwa_objcont.
lwa_receivers-recextnam = text-t31.
lwa_receivers-recesc = lc_net.
lwa_receivers-sndart = lc_mail.
lwa_receivers-sndex = 'X'.
lwa_receivers-sndpri = 1.
lwa_receivers-mailstatus = 'E'.
APPEND lwa_receivers TO lt_receivers.
CLEAR lwa_receivers.
lwa_receivers-recextnam = text-t30.
lwa_receivers-recesc = lc_net.
lwa_receivers-sndart = lc_mail.
lwa_receivers-sndex = 'X'.
lwa_receivers-sndpri = 1.
lwa_receivers-mailstatus = 'E'.
APPEND lwa_receivers TO lt_receivers.
CLEAR lwa_receivers.
Passing values for the attachment file
LOOP AT gt_output INTO gwa_output.
CONCATENATE gf_lf gwa_output-matnr gf_etb gwa_output-idnrk gf_etb
gwa_output-type gf_etb gwa_output-menge gf_etb
gwa_output-meins gf_etb gwa_output-comp gf_etb
INTO lwa_att_cont-line.
APPEND lwa_att_cont TO lt_att_cont.
CLEAR lwa_att_cont.
ENDLOOP.
CHECK lt_att_cont IS NOT INITIAL.
DESCRIBE TABLE lt_att_cont LINES lf_size.
lwa_packing-transf_bin = ' '.
lwa_packing-head_start = 1.
lwa_packing-head_num = 0.
lwa_packing-body_start = 1.
lwa_packing-body_num = lf_size.
lwa_packing-file_ext = lc_xls.
lwa_packing-objlen = lf_size * 255.
lwa_packing-objtp = lc_ext.
lwa_packing-objdes = lc_desc.
lwa_packing-objnam = lc_obj.
APPEND lwa_packing TO lt_packing.
CLEAR lwa_packing.
CHECK gf_error IS NOT INITIAL. "Check if unix file is written
FM to send email to the intended recipients
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
object_hd_change = lwa_hd_change
object_type = lc_raw
IMPORTING
sent_to_all = lf_sent
TABLES
objcont = lt_objcont
receivers = lt_receivers
packing_list = lt_packing
att_cont = lt_att_cont
EXCEPTIONS
active_user_not_exist = 1
communication_failure = 2
component_not_available = 3
folder_not_exist = 4
folder_no_authorization = 5
forwarder_not_exist = 6
note_not_exist = 7
object_not_exist = 8
object_not_sent = 9
object_no_authorization = 10
object_type_not_exist = 11
operation_no_authorization = 12
owner_not_exist = 13
parameter_error = 14
substitute_not_active = 15
substitute_not_defined = 16
system_failure = 17
too_much_receivers = 18
user_not_exist = 19
originator_not_exist = 20
x_error = 21
OTHERS = 22.
IF sy-subrc = 0.
MESSAGE s004 WITH text-t34.
ENDIF.
COMMIT WORK.
Reward if helpful.
Regards,
Ramya
Maybe you are looking for
-
Personal Domain doesn't work properly: Forced to type "www".
Hey, Recently upgraded to iLife '08 specifically for the Personal Domain feature. I followed the steps and got it to use my domain name from Register.com. The problem is, it only works if I type 'www' as part of the URL. Otherwise I get this error: +
-
Essbase 9.3.1 and Windows Server 2003 SP2
Is anyone successfully running Essbase 9.3.1 on Windows Server 2003 SP2 ? The documentation I have mentions only SP1, but we'd like to upgrade to SP2 providing no issues arise from doing so. thanks, Svejk
-
How To Uninstall 5.0.2 Update
I am having trouble importing MPEG2 files without the 16:9 distortion. I have tried everything on this forum and that I can think of. Someone on the forum said to uninstall the 5.0.2 update and the distortion problem will go away. How do I uninstall
-
Hello Experts, My Customer Creating the Wrong Posting Period like 01/01/2011 to 12/31/2020 and My Customer Posted the 2011 Year Transaction in this Period Now I want to Change the Posting period 01/01/2011 to 12/31/2011 then System can not allow t
-
DNG file work-around PrPro/Sg/Pro
So there are the irritations with PrPro not being able to work "natively" with the footage put out by many of the RAW -capable cameras. Yes, having the video equivalent of Adobe Camera Raw in PrPro would be wondrous. However, there is a way that seem