Professional Documents
Culture Documents
Couple of options are available in Oracle E Business, where you get use of mailing
facility directly from Oracle E Business.
Many times there is similar kind of requirement wherein we need to send the output of a
Concurrent Program as an attachment with an mail to a Distribution list, or just a
notification by email. Lets explore some of the options :
1.Options 1 :Mail_by_Unix_script
This Options is used by use of Unix script plus some steps required in oracle apps.
#!/bin/ksh
email_addr=$2@oracleappshub.com
mailx -s “$3″ $email_addr $1
exit 0
$1 is $PROFILE$.FILENAME
$2 is $PROFILES$.USERNAME
$3 is $PROFILES$.TITLE
$XX_TOP/bin/email.sh $PROFILES$.FILENAME
$PROFILES$.USERNAME $PROFILES$.TITLE
Example of above:
filedate=`date “+%m%d%y”`
senddate=`date “+%x”`
sendtime=`date “+%X”`
report=`echo $1`
title=`echo $2`
username=`echo $3`
ux2dos $report /tmp/”$username”.tmp
uuencode /tmp/”$username”.tmp “$username”.txt | mailx -ms “Oracle Report:
$title sent on $senddate at $sendtime” “$username”@oracleappshub.com
rm -f /tmp”$username”.tmp
You can define a host concurrrent program to send the output of the request in mail and
call this concurrent program in
the “after report” trigger of your report.
So once your report completes it automatically call the host concurrent program to send
the output of the report. You should
get your report concurrent program id form P_CONC_REQUEST_ID parameter and pass
it to the host file to select the output file.
The bad thing is that this options has limitation of output file is less than 32kb , if this is
case then you can use the following code in your after report trigger
BEGIN
SRW.USER_EXIT(’FND SRWEXIT’);
DECLARE
vinhandle UTL_FILE.file_type;
rfile RAW (32767);
flen NUMBER;
bsize NUMBER;
ex BOOLEAN;
vrec VARCHAR2 (30) := ‘receiver@domain.com’; –receiver’s email id
vsender VARCHAR2 (30) := ’sender@domain.com’; –sender’s email id
vsubj VARCHAR2 (50) := ’subject’; –subject
vmesg VARCHAR2 (4000);
vmtype VARCHAR2 (30) := ‘text/plain; charset=us-ascii’;
BEGIN
vmesg := ‘Please print and complete attachment’; –message
UTL_FILE.fgetattr (’CTEMP’, –name of the directory
‘o’ || :p_conc_request_id || ‘.out’, –name of the file
ex,
flen,
bsize
);
vinhandle :=
UTL_FILE.fopen (’CTEMP’, ‘o’ || :p_conc_request_id || ‘.out’,'R’);
UTL_FILE.get_raw (vinhandle, rfile, flen);
UTL_FILE.fclose (vinhandle);
utl_mail.send_attach_raw (sender => vsender
,recipients => vrec
,subject => vsubj
,MESSAGE => vmesg
,attachment => rfile
,att_inline => FALSE
,att_filename => ‘o’|| :p_conc_request_id|| ‘.out’
);
– CTEMP is a directory with path as $APPLCSF/out or your custom out folder
END;
return (TRUE);
end;
In this options you write a PL/SQL procedure which will first submit the report first
using FND_SUBMIT_REQUEST, get request_id, build the output location
FND_CONCURRENT_REQUESTS- ‘OUT_FILE’ column , subimt the host concurrent
program by passing parameters using FND_SUBMIT_REQUEST.
Third options is you can use the alerts functionality for your requirement.
You can either customize and use a predefined alert as your requirement is a generic one.
or otherwise you can define your own alert requirement.
5.Options 5
You have to setup workflow notification mailer and then you have to configure the
complete setup for your requirement
• A set of JAVA APIs that allow you to control the delivery of your XML Publisher
documents
• Facilitates the delivery of documents through “Channels”
• Printer Channel
• Fax Channel
• Email Channel
• WebDAVChannel
• Track the status of each delivery
• Redeliver documents