Sending table using SO_NEW_DOCUMENT_SEND_API1
Dear All,
I want to display a table in the mail sent from the SAP system using the function module SO_NEW_DOCUMENT_SEND_API1.
Is there any way to do this? or Is there any other function module for doing this?
Thanks
Manik L Dhakate
Message was edited by:
Manik Dhakate
u can send mail as a Excel Atts'. please check this link.
How to Change Report in XLS Format
or check Doc_types.
Regards
Peram
Similar Messages
-
Hi All,
I am trying to send a message using the above function modules .. however .. from the beginning of the second line onwards I can see a lot of "SPACES" (leading SPACES from the second line onwards). I am concatenating the fields from an internal table having structure solisti1.
Please view 2 lines below :-
e,g.
1DETAILS OF RECORDS PROCESSED FOR FILEWORKS ON 04/17/2007
2 -
SPACES----
The following RECs are in the BDC sessionI am working in ECC 6.0 this is an internal mail to the SAP Business Workplace
This is part of the code:-
CONCATENATE 'DETAILS OF RECORDS PROCESSED FOR FILEWORKS ON' l_date INTO
itabmail2-str SEPARATED BY SPACE.
Append itabmail2.
Clear itabmail2.
form WRITE_STATUS_HEAD.
CASE itabtemp-status.
WHEN 'OK'.
CONCATENATE '' 'The following RECs are processed sucessfully'
INTO itabmail2-str SEPARATED BY w_con_tab.
WHEN 'No SSN'.
CONCATENATE '' 'The following RECs are bypassed due to invalidity'
INTO itabmail2-str SEPARATED BY w_con_tab.
WHEN 'In BDC'.
CONCATENATE '' 'The following RECs are in the BDC session'
INTO itabmail2-str SEPARATED BY w_con_tab.
ENDCASE.
APPEND itabmail2.
CLEAR itabmail2.
CONCATENATE ' ' 'SSN' 'WT 2030' 'WT 2160' 'WT 2031' 'WT 2161' 'WT 2162' 'CURR' INTO itabmail2-str
SEPARATED BY w_con_tab.
APPEND itabmail2.
CLEAR itabmail2.
endform. " WRITE_STATUS_HEAD
form send_detailed_email .
data: w_docdata like sodocchgi1 OCCURS 1 WITH HEADER LINE,"Header
t_objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE, "Att desc
t_objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE, "
t_objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE, "Body
t_objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE, "Attachment
t_objhex LIKE solix OCCURS 10 WITH HEADER LINE,
t_reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE,
w_tab_lines type i,
w_att_type(3) type c.
CLEAR: w_docdata ,w_tab_lines, w_att_type ,
t_objpack, t_objtxt, t_objbin, t_objhex, t_reclist.
REFRESH: t_objpack, t_objhead, t_objtxt, t_objbin, t_objhex,
t_reclist.
CONCATENATE 'Wageworks Details for run on ' l_date INTO w_docdata-obj_descr SEPARATED BY SPACE.
t_objtxt = 'Please Open Attachment for Details'.
Append t_objtxt.
t_reclist-receiver = 'ADCB123'.
append t_reclist.
clear t_objbin.
loop at itabmail2.
CONCATENATE itabmail2 l_con_cret INTO t_objbin.
Append t_objbin.
if itabmail2+1(5) = 'TOTAL'.
CONCATENATE '' l_con_cret INTO t_objbin.
Append t_objbin.
endif.
endloop.
DESCRIBE TABLE t_objtxt LINES w_tab_lines.
READ TABLE t_objtxt INDEX w_tab_lines.
w_docdata-doc_size = ( w_tab_lines - 1 ) * 255 + STRLEN( t_objtxt ).
CLEAR t_objpack-transf_bin.
t_objpack-head_start = 1.
t_objpack-head_num = 0.
t_objpack-body_start = 1.
t_objpack-body_num = w_tab_lines.
t_objpack-doc_type = 'XLS'.
APPEND: t_objpack, w_docdata.
CLEAR t_objpack.
DESCRIBE TABLE t_objbin LINES w_tab_lines.
READ TABLE t_objbin INDEX w_tab_lines.
CLEAR t_objpack-transf_bin.
t_objpack-doc_size = ( w_tab_lines - 1 ) * 255 + STRLEN( t_objbin ).
t_objpack-transf_bin = 'X'.
t_objpack-head_start = 1.
t_objpack-head_num = 1.
t_objpack-body_start = 1.
t_objpack-body_num = w_tab_lines.
t_objpack-doc_type = 'XLS'.
t_objpack-doc_type = 'TXT'.
t_objpack-obj_name = 'ATTACHMENT'.
t_objpack-obj_descr = 'List'.
APPEND t_objpack.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
TABLES
packing_list = t_objpack
object_header = t_objhead
contents_bin = t_objbin
contents_txt = t_objtxt
receivers = t_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
EXPORTING LIST TO MEMORY
AND RETURN.
endform. " send_detailed_email -
Please send tables used for this report.
hi
pls any one send all the tables names are used in this given report
report:
<b>Created report that display month-wise sales details by comparing with previous month and yearly sales details with selection criteria based on date.</b>
thanks in advanceHi,
Have a look at the foll. tables.
VBAP
VBAK
VAPMA
VAKPA
Regards,
Tanveer.
<b>Please mark helpful answers</b> -
Retreiving data from 2 tables using a sender JDBC Channel
Hi all,
We got anew requirement where we have to select data from 2 tables and update fields in 2 tables at the sametime.
I have a few queries regarding this.
Can we retrieve data from 2 tables using select query in sender JDBC channel?
If yes, how we can achieve this?
Can we use inner/outer joins in the select query?
Can we update field of 2 tables using the Update query in Sender JDBC channel?
Your help is greatly rewarded.
With Regards
Sudha.Hi,
Even i have the same requirement where data has to be read from 2 tables and later update the falg once done .
SELECT query :
SELECT t1.KUNNR,t1.SETT_KEY,t1.QUART_START,t1.QUART_END,t2.PAY_METH,t2.MAT_NDC,t2.AMOUNT FROM TSAP_REBATE_MEDI t1 INNER JOIN TSAP_REBATE_LINE t2 ON t1.KUNNR=t2.KUNNR AND t1.SETT_KEY=t2.SETT_KEY WHERE t1.PROCESSING_STATUS = 'N' AND t2.PROCESSING_STATUS = 'N'
This is working fine.
Can somebody help me with update query with this. where flag PROCESSING_STATUS has to be updated with 'P'.
I tried a lot but couldnt get the answer
Br,
Manoj -
Error while sending FAX using FM
Hi All,
I am trying to send fax using FM SO_NEW_DOCUMENT_SEND_API1. Fax number of format AANNNNNNNN(A-area code and N-Fax number) and passing country LAND field in receiver table AU. When program ran I can see the entry in SCOT under fax for waiting status, but when I send returns with error saying Country code not specified or incorrect fax number. Am I doing any thing wrong here? Thanks in advance and any suggestion much appreciated.
Regards,
TimHi Manohar/Prashant,
Thanks for your update. Well here is the code which i use in my interface. I havent using FM 'TELECOMMUNICATION_NUMBER_CHECK'before let me check before i post. But in mean time if you guy's see any thing in my code NOTOKAY please let me know. Thanks again for your help and let you know if it works.
Regards,
Tim
CODE BELOW
Fill the receiver list
clear gs_reclist.
gs_reclist-receiver = p_fax_number. (format 0212345678)
gs_reclist-rec_type = co_f. (F)
gs_reclist-country = co_au. (AU)
append gs_reclist to gt_reclist.
Send the document
call function 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_type = 'RAW'
document_data = gv_doc_chng
put_in_outbox = co_x
commit_work = co_x
TABLES
object_content = gt_objcont
receivers = gt_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
others = 99.
if sy-subrc eq 0.
move: co_y to c_fax.
else.
move co_n to c_fax.
endif. -
Sending Email using cl_bcs from a badi implementation
Hi,
I have written my code to send Email, inside AFTER_SAVE method of BADI Implementation of DOCUMENT_MAIN01.
Now this method of cl_bcs requires COMMIT WORK for the mail to be sent. And inside BADI implementation, we cannot write a COMMIT statement.
What is a workaround for this? While going through few other posts, I came across remote enabled FMs.
Is that the only way? Can I use some additions like STARTING NEW TASK etc. Following is the call used in case of cl_bcs:
CALL METHOD G_REF_SEND_REQUEST->SEND(
EXPORTING
I_WITH_ERROR_SCREEN = 'X'
RECEIVING
RESULT = G_SENT_TO_ALL ).
I also tried using SO_NEW_DOCUMENT_SEND_API1 STARTING NEW TASK and it works fine. But the subject length is a constraint their.
Please suggest.
Thanks in advance.Hi friend.
*& Report ZTEST_273068_EMAIL_CL_BCS
REPORT ZTEST_273068_EMAIL_CL_BCS.
CONSTANTS:
gc_subject TYPE so_obj_des VALUE 'ABAP Email with CL_BCS',
gc_raw TYPE char03 VALUE 'RAW'.
DATA:
gv_mlrec TYPE so_obj_nam,
gv_sent_to_all TYPE os_boolean,
gv_email TYPE adr6-smtp_addr,
gv_subject TYPE so_obj_des,
gv_text TYPE bcsy_text,
gr_send_request TYPE REF TO cl_bcs,
gr_bcs_exception TYPE REF TO cx_bcs,
gr_recipient TYPE REF TO if_recipient_bcs,
gr_sender TYPE REF TO cl_sapuser_bcs,
gr_document TYPE REF TO cl_document_bcs.
TRY.
"Create send request
gr_send_request = cl_bcs=>create_persistent( ).
"Email FROM...
gr_sender = cl_sapuser_bcs=>create( sy-uname ).
"Add sender to send request
CALL METHOD gr_send_request->set_sender
EXPORTING
i_sender = gr_sender.
"Email TO...
gv_email = '[email protected]'.
gr_recipient = cl_cam_address_bcs=>create_internet_address( gv_email ).
"Add recipient to send request
CALL METHOD gr_send_request->add_recipient
EXPORTING
i_recipient = gr_recipient
i_express = 'X'.
"Email BODY
APPEND 'Hello world! My first ABAP email!' TO gv_text.
gr_document = cl_document_bcs=>create_document(
i_type = gc_raw
i_text = gv_text
i_length = '12'
i_subject = gc_subject ).
"Add document to send request
CALL METHOD gr_send_request->set_document( gr_document ).
"Send email
CALL METHOD gr_send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = gv_sent_to_all ).
IF gv_sent_to_all = 'X'.
WRITE 'Email sent!'.
ENDIF.
"Commit to send email
COMMIT WORK.
"Exception handling
CATCH cx_bcs INTO gr_bcs_exception.
WRITE:
'Error!',
'Error type:',
gr_bcs_exception->error_type.
ENDTRY.
Just Execute it.
Regards,
Thrimu -
How can i display collection of records in HTML Table using DWR framework
Dear All,
Just i start using the Direct Web Remoting framework.I am worrying to get the list of records to display html table using this concept.I did the same like.
index.js
var cellFuncs = [
function(data) { return data; },
function(data) { return data.toUpperCase(); },
function(data) { return "<input type='button' value='Test' onclick='alert(\"Hi\");'/>"; },
function(data) { return count++; }
function update() {
var name = dwr.util.getValue("demoName");
Demo.sayHello(name, function(data) { dwr.util.setValue("demoReply", data); } );
var count = 1;
dwr.util.addRows( "tabs",[ 'Africa', 'America', 'Asia', 'Australasia', 'Europe' ], cellFuncs);
alert("hai");
index.jsp
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type='text/javascript' src='dwr/engine.js'> </script>
<script type='text/javascript' src='dwr/util.js'> </script>
<script type='text/javascript' src='dwr/interface/Demo.js'> </script>
<script type="text/javascript" src='index.js'> </script>
</head>
<body>
<div id="tabContents">
<div id="demoDiv">
<p>
Name:
<input type="text" id="demoName" value="Joe"/>
<input value="Send" type="button" onclick="update()"/>
Reply: <span id="demoReply" style="background:#eeffdd; padding-left:4px; padding-right:4px;"></span>
<table id="tabl1">
<tbody id="tabs">
<tr>
<td>name</td>
<td>name1</td>
<td>name2</td>
<td>name3sdf</td>
</tr>
<tbody>
</table>
</p>
</div>
</div>
</body>
</html>
dwr.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN" "http://getahead.org/dwr/dwr20.dtd">
<dwr>
<allow>
<!-- simpletext -->
<create creator="new" javascript="Demo">
<param name="class" value="org.getahead.dwrdemo.simpletext.Demo"/>
</create>
</allow>
</dwr>
web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app id="dwr">
<display-name>DWR (Direct Web Remoting)</display-name>
<description>A Simple Demo DWR</description>
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<display-name>DWR Servlet</display-name>
<description>Direct Web Remoter Servlet</description>
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>activeReverseAjaxEnabled</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>initApplicationScopeCreatorsAtStartup</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>maxWaitAfterWrite</param-name>
<param-value>500</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
</web-app>
Demo.java
package org.getahead.dwrdemo.simpletext;
import java.io.IOException;
import javax.servlet.ServletException;
import org.directwebremoting.WebContext;
import org.directwebremoting.WebContextFactory;
public class Demo
public String sayHello(String name)
return "Hello, " + name;
the sayHello() is printing the display.But the table rows not updating.But its object expected.So can you tell me where i need to change and how to add the pagination for the table like 10 by 10 records to display.
Please help me.
SaravananHi Brian,
OAF supports the master-detail based design. You can very well implement your model. You can use 2 VO for your 2 objects and link them using a ViewLink. Check OAF Dev guide for more details.
--Shiv -
How to update the data in sqlserver table using procedure in biztalkserver
Hi,
Please can any one answer this below question
how to update the data in sqlserver table using procedure in biztalkserver
while am using executescalar,typedprocedure getting some warning
Warning:The adapter failed to transmit message going to send port "SendtoSql1" with URL "mssql://nal126//MU_Stage2?". It will be retransmitted after the retry interval specified for this Send Port. Details
Please send me asap....
Thanks...Hi Messip,
A detailed error would have helped us to answer you more appropriately but
You can follow the post which has step by step instructions, to understand how to use Stored Procedure:
http://tech-findings.blogspot.in/2013/07/insert-records-in-sql-server-using-wcf.html
Maheshkumar
S Tiwari|User
Page|Blog|BizTalk
2013: Inserting RawXML (Whole Incoming XML Message) in SQL database -
Update partner function in KNVP table using FM sd_customer-maintain_all
Hi All,
I have to update Partner Function PARVW in KNVP table using FM sd_customer_maintain_all.
I had already created a BDC program for updating which is running successfully.
But my requirement is to create a BAPI using FM customermaintain_all.
Ex: Tcode VD02
KUNNR PARVW KUNN2
Old data 123 Z1 70006666
123 Z2 70007777
Req. output 123 Z1 70006666
123 Z1 70007777
PARVW Z2 should not exist after updation.
When updating, I am getting the error message to my inbox as
Error Info... F2 802: System error in table KNVP
The above error is triggered while committing work after execution of SD_CUSTOMER_MAINTAIN_ALL.
The options I tried while looping at internal table containing kunnr, parvw & kunn2
CALL FUNCTION 'SD_CUSTOMER_MAINTAIN_ALL'
EXPORTING
I_KNA1 = w_kna1
I_KNB1 =
I_KNVV = w_knvv
I_BAPIADDR1 =
I_BAPIADDR2 =
I_MAINTAIN_ADDRESS_BY_KNA1 = ' '
I_KNB1_REFERENCE = ' '
I_FORCE_EXTERNAL_NUMBER_RANGE = ' '
I_NO_BANK_MASTER_UPDATE = ' '
I_CUSTOMER_IS_CONSUMER = ' '
I_RAISE_NO_BTE = ' '
PI_POSTFLAG = 'X'
PI_CAM_CHANGED = ' '
PI_ADD_ON_DATA =
I_FROM_CUSTOMERMASTER = ' '
IMPORTING
E_KUNNR =
O_KNA1 =
E_SD_CUST_1321_DONE =
TABLES
T_XKNAS =
T_XKNBK =
T_XKNB5 =
T_XKNEX =
T_XKNVA =
T_XKNVD =
T_XKNVI =
T_XKNVK =
T_XKNVL =
T_XKNVP = I_XKNVP
T_XKNZA =
T_YKNAS =
T_YKNBK =
T_YKNB5 =
T_YKNEX =
T_YKNVA =
T_YKNVD =
T_YKNVI =
T_YKNVK =
T_YKNVL =
T_YKNVP = i_yknvp ***
T_YKNZA =
T_UPD_TXT =
EXCEPTIONS
CLIENT_ERROR = 1
KNA1_INCOMPLETE = 2
KNB1_INCOMPLETE = 3
KNB5_INCOMPLETE = 4
KNVV_INCOMPLETE = 5
KUNNR_NOT_UNIQUE = 6
SALES_AREA_NOT_UNIQUE = 7
SALES_AREA_NOT_VALID = 8
INSERT_UPDATE_CONFLICT = 9
NUMBER_ASSIGNMENT_ERROR = 10
NUMBER_NOT_IN_RANGE = 11
NUMBER_RANGE_NOT_EXTERN = 12
NUMBER_RANGE_NOT_INTERN = 13
ACCOUNT_GROUP_NOT_VALID = 14
PARNR_INVALID = 15
BANK_ADDRESS_INVALID = 16
TAX_DATA_NOT_VALID = 17
NO_AUTHORITY = 18
COMPANY_CODE_NOT_UNIQUE = 19
DUNNING_DATA_NOT_VALID = 20
KNB1_REFERENCE_INVALID = 21
CAM_ERROR = 22
OTHERS = 23.
IF sy-subrc eq 0.
Commit work and wait.
Endif.
All above tables have a field called KZ which has options
U-update
D-delete
I-insert
E- (I dont know)
Ex: T_XKNVP structure = KNVP Structure + Field KZ.
Documentation for this FM is not Available in English or German
1. I tried sending Z2 KZ as D first & Z1 with KZ as I with business partner of Z2 (KUNN2)
as single update.
Ex: T_XKNP table
KUNNR PARVW KUNN2 KZ
123 Z2 70007777 D
123 Z1 70007777 I
2. I tried it as a separate delete record and insert record i.e calling the FM twice .
3. I tried passing table T_YKNVP with old partner data + TXKNVP table new partner data
Ex: T_YKNP table
KUNNR PARVW KUNN2 KZ
123 Z2 70007777 U or space (I tried both one after another)
4. All combinations for field KZ are tried.
Please help me to overcome this problem.
I ) I need which parameters are to be passed to FM for updating partner function in KNVP table .
II) Do I need to pass structure I_KNA1 or I_KNVV to FM ? (Blank or with values corresponding to
partner function ).
III) Any sample code which can guide me.
Even a small hint or clue from you will certainly help me.
Thanks in Advance.
AJAXi have the same problem. I need to update the partner function PARVW thru a program that i created. I tried to use this FM but it didn't work. Anyone knows another FM that i can use to update the KNVP table?
-
Sending Attachments using JavaMail
I trying to send attachments using JavaMail API which is loaded into an oracle 8.1.7 database as a stored procedure, the code looks like this:-
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "SendMail" AS
import java.util.*;
import java.io.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
public class SendMail {
// Sender, Recipient, CCRecipient, and BccRecipient are comma-
// separated lists of addresses;
// Body can span multiple CR/LF-separated lines;
// Attachments is a ///-separated list of file names;
public static int Send(String SMTPServer,
String Sender,
String Recipient,
String CcRecipient,
String BccRecipient,
String Subject,
String Body,
String ErrorMessage[],
String Attachments) {
// Error status;
int ErrorStatus = 0;
// create some properties and get the default Session;
Properties props = System.getProperties();
props.put("mail.smtp.host", SMTPServer);
Session session = Session.getDefaultInstance(props, null);
try {
// create a message;
MimeMessage msg = new MimeMessage(session);
// extracts the senders and adds them to the message;
// Sender is a comma-separated list of e-mail addresses as
// per RFC822;
InternetAddress[] TheAddresses =
InternetAddress.parse(Sender);
msg.addFrom(TheAddresses);
// extract the recipients and assign them to the message;
// Recipient is a comma-separated list of e-mail addresses
// as per RFC822;
InternetAddress[] TheAddresses =
InternetAddress.parse(Recipient);
msg.addRecipients(Message.RecipientType.TO,
TheAddresses);
// extract the Cc-recipients and assign them to the
// message;
// CcRecipient is a comma-separated list of e-mail
// addresses as per RFC822;
if (null != CcRecipient) {
InternetAddress[] TheAddresses =
InternetAddress.parse(CcRecipient);
msg.addRecipients(Message.RecipientType.CC,
TheAddresses);
// extract the Bcc-recipients and assign them to the
// message;
// BccRecipient is a comma-separated list of e-mail
// addresses as per RFC822;
if (null != BccRecipient) {
InternetAddress[] TheAddresses =
InternetAddress.parse(BccRecipient);
msg.addRecipients(Message.RecipientType.BCC,
TheAddresses);
// subject field;
msg.setSubject(Subject);
// create the Multipart to be added the parts to;
Multipart mp = new MimeMultipart();
// create and fill the first message part;
MimeBodyPart mbp = new MimeBodyPart();
mbp.setText(Body);
// attach the part to the multipart;
mp.addBodyPart(mbp);
// attach the files to the message;
if (null != Attachments) {
int StartIndex = 0, PosIndex = 0;
while (-1 != (PosIndex = Attachments.indexOf("///",
StartIndex))) {
// create and fill other message parts;
MimeBodyPart mbp = new MimeBodyPart();
FileDataSource fds =
new FileDataSource(Attachments.substring(StartIndex,
PosIndex));
mbp.setDataHandler(new DataHandler(fds));
mbp.setFileName(fds.getName());
mp.addBodyPart(mbp);
PosIndex += 3;
StartIndex = PosIndex;
// last, or only, attachment file;
if (StartIndex < Attachments.length()) {
MimeBodyPart mbp = new MimeBodyPart();
FileDataSource fds =
new FileDataSource(Attachments.substring(StartIndex));
mbp.setDataHandler(new DataHandler(fds));
mbp.setFileName(fds.getName());
mp.addBodyPart(mbp);
// add the Multipart to the message;
msg.setContent(mp);
// set the Date: header;
msg.setSentDate(new Date());
// send the message;
Transport.send(msg);
} catch (MessagingException MsgException) {
ErrorMessage[0] = MsgException.toString();
Exception TheException = null;
if ((TheException = MsgException.getNextException()) !=
null)
ErrorMessage[0] = ErrorMessage[0] + "\n" +
TheException.toString();
ErrorStatus = 1;
return ErrorStatus;
show errors java source "SendMail"
CREATE OR REPLACE PACKAGE SendMailJPkg AS
-- EOL is used to separate text line in the message body;
EOL CONSTANT STRING(2) := CHR(13) || CHR(10);
TYPE ATTACHMENTS_LIST IS
TABLE OF VARCHAR2(4000);
-- high-level interface with collections;
FUNCTION SendMail(SMTPServerName IN STRING,
Sender IN STRING,
Recipient IN STRING,
CcRecipient IN STRING DEFAULT '',
BccRecipient IN STRING DEFAULT '',
Subject IN STRING DEFAULT '',
Body IN STRING DEFAULT '',
ErrorMessage OUT STRING,
Attachments IN ATTACHMENTS_LIST DEFAULT NULL)
RETURN NUMBER;
END SendMailJPkg;
show errors
CREATE OR REPLACE PACKAGE BODY SendMailJPkg AS
PROCEDURE ParseAttachment(Attachments IN ATTACHMENTS_LIST,
AttachmentList OUT VARCHAR2) IS
AttachmentSeparator CONSTANT VARCHAR2(12) := '///';
BEGIN
-- boolean short-circuit is used here;
IF Attachments IS NOT NULL AND Attachments.COUNT > 0 THEN
AttachmentList := Attachments(Attachments.FIRST);
-- scan the collection, skip first element since it has been
-- already processed;
-- accommodate for sparse collections;
FOR I IN Attachments.NEXT(Attachments.FIRST) ..
Attachments.LAST LOOP
AttachmentList := AttachmentList || AttachmentSeparator ||
Attachments(I);
END LOOP;
ELSE
AttachmentList := '';
END IF;
END ParseAttachment;
-- forward declaration;
FUNCTION JSendMail(SMTPServerName IN STRING,
Sender IN STRING,
Recipient IN STRING,
CcRecipient IN STRING,
BccRecipient IN STRING,
Subject IN STRING,
Body IN STRING,
ErrorMessage OUT STRING,
Attachments IN STRING) RETURN NUMBER;
-- high-level interface with collections;
FUNCTION SendMail(SMTPServerName IN STRING,
Sender IN STRING,
Recipient IN STRING,
CcRecipient IN STRING,
BccRecipient IN STRING,
Subject IN STRING,
Body IN STRING,
ErrorMessage OUT STRING,
Attachments IN ATTACHMENTS_LIST) RETURN NUMBER IS
AttachmentList VARCHAR2(4000) := '';
AttachmentTypeList VARCHAR2(2000) := '';
BEGIN
ParseAttachment(Attachments,
AttachmentList);
RETURN JSendMail(SMTPServerName,
Sender,
Recipient,
CcRecipient,
BccRecipient,
Subject,
Body,
ErrorMessage,
AttachmentList);
END SendMail;
-- JSendMail's body is the java function SendMail.Send();
-- thus, no PL/SQL implementation is needed;
FUNCTION JSendMail(SMTPServerName IN STRING,
Sender IN STRING,
Recipient IN STRING,
CcRecipient IN STRING,
BccRecipient IN STRING,
Subject IN STRING,
Body IN STRING,
ErrorMessage OUT STRING,
Attachments IN STRING) RETURN NUMBER IS
LANGUAGE JAVA
NAME 'SendMail.Send(java.lang.String,
java.lang.String,
java.lang.String,
java.lang.String,
java.lang.String,
java.lang.String,
java.lang.String,
java.lang.String[],
java.lang.String) return int';
END SendMailJPkg;
show errors
var ErrorMessage VARCHAR2(4000);
var ErrorStatus NUMBER;
-- enable SQL*PLUS output;
SET SERVEROUTPUT ON
-- redirect java output into SQL*PLUS buffer;
exec dbms_java.set_output(5000);
BEGIN
:ErrorStatus := SendMailJPkg.SendMail(
SMTPServerName => 'gmsmtp03.oraclecorp.com',
Sender => '[email protected]',
Recipient => '[email protected]',
CcRecipient => '',
BccRecipient => '',
Subject => 'This is the subject line: Test JavaMail',
Body => 'This is the body: Hello, this is a test' ||
SendMailJPkg.EOL || 'that spans 2 lines',
ErrorMessage => :ErrorMessage,
Attachments => SendMailJPkg.ATTACHMENTS_LIST(
'/tmp/on.lst',
'/tmp/sqlnet.log.Z'
END;
print
If I try and send file as attachments from the tmp directory, then everything works ok, but if I try to send the same file from any other directory, then it doesn't work. Can anyone help? Is there something wrong with the code, I'm not aware of anything that would make it directory specfic. Permissions are the same on /tmp as the new directory /NRS/Data/SystemX which I'm trying to send the file from now.well
if u see the end of ur mail it shows the attachment dir there in which u have specified the address..why don't u do a change there or better have some in parameteres in the procedure for it..that would help in choosing the attachment directory on users wish?
hope i am getting the problem right..if not kindly correct me in understanding the problem.
thanX. -
Hi all,
How can i get tables uses uinformation in view as hiererchy order.
example.
Table name : Employee
I want to know in which view this table is using and also other view name which is using earlier view too.
Example
1. view A is created on table Employee
2. View B is created on view A
3. View C is created on View B .
output should be
view affected for employee table
A
B
C
Thanks in advance
Tnaks & regards
Debdebasishghosh wrote:
Can you please send me the querySELECT [column list] FROM ALL_DEPENDENCIES;
What to put in [column list] is left as an exercise for the student. Clues can be found be reading the very good description of ALL_DEPENDENCIES in the fine Reference Manual.
=================================================
I don't want to be flippant or rude, but if people want to be professionals in ANY field, the first knowledge they need to acquire is how to locate AND USE+ the fundamental reference materials for that profession. And the most important trait, the one for which they are really hired, is the ability to do independent research, and having a modicum of curiosity that would drive one to do that research. We don't mind helping newbies, and even the most experienced person on this board will run into something they are not familiar with, or occasionally just require a second set of eyes to look at something. But a professional+ needs, above all, a willingness and capability to check the docs. A professional isn't necessarily someone who has all the answers at their fingertips or has a full understanding about every arcane subject in their field. It certainly isn't someone who has an encyclopedia full of memorized answers but little understanding of how it all fits together. It's someone who knows where to find the answers when needed, how to recognize them when he sees them. It's less about knowing than it is about attitude. Everything you asked can be answered in the Oracle Concepts Manual at tahiti.oracle.com. You should bookmark that site. You were told the name of the view that has the information you seek. It is not an unreasonable assumption that anyone who comes to this forum knows how to write simple SQL. It is also NOT unreasonable to expect a a professional to be able to take a clue like that and use it. A professional does NOT expect to be spoon-fed everything.
=================================================
Learning how to look things up in the documentation is time well spent investing in your career. To that end, you should drop everything else you are doing and do the following:
Go to tahiti.oracle.com.
Drill down to your product and version.
<b><i><u>BOOKMARK THAT LOCATION</u></i></b>
Spend a few minutes just getting familiar with what is available here. Take special note of the "books" and "search" tabs. Under the "books" tab you will find the complete documentation library.
Spend a few minutes just getting familiar with what <b><i><u>kind</u></i></b> of documentation is available there by simply browsing the titles under the "Books" tab.
Open the Reference Manual and spend a few minutes looking through the table of contents to get familiar with what <b><i><u>kind</u></i></b> of information is available there.
Do the same with the SQL Reference Manual.
Do the same with the Utilities manual.
You don't have to read the above in depth. They are <b><i><u>reference</b></i></u> manuals. Just get familiar with <b><i><u>what</b></i></u> is there to <b><i><u>be</b></i></u> referenced. Ninety percent of the questions asked on this forum can be answered in less than 5 minutes by simply searching one of the above manuals.
Then set yourself a plan to dig deeper.
- Read a chapter a day from the Concepts Manual.
- Take a look in your alert log. One of the first things listed at startup is the initialization parms with non-default values. Read up on each one of them (listed in your alert log) in the Reference Manual.
- Take a look at your listener.ora, tnsnames.ora, and sqlnet.ora files. Go to the Network Administrators manual and read up on everything you see in those files.
- When you have finished reading the Concepts Manual, do it again.
Give a man a fish and he eats for a day. Teach a man to fish and he eats for a lifetime.
================================= -
How to Ftp a Blob attachment in a table using osb service
How to Ftp a Blob attachment in a table using osb service
I tried with DBadapter select it does not work ... For blob objects cant use select throws error as expected number got blob
can call a stored procedure to write the file to some directory but that file will not be created with the same name of the file as stored in DB .. need to hard code the filename in utl file or if we pass a variable to get the name of the attachment file we have to use select query in cursor which throws error like above in step 2
Can some body tell me how to get the blob attachment with the same name as it is stored in DB table
Edited by: user13745573 on Jan 31, 2011 4:35 AMHi,
I want to send an attachment through email.
But I want to pick the file from say local drive then how can i specify the path of the file in file name.
Also, i dont want ot append the conent from payload to the file. i wanted to sendthe file as is.
<ema:attachment>
<ema:name></ema:name>
<ema:type>text/plain</ema:type>
<ema:content/>
</ema:attachment>
Please help. -
Multipe Sender RFC using same Program ID
Hi all,
I have RFC>XI>HTTP scenario. All confiruation has been done in R/3 and XI has ben done correctly.
Is it possible to use the same TCP/IP port Program ID created in SM59 (in R/3) for sending different RFC messages to XI. Meaning, in different XI RFC sender adapter communication channels, can I use the same Program ID.
When I tried, it work for one RFC, but when multiple RFC sender adapter uses same program ID..RFC program errors out in R/3 itself with error message - Commit fault: com.sap.aii.af.rfc.afcommunication.RfcChannelMismatchExcept.
Please help.
Thanks
KarthikKarthik,
It is possible to send different messages from R3 to XI that use the one RFC destination and Program ID (in R/3) and the one Communication channel (in XI)
Assume that interfaces AAA and BBB have different structures
<u><b>SAP R/3</b></u>
<b>For interface AAA</b>
(1) Execute ABAP Z_AAA which
(2) Populates the internal table ITAB_AAA with structure ZST_AAA
(3) Calls the remote enabled function ZFN_AAA
(4) Passes the interface data in the tables statement
CALL FUNCTION 'ZFN_AAA' DESTINATION RFCCOMMON
EXPORTING
=
IMPORTING
=
TABLES
AAA = ITAB_AAA.
<b>For interface BBB</b>
(1) Eexecute ABAP Z_BBB which
(2) Populates the internal table ITAB_BBB with structure ZST_BBB
(3) Calls the remote enabled function ZFN_BBB
(4) Passes the interface data in the tables statement
CALL FUNCTION 'ZFN_BBB' DESTINATION RFCCOMMON
EXPORTING
=
IMPORTING
=
TABLES
BBB = ITAB_BBB.
Each function is called with the same destination RFCCOMMON
In SM59 point the RFC destination RFCCOMMON to your XI environment and provide a program id, for example ID_COMMON
<i><b>XI</b></i>
<b>(1) Configure the sender RFC Communication Channel</b> for example CC_COMMON and enter your SAP R/3 server parameters to include the program id ID_COMMON
<b>(2) Configure the Receiver Determinations</b> as follows
For interface AAA
Sender Service Enter your SAP R3 Business System for example R3PROD Interface ZFN_AAA (this is the SAP R/3 remote function)
Namespace urn:sap-com:document:sap:rfc:functions
Configured Receivers
Service Integration Process AAA
For interface BBB
Sender Service Enter your SAP R3 Business System for example R3PROD
Interface ZFN_BBB (this is the SAP R/3 remote function)
Namespace urn:sap-com:document:sap:rfc:functions
Configured Receivers
Service Integration Process BBB
<b>(3) Configure the Sender Agreement</b> as follows
For interface AAA
Sender Service R3PROD
Interface ZFN_AAA
Namespace urn:sap-com:document:sap:rfc:functions
Sender CC CC_COMMON
For interface BBB
Sender Service R3PROD
Interface ZFN_BBB
Namespace urn:sap-com:document:sap:rfc:functions
Sender CC CC_COMMON
Regards,
Mike -
Hi,
I built the text(Body) of the mail with 19 lines. But while triggering through workflow the last 3 lines of the body displayed in the same line instead of different line. I used SO_NEW_DOCUMENT_SEND_API1 function module for mail sending activity,
Can anybody experienced this kind of problems earlier? If so please kindly help me to sort out this asap. Useful responses will be rewarded.
Thanks in advance.Hi
I have used this function module to send mail.
SO_NEW_DOCUMENT_SEND_API1
I have not problem and not found any duplicate entries.
Please send your piece of code where you are adding text line.
It may happened because of not clearing the memory values.
Rgds,
Sriram -
Send mail using CL_BCS through function module, run in background task.
Hi,
I am running a function module in Background task. in this function module I am sending mail using CL_BCS class.
but mail is not generated. if I run the same function Module in foreground mail generated successfully....
can anyone please tell me the reason behind this.Hi i realise that The LIST_TO_ASCII thing is not working correctly in background because the the list-processing in beckground is working not the same as in dialog i think.
I can only get the last page of the list out when running in background. Any solution to this?
my code:
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
list_index = sy-lsind
TABLES
list_dyn_ascii = downtab
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
IF sy-subrc NE 0.
EXIT.
ENDIF.
Thanks ,
LH
Maybe you are looking for
-
Float value displaying incorrectly in Matrix
Hi, I am working with a Matrix that uses a Data Table as a Data Source. The Data Table is populated with a query that combines rows from the AP Invoice and AP Credit Notes tables. The matrix columns all appear to be binding correctly to their respe
-
JTree: How to get the currently selected node
How do I get the currently selected node in JTree? getLastSelectedPathComponent() this method always return the last selected node and not the current one. Thanks in advance Sachin
-
Deploying a report that must run at customer site...
I have a report that needs to run at a clients site (PC) and was looking at the runtime installs available for version 10. Is this the best method to distribute a design that uses data on site but the client does not have crystal reports? Any Ideas
-
Hi, We have recently installed the Oracle9iAS R2 and our portal tool is up and running. Bud how do I integrate the 9iAS discoverer into portal environment? I checked the otn.oracle.com website and found some docs, but links are not working. Any help?
-
At a recent educators conference there was a bit of a disagreement over sharpening in LR or ACR (assuming a primarily RAW workflow). The presenters stance was don't use it, jump out into PS and do your sharpening there. I took the other stance, but t