Monday 9 November 2015

How To Register Shell Script as Concurrent Program in Oracle Apps




Shell Script

Introduction :

 This Shell Script is developed to automatically get the .ctl (Control) file and .csv (Coma separated) file for SQL Loader.

   And after successful uploading the .csv file is moved to another location.

   This will facilitate user to put .csv file of any name.

   I have registered a request in Oracle Application to call that script for data uploading. 

 

Step 1:

 Shell Script:

echo "Following are System Parameters"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
p0=$0
p1=$1
p2=$2
p3=$3
p4=$4
echo "1st System Parameter    :"$p0
echo "2nd System Parameter    :"$p1
echo "3rd System Parameter    :"$p2
echo "4th System Parameter    :"$p3
echo "5th System Parameter    :"$p4
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Following are User Parameters  "
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
u1=$5
echo "1st User Parameter    :"$u1
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
cd /home/oracle/alrazi
data_file=$(ls *.csv)
ctl_file=$(ls *.ctl)
echo $data_file
echo $ctl_file
sqlldr apps/**** control=$ctl_file data=$data_file
if [ $? -ne 0 ]
then
echo " Error Occured "
exit 1
else
mv $data_file /home/oracle/alrazi/alraziback
echo "Upload Successful"
echo "Moved File: " $data_file
echo "Successfully to Backup Folder "
exit 0
fi


 

Step 2:

save the shell script to $AP_TOP/bin as XXTEST.prog








Step 3:

create link as follows

 ln -s $FND_TOP/bin/fndcpesr XXTEST

 

Step 4:

Create Executable
 


Step 5:

Register as Concurrent Program


 


Step 6:

 Define User Parameters

 

 

Step 7:

 Run Request

 

Log file

 

No comments:

Post a Comment


No one has ever become poor by giving