Thursday, 29 December 2016

Custom OAF code deployment to Run edition in 12.2.X


Steps to deploy custom OAF code to run edition (assuming that custom OAF code is under $JAVA_TOP/xxcust.

1. Login into instance and source to "Run edition"
2. Go to $JAVA_TOP
3. Take backup of  customall.jar
4. Run adcgnjar command. Just enter adcgnjar and then enter
5. Provide DB apps password.
6. Then go to $ADMIN_SCRIPTS_HOME and bounce OA core on Weblogic
admanagedsrvctl.sh stop oacore_server1
admanagedsrvctl.sh start oacore_server1


BI Publisher useful snippets



1. xdofx vs xdoxslt
<?xdofx:expression?> for extended SQL functions
<?xdoxslt:expression?> for extended XSL functions.

You cannot mix xdofx statements with XSL expressions in the same context


Number-To-Word Conversion


<?xdofx:to_check_number(amount, precisionOrCurrency, caseType, decimalStyle)?>
amount  --> The number to be transformed. --> Any number

precisionOrCurrency -->  For this attribute you can specify either the precision, which is the number of digits after the decimal point; or the currency code, which governs the number of digits after the decimal point. The currency code does not generate a currency symbol in the output. --> An integer, such as 2; or a currency code, such as 'USD'.


caseType  --> The case type of the output. --> Valid values are: 'CASE_UPPER', 'CASE_LOWER', 'CASE_INIT_CAP'


decimalStyle --> Output type of the decimal fraction area. --> Valid values are: 'DECIMAL_STYLE_FRACTION1', 'DECIMAL_STYLE_FRACTION2', 'DECIMAL_STYLE_WORD'

Examples:
<?xdofx:to_check_number(12345.67, 2)?>

Twelve thousand three hundred forty-five and 67/100



<?xdofx:to_check_number(12345.67, 'USD')?>

Twelve thousand three hundred forty-five and 67/100

<?xdofx:to_check_number(12345, 'JPY', 'CASE_UPPER')?>

TWELVE THOUSAND THREE HUNDRED FORTY-FIVE

<?xdofx:to_check_number(12345.67, 'EUR', 'CASE_LOWER', 'DECIMAL_STYLE_WORDS')?>
twelve thousand three hundred forty-five and sixty-seven

2.

Download FND new messages in Other langauges


To download the FND new messages in other languages, first we need to set the NLS lang.

To get the correct setting query FND_LANGUAGES as below

Find the language from FND_LANGUAGES

select NlS_LANGUAGE||'_'||NLS_TERRITORY||'.'||NLS_CODESET from FND_LANGUAGES WHERE INSTALLED_FLAG IN ('I','B');

For example for Simplified Chinese use:

For Download:
$ export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16CGB231280"

$ FNDLOAD apps/<AppsPwd> Y DOWNLOAD$FND_TOP/patch/115/import/afmdmsg.lct  FND_NEW_MESSAGES APPLICATION_SHORT_NAME=XXCUST MESSAGE_NAME=XXCUSTMSG

For Upload:
Note: Do not set any nls lang varaible.. if you have previously alter NLS LANG then disconnect from session and then do upload
FNDLOAD apps/<Apps Password> 0 Y UPLOAD $FND_TOP/patch/115/import/afmdmsg.lct XXCUSTMSG_MSG_ZHS.ldt - UPLOAD_MODE=NLS CUSTOM_MODE=FORCE WARNINGS=TRUE

Workflow translation


Introduction:

Recently came across a situation, where in we need to translate workflow notifications to Simplified Chinese. We evaluated multiple methods 

Approach 1:
  1. Set the NLS_LANG on the desktop and edit the workflow  and update messages with Chinese translations.
  2.  Remove all standard and flex fields workflow from the current definition.
  3.  Set NLS_LANG to ”SIMPLIFIED CHINESE_CHINA”.ZHS16GBK and then upload the workflow using WFLOAD

Approach 2:
1.       Open the workflow in notepad and set the language to ZHS.
2.       Remove all standard and flex fields workflow from the current definition
3.       Update message subject and body with Chinese translations
4.       Set NLS_LANG
5.       Upload the .wft using FNDLOAD and using afwfload.lct

Approach 3:
1.       Give a SQL script to update subject and body columns of WF_MESSAGES_TL for ZHS language as we are only translating the messages and not changing any other part.

Finally we went with approach 3 as it is simple and just we need notifications in simplified Chinese but instead of simple update we went with API approach. Here are the steps..


---First, set the session language:
execute immediate 'alter session set nls_language='||''''||'SIMPLIFIED CHINESE'||'''';

-- Secondly, set the WF mode and access levels..
wf_core.upload_mode := 'FORCE';
wf_core.session_level := 100;

-- Prepare tables, if we want to execute the script in patch edition
-- Need to prepare the seed tables
ad_zd_seed.prepare('WF_MESSAGES');
ad_zd_seed.prepare('WF_MESSAGES_TL');
ad_zd_seed.prepare('WF_RESOURCES');

-- Finally call the API with message

WF_LOAD.UPDATE_MESSAGE (
  p_type =>  'XXCSWF', -- wf type
  p_name => 'XXMSGNAME',  -- message name
  p_subject => l_subject,  -- message subject in Chinese
  p_body =>  l_msg_body,  -- message body in Chinese
  p_html_body => l_body ,   -- message html body in Chinese.
  p_level_error => x_level_error);

         -- Commit or rollback based on success/failure

Note: Use 
SET SERVEROUTPUT ON;
SET DEFINE OFF;
SET VERIFY OFF;

to turn off substitution.

Tuesday, 4 October 2016

Migration of XML Publisher Objects using LDTs and XMLLoader

An XML Publisher template defintion will have following things to migrate.

1) Template defintion & Data defintion  => Use FNDLOAD
2)  Actual layout templates (RTF/EXCEL/PDF) & Actual data defintion XML file. => use XDOLOADER command


Template defintion & Data defintion 
FNDLOAD apps/<appsPwd> 0 Y DOWNLOAD  $XDO_TOP/patch/115/import/xdotmpl.lct XXCUSTEMPL.ldt XDO_DS_DEFINITIONS APPLICATION_SHORT_NAME='XXCUST' DATA_SOURCE_CODE='Data defintion Code' TMPL_APP_SHORT_NAME='XXCUST' TEMPLATE_CODE='Template Code'

With the above command you will fetch both data defintion and template defintion.

You upload the above using the UPLOAD command.

FNDLOAD apps/<appsPwd> 0 Y UPLOAD $XDO_TOP/patch/115/import/xdotmpl.lct XXCUSTEMPL.ldt

Once the definitions are created in the instance, you need to upload the actual layout and data defintion files using XDOLOADER.

Data Template/Data Source:

java oracle.apps.xdo.oa.util.XDOLoader DOWNLOAD -DB_USERNAME apps -DB_PASSWORD <appsPwd> -JDBC_CONNECTION '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=XX_DB_HOST_NAME)(PORT=XX_DB_PORT_NUMBER))(CONNECT_DATA=(SERVICE_NAME=XX_DB_SERVICE_NAME)))' -LOB_TYPE DATA_TEMPLATE -LOB_CODE XX_DATA_TEMPL_CODE -APPS_SHORT_NAME XXCUST -LANGUAGE en -lct_FILE $XDO_TOP/patch/115/import/xdotmpl.lct -LOG_FILE $LOG_FILE_NAME


java oracle.apps.xdo.oa.util.XDOLoader UPLOAD -DB_USERNAME apps -DB_PASSWORD <appsPwd> -JDBC_CONNECTION '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=XX_HOST_NAME)(PORT=XX_PORT_NUMBER))(CONNECT_DATA=(SERVICE_NAME=XX_SERVICE_NAME)))' -LOB_TYPE DATA_TEMPLATE -LOB_CODE XX_DATA_TEMPL_CODE -XDO_FILE_TYPE XML -FILE_NAME $DATA_FILE_PATH/$DATA_FILE_NAME.xml -APPS_SHORT_NAME XXCUST -NLS_LANG en -TERRITORY US -LOG_FILE $LOG_FILE_NAME


 RTF TEMPLATE (Report Layout .rtf file) 

java oracle.apps.xdo.oa.util.XDOLoader DOWNLOAD -DB_USERNAME apps -DB_PASSWORD appsPwd  -JDBC_CONNECTION '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=XX_HOST_NAME)(PORT=XX_PORT_NUMBER))(CONNECT_DATA=(SERVICE_NAME=XX_SERVICE_NAME)))' -LOB_TYPE TEMPLATE -LOB_CODE XX_TEMPLATE -APPS_SHORT_NAME XXCUST -LANGUAGE en -TERRITORY US -lct_FILE $XDO_TOP/patch/115/import/xdotmpl.lct -LOG_FILE $LOG_FILE_NAME




java oracle.apps.xdo.oa.util.XDOLoader UPLOAD -DB_USERNAME apps -DB_PASSWORD appsPwd -JDBC_CONNECTION '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=XX_HOST_NAME)(PORT=XX_PORT_NUMBER))(CONNECT_DATA=(SERVICE_NAME=SERVICE_NAME)))' -LOB_TYPE TEMPLATE -LOB_CODE XX_TEMPLATE -XDO_FILE_TYPE RTF -FILE_NAME $RTF_FILE_PATH/$RTF_FILE_NAME.rtf -APPS_SHORT_NAME XXCUST -NLS_LANG en -TERRITORY US -LOG_FILE $LOG_FILE_NAME

FNDLOAD to migrate AOL objects to different instances

During development we generally do required AOL setups in lower instances and to migrate the AOL objects such as messages/lookups/Concurrent programs etc, we generate LDTs using FNDLOAD - DOWNLOAD  from lower instance and upload them using FNDLOAD - UPLOAD command in higher instances.

Structure of FNDLOAD command:

FNDLOAD apps/<AppsPwd> 0 Y [DOWNLOAD]  [LCT file] [LDT FILE name] [ENTITY_NAME]  [KEY1=[VAL].. [KEY/CTX]=VAL]

Open the LCT file using notepad you will be able to easily understand what KEY or context you need to use/what parameters you can create.

We can create custom lcts similar to Seed lcts for any table and migrate data using the custom lct and FNDLOAD.

Tips and Examples Using FNDLOAD (Doc ID 735338.1)


Messages
FNDLOAD apps/<appsPwd> 0 Y DOWNLOAD $FND_TOP/patch/115/import/afmdmsg.lct XX_CUSTOM_MESG.ldt FND_NEW_MESSAGES APPLICATION_SHORT_NAME="XXCUST" MESSAGE_NAME="XX_AP_CUST_MSG"

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afmdmsg.lct XX_CUSTOM_MESG.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

Lookup

FNDLOAD apps/<appsPwd> O Y DOWNLOAD $FND_TOP/patch/115/import/aflvmlu.lct XX_APCUST_LKP_LKP.ldt FND_LOOKUP_TYPE APPLICATION_SHORT_NAME="SQLAP" LOOKUP_TYPE="XX_APCUST_LKP"

Concurrent Program:

FNDLOAD apps/<appsPwd> O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct XX_CONC_CP.ldt PROGRAM APPLICATION_SHORT_NAME="XXCUST" CONCURRENT_PROGRAM_NAME="XX_CONC_CP"

Value set:
FNDLOAD apps/<appsPwd> 0 Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct XX_CUST_LEGAL_ENTITY_VS.ldt VALUE_SET FLEX_VALUE_SET_NAME="XX_CUST_LEGAL_ENTITY"


Desc flex:
FNDLOAD apps/<appsPwd> 0 Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct OKC_ARTICLES_DESC_FLEX_DFF.ldt DESC_FLEX P_LEVEL=:COL_ALL:REF_ALL:CTX_ONE:SEG_ALL? APPLICATION_SHORT_NAME="OKC" DESCRIPTIVE_FLEXFIELD_NAME="OKC_ARTICLES_DESC_FLEX"

Func Objec:
FNDLOAD apps/<appsPwd> 0 Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct XX_CUST_INV_UPLOAD_FUNCTION.ldt FUNCTION FUNCTION_NAME="XX_CUST_INV_UPLOAD"

Profile:
FNDLOAD apps/<appsPwd> O Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct XX_CUST_AME_TXN_TYPE_PRF.ldt PROFILE PROFILE_NAME="XX_CUST_AME_TXN_TYPE" APPLICATION_SHORT_NAME="XXCUST"

Folder:

FNDLOAD APPS/<appsPwd> 0 Y DOWNLOAD $FND_TOP/patch/115/import/fndfold.lct XXCUST_TEST_FOLD.ldt FND_FOLDERS FOLDER_NAME="TEST ACCRUAL"


Request Set:
FNDLOAD apps/<appsPwd> 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct XX_CUST_RS.ldt REQ_SET REQUEST_SET_NAME='REQUEST_SET_NAME'

Forms:
FNDLOAD apps/<appsPwd> 0 Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct XX_CUST_FORM.ldt FORM FORM_NAME="FORM_NAME" 


Form Function :
FNDLOAD apps/<appsPwd> 0 Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct XX_CUST_FUNC.ldt FUNCTION FUNCTION_NAME="FORM_FUNCTION_NAME"

Alerts:
FNDLOAD apps/<appsPwd> 0 Y DOWNLOAD $ALR_TOP/patch/115/import/alr.lct XX_CUST_ALR.ldt ALR_ALERTS APPLICATION_SHORT_NAME="XXCUST" ALERT_NAME="XX - Alert Name"

XML Publisher Data definition and XML Layout templates:

FNDLOAD apps/<appsPwd> 0 Y DOWNLOAD  $XDO_TOP/patch/115/import/xdotmpl.lct XXCUSTTEMPL.ldt XDO_DS_DEFINITIONS APPLICATION_SHORT_NAME='XXCUST' DATA_SOURCE_CODE='Data defintion code' TMPL_APP_SHORT_NAME='XXCUST' TEMPLATE_CODE='Template Code'

Wednesday, 28 September 2016

Oracle EBS 12.2.x Notes


---------------------------------------------------------------------------------------------------
To display the current connected edition

$echo $FILE_EDITION

$ sqlplus apps/apps
SQL> select ad_zd.get_edition_type from dual;

---------------------------------------------------------------------------------------------------
Useful metalink notes:
* Developing and Deploying Customizations in Oracle E-Business Suite Release 12.2 (Doc ID 1577661.1)

* How to deploy customizations that are created in the package oracle.apps.xxprod.* rather than xxprod.oracle.apps.* or xxprod.oracle.apps.xxprod.* on EBS 12.2.X? (Doc ID 1609939.1)

---------------------------------------------------------------------------------------------------
OAF deployment steps 12.2.x:

1) Connect to middle tier
2) Source to Run file system
$. ./EBSapps.env
3) Then enter 'R'
4) Go to JAVA TOP
$cd $JAVA_TOP
5) Backup customall.jar file
6) Run adcgnjar by entering apps DB password to regenrate customall.jar file and check the time stamp
$adcgnjar
7) Restart OACORE by giving weblogic admin password.
$admanagedsrvctl.sh stop oacore_server1
$admanagedsrvctl.sh start oacore_server1
---------------------------------------------------------------------------------------------------