You are on page 1of 4

Email Options from EBS

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.

1. Write a script like , emailvendor.sh

#!/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

2.Define printer styles

3. Define a printer driver to call script in the arguments field

$XX_TOP/bin/email.sh $PROFILES$.FILENAME
$PROFILES$.USERNAME $PROFILES$.TITLE

4. Assign printer to the print styles and the driver

5. Register the e-mail printer

6. Default your report use the e-mail printer

Example of above:

Requirement is to send a report as attachment.

Assuming Printer configration 2,5 you have done in EBS.

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

2. Options 2: Report + utl_mail

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

function AfterReport return boolean is

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;

3. Options 3 : Use Pl/SQL Plus FND_CONCURRENT_REQUESTS API’s

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.

This approcah is very similar to step 1 above.

4.Options 4 : Oracle Alert

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

Use Workflow Notification mail

You have to setup workflow notification mailer and then you have to configure the
complete setup for your requirement

6.Options 6 Integrating with XML Publisher’s Delivery Manager

Another options would be Use of Java Delivery Manager APs (XDO).


What is the “Delivery Manager”

• 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

What is needed to integrate with Delivery Manager?

• Requires a developer with programming knowledge of JAVA and SQL


• XML Publisher v5.6.2 or higher
• BI Publisher v10.1.3.2

What are the steps to integrate with Delivery Manager?

1. Step # 1 -Install and configure packages


2. Step # 2 -Develop Java based classes against XML Publisher Delivery Manager
API
3. Step # 3 -Integrate Java classes with Oracle EBS

You might also like