Sei sulla pagina 1di 7

#!

/usr/bin/sh
# +==============================================================================+
# | MODULE NAME : XX_NEW_WBS.sh |
# | ORIGINAL AUTHOR : Sunil Palod |
# +==============================================================================+

WWAPPS="$1"
APPSID="$2"

# *******************************************************************
# Function to Check the validity of loginids and password.
# DO NOT MODIFY THIS SECTION
# *******************************************************************
CHKLOGIN(){
if sqlplus -s /nolog <<! >/dev/null 2>&1
WHENEVER SQLERROR EXIT 1;
CONNECT $1 ;

EXIT;
!
then
echo OK
else
echo NOK
fi
}

# **********************************************************************
# Fetch the time stamp in RRRRMMDDMISS format to concat with file names
# DO NOT MODIFY THIS SECTION
# **********************************************************************

timestamp=`date "+%Y%m%d%H%M%S"`

LOG_FILE="XX_NEW_WBS.$timestamp.log"

# *******************************************************************
# Check if WWAPPS Login Id is entered else prompt to get it
# DO NOT MODIFY THIS SECTION
# *******************************************************************
while [ "$WWAPPS" = "" -o `CHKLOGIN "$WWAPPS"` = "NOK" ]
do
if [ "$WWAPPS" = "" ];
then
echo "Enter WWAPPS Userid/Passwd: "
read WWAPPS
else
echo "Enter WWAPPS Userid/Passwd: "
WWAPPS=""
fi
done

# *******************************************************************
# Check if APPS Login Id is entered else prompt to get it
# DO NOT MODIFY THIS SECTION
# *******************************************************************
while [ "$APPSID" = "" -o `CHKLOGIN "$APPSID"` = "NOK" ]
do
if [ "$APPSID" = "" ];then
echo "Enter APPS Userid/Passwd: "
read APPSID
else
echo "Enter APPS Userid/Passwd: "
APPSID=""
fi
done
# *******************************************************************
# Check if Custom Objects copied into respective Directory or not.
# DO NOT MODIFY THIS SECTION
# *******************************************************************

handle_error()
{
if [ $? = 0 ];
then
echo "Copied file $1" >> $LOG_FILE
else
echo "Failed to copy the file $1. Program aborted." >> $LOG_FILE
exit 2
fi
}

echo "Start of script" >> $LOG_FILE

# **************************************************************************
# Create databse objects in APPS
# **************************************************************************

if sqlplus -s $APPSID @WW_PA_BUD_UPL_HDR_V.sql


then
echo "Execution of Custom Object WW_PA_BUD_UPL_HDR_V.sql successful !" >>
$LOG_FILE
else
echo "Execution of Custom Object WW_PA_BUD_UPL_HDR_V.sql Failed !" >> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if sqlplus -s $APPSID @WW_PA_PROJ_REQ_DISTRIBUTIONS_V.sql


then
echo "Execution of Custom Object WW_PA_PROJ_REQ_DISTRIBUTIONS_V.sql
successful !" >> $LOG_FILE
else
echo "Execution of Custom Object WW_PA_PROJ_REQ_DISTRIBUTIONS_V.sql Failed !"
>> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if sqlplus -s $APPSID @WW_PA_COMMITMENTS_V.sql


then
echo "Execution of Custom Object WW_PA_COMMITMENTS_V.sql successful !" >>
$LOG_FILE
else
echo "Execution of Custom Object WW_PA_COMMITMENTS_V.sql Failed !" >> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if sqlplus -s $APPSID @XX_FUNDS_CHECK_PKG.pkb


then
echo "Execution of Custom Object XX_FUNDS_CHECK_PKG.pkb successful !" >>
$LOG_FILE
else
echo "Execution of Custom Object XX_FUNDS_CHECK_PKG.pkb Failed !" >> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if sqlplus -s $APPSID @XX_EMP_PROJ_TIME.sql


then
echo "Execution of Custom Object XX_EMP_PROJ_TIME.sql successful !" >>
$LOG_FILE
else
echo "Execution of Custom Object XX_EMP_PROJ_TIME.sql Failed !" >> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if sqlplus -s $APPSID @XX_EMP_TIME.sql


then
echo "Execution of Custom Object XX_EMP_TIME.sql successful !" >> $LOG_FILE
else
echo "Execution of Custom Object XX_EMP_TIME.sql Failed !" >> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if sqlplus -s $APPSID @XX_PA_PROJECTS_EXPEND_V.sql


then
echo "Execution of Custom Object XX_PA_PROJECTS_EXPEND_V.sql successful !" >>
$LOG_FILE
else
echo "Execution of Custom Object XX_PA_PROJECTS_EXPEND_V.sql Failed !" >>
$LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if sqlplus -s $APPSID @XX_ET_PA_TASKS_V.sql


then
echo "Execution of Custom Object XX_ET_PA_TASKS_V.sql successful !" >>
$LOG_FILE
else
echo "Execution of Custom Object XX_ET_PA_TASKS_V.sql Failed !" >> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if sqlplus -s $APPSID @XX_ET_PA_PROJECTS_V.sql


then
echo "Execution of Custom Object XX_ET_PA_PROJECTS_V.sql successful !" >>
$LOG_FILE
else
echo "Execution of Custom Object XX_ET_PA_PROJECTS_V.sql Failed !" >> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if sqlplus -s $APPSID @XX_EMP_TIME_V.sql


then
echo "Execution of Custom Object XX_EMP_TIME_V.sql successful !" >> $LOG_FILE
else
echo "Execution of Custom Object XX_EMP_TIME_V.sql Failed !" >> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if sqlplus -s $APPSID @XX_EMP_PROJ_TIME_S.sql


then
echo "Execution of Custom Object XX_EMP_PROJ_TIME_S.sql successful !" >>
$LOG_FILE
else
echo "Execution of Custom Object XX_EMP_PROJ_TIME_S.sql Failed !" >> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if sqlplus -s $APPSID @XX_EMP_TIME_S.sql


then
echo "Execution of Custom Object XX_EMP_TIME_S.sql successful !" >> $LOG_FILE
else
echo "Execution of Custom Object XX_EMP_TIME_S.sql Failed !" >> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if sqlplus -s $WWAPPS @XX_FROM_WWAPPS.sql


then
echo "Execution of Custom Object XX_FROM_WWAPPS.sql successful !" >> $LOG_FILE
else
echo "Execution of Custom Object XX_FROM_WWAPPS.sql Failed !" >> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if sqlplus -s $APPSID @XX_EMP_PROJ_TIME_AD_DD.sql


then
echo "Execution of Custom Object XX_EMP_PROJ_TIME_AD_DD.sql successful !" >>
$LOG_FILE
else
echo "Execution of Custom Object XX_EMP_PROJ_TIME_AD_DD.sql Failed !" >>
$LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if sqlplus -s $APPSID @XX_EMP_TIME_AD_DD.sql


then
echo "Execution of Custom Object XX_EMP_TIME_AD_DD.sql successful !" >>
$LOG_FILE
else
echo "Execution of Custom Object XX_EMP_TIME_AD_DD.sql Failed !" >> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if sqlplus -s $APPSID @XX_EMP_PROJ_TIME_PKG.pks


then
echo "Execution of Custom Object XX_EMP_PROJ_TIME_PKG.pks successful !" >>
$LOG_FILE
else
echo "Execution of Custom Object XX_EMP_PROJ_TIME_PKG.pks Failed !" >>
$LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if sqlplus -s $APPSID @XX_EMP_TIME_PKG.pks


then
echo "Execution of Custom Object XX_EMP_TIME_PKG.pks successful !" >> $LOG_FILE
else
echo "Execution of Custom Object XX_EMP_TIME_PKG.pks Failed !" >> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if sqlplus -s $APPSID @XX_EMP_PROJ_TIME_PKG.pkb


then
echo "Execution of Custom Object XX_EMP_PROJ_TIME_PKG.pkb successful !" >>
$LOG_FILE
else
echo "Execution of Custom Object XX_EMP_PROJ_TIME_PKG.pkb Failed !" >>
$LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if sqlplus -s $APPSID @XX_EMP_TIME_PKG.pkb


then
echo "Execution of Custom Object XX_EMP_TIME_PKG.pkb successful !" >> $LOG_FILE
else
echo "Execution of Custom Object XX_EMP_TIME_PKG.pkb Failed !" >> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

# *******************************************************************
# Call to Upload the Web ADI LDT
# *******************************************************************

if FNDLOAD $APPSID O Y UPLOAD $BNE_TOP/patch/115/import/bneintegrator.lct


XX_EMP_PROJ_TIME.ldt CUSTOM_MODE=FORCE UPLOAD_MODE=REPLACE
then
echo "Installation of ldt file XX_EMP_PROJ_TIME.ldt sucessfull !" >> $LOG_FILE
else
echo "Installation of ldt file XX_EMP_PROJ_TIME.ldt Failed !" >> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if FNDLOAD $APPSID O Y UPLOAD $BNE_TOP/patch/115/import/bneintegrator.lct


XX_EMP_TIME_XINTG.ldt CUSTOM_MODE=FORCE UPLOAD_MODE=REPLACE
then
echo "Installation of ldt file XX_EMP_TIME_XINTG.ldt sucessfull !" >> $LOG_FILE
else
echo "Installation of ldt file XX_EMP_TIME_XINTG.ldt Failed !" >> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

# *******************************************************************
# Call to Upload Function
# *******************************************************************

if FNDLOAD $APPSID O Y UPLOAD $FND_TOP/patch/115/import/afsload.lct


XX_EMP_PROJ_TIME_FN.ldt
then
echo "Installation of ldt file XX_EMP_PROJ_TIME_FN.ldt successful !" >>
$LOG_FILE
else
echo "Installation of ldt file XX_EMP_PROJ_TIME_FN.ldt Failed !" >> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if FNDLOAD $APPSID O Y UPLOAD $FND_TOP/patch/115/import/afsload.lct


XX_EMP_PROJ_TIME_SE_FN.ldt
then
echo "Installation of ldt file XX_EMP_PROJ_TIME_SE_FN.ldt successful !" >>
$LOG_FILE
else
echo "Installation of ldt file XX_EMP_PROJ_TIME_SE_FN.ldt Failed !" >>
$LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

if FNDLOAD $APPSID O Y UPLOAD $FND_TOP/patch/115/import/afsload.lct


XX_EMP_TIME_FN.ldt
then
echo "Installation of ldt file XX_EMP_TIME_FN.ldt successful !" >> $LOG_FILE
else
echo "Installation of ldt file XX_EMP_TIME_FN.ldt Failed !" >> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

# *******************************************************************
# Call to Upload Lookup
# *******************************************************************

if FNDLOAD $APPSID O Y UPLOAD $FND_TOP/patch/115/import/aflvmlu.lct


XX_EMP_TIME_TYPE_LKP.ldt CUSTOM_MODE=FORCE UPLOAD_MODE=REPLACE
then
echo "Installation of ldt file XX_EMP_TIME_TYPE_LKP.ldt successful !" >>
$LOG_FILE
else
echo "Installation of ldt file XX_EMP_TIME_TYPE_LKP.ldt Failed !" >> $LOG_FILE
echo "Please check and rerun" >> $LOG_FILE
echo "Aborting......" >> $LOG_FILE
exit 1
fi

# ***********************************************************
# Copy Java Files.
# ***********************************************************

echo "Copying Classes"


cp WWEditSubmitCO.class $JAVA_TOP/wwapps/oracle/apps/icx/por/req/webui
cp WWEditSubmitCO.class
$PATCH_BASE/EBSapps/comn/java/classes/wwapps/oracle/apps/icx/por/req/webui

echo "class files copied to $JAVA_TOP/wwapps/oracle/apps/icx/por/req/webui"


echo "class files copied to
$PATCH_BASE/EBSapps/comn/java/classes/wwapps/oracle/apps/icx/por/req/webui"

echo "End of script " >> $LOG_FILE

# *******************************************************************
# End of script
# *******************************************************************

Potrebbero piacerti anche