Wednesday, 15 February 2017

Query to find Short text documents (attachment)

Below given query will give you details for short text document attachment details.
In this query i passed 2 parameter p_entity_name and p_prim_key_id.
One can pass p_entity_name parameter value as "OE_ORDER_HEADERS" then we must pass p_prim_key_id parameter value as header_id from OE_ORDER_HEADERS_ALL table.

Similarly you can pass p_entity_name value as 'PO_HEADERS', 'PO_LINES', 'OE_ORDER_HEADERS', 'OE_ORDER_LINES','AP_INVOICES','AP_CHECKS'  etc. to get details for short text attached to this entity.

Query :
SELECT fad.seq_num,
       fdct.user_name,
       fdot.title,
       fdot.description,
       fdst.short_text,
       fad.entity_name,
       fdct.user_name
  FROM fnd_attached_documents     fad,
       fnd_documents              fdob,
       fnd_documents_tl           fdot,
       fnd_document_categories_tl fdct,
       fnd_documents_short_text   fdst
 WHERE fad.document_id = fdob.document_id
   AND fad.document_id = fdot.document_id
   AND fdob.document_id = fdot.document_id
   AND fdob.category_id = fdct.category_id
   AND fdot.language = userenv('LANG')
   AND fdct.language = userenv('LANG')
   AND fad.entity_name = &p_entity_name
   AND fad.pk1_value = TO_CHAR(&p_prim_key_id)
   AND fdst.media_id = fdob.media_id;

Screenshot for sample attachment :


Query to find Request group name to which concurrent program is attached.

Below given query will give you details for concurrent program and request group to which CP is attached details.

Query :

SELECT fcpt.user_concurrent_program_name,
       DECODE(frgu.request_unit_type,
              'P', 'Program',
              'S','Set',
              frgu.request_unit_type) Request_Unit_Type,
       fcp.concurrent_program_name short_name,
       frg.application_id,
       frg.request_group_name,
       fat.application_name,
       fa.application_short_name,
       fa.basepath
  FROM fnd_request_groups         frg,
       fnd_request_group_units    frgu,
       fnd_concurrent_programs    fcp,
       fnd_concurrent_programs_tl fcpt,
       fnd_application            fa,
       fnd_application_tl         fat
 WHERE frg.request_group_id = frgu.request_group_id
   AND frgu.request_unit_id = fcp.concurrent_program_id
   AND fcp.concurrent_program_id = fcpt.concurrent_program_id
   AND frg.application_id = fat.application_id
   AND fa.application_id = fat.application_id
   AND fcpt.language = USERENV('LANG')
   AND fat.language = USERENV('LANG')
   AND UPPER(fcpt.user_concurrent_program_name) like
       UPPER('Trial Balance - Detail');



Thursday, 29 December 2016

How to set up Tracing for Web ADI Error

We can configure tracing for Web ADI activity by using below Profile options.
  • BNE Server Log Level : Set it to Trace
  • BNE Server Log Path : Enter directory path 
  • BNE Server Log Filename : Enter Log file name 
Navigation : Login to Oracle application 
Go to System Administrator Responsibility -> Profile -> System
Eneter User Name and in Profile field enter "BNE%Log%" Then click on Find.



Set all 3 profile options as shown in below mention screenshot at user level.

Once above mentioned setup done . Now you can recreate webadi error, which will create trace file on path mentioned in "BNE Server Log Path" profile option.

Monday, 19 December 2016

How to Reconcile Account Payable with GL trial balance


  •  Kindly run the Accounts Payable Trial Balance for a particular period which you have already closed (or) intend to close in both AP and GL.

  • Now Run General Ledger Trial Balance Report for same period.

  • Then compare both trial balance report APTB & GLTB for all accounts. 
  • Submit Create Accounting program from Payable responsibility with proper end date and Final and Post Mode parameter value as 'Yes'.

  • After completing create accounting report again compare APTB and GLTB report.
  • If there is still any difference then submit the GL Account Analysis Report (180 char)" report, which will help to find whether any other source journals are posted to these liability accounts 

  • List out all other source journal amounts (credit less debit) and determine the net value (other than Payables source amounts) to compare with APTB.
  • If there is still a difference between APTB and GLTB after deducting other source journals, then submit the "Account Analysis Report" in Payables for the particular period and liability account code combination. This will help to get detailed transaction level data.
  • Export the output into excel with column sorting options and proceed to reconcile at transaction level to find out the difference between GL trial Balance and AP Trial Balance.
  • Then analyze the transaction accounting entries. If any corruption or partial accounting exist.

Friday, 18 November 2016

Oracle XML Publisher related Table Details

Lets take example of standard report AP Invoice Register to check xml publisher related table details.

Concurrent Program screen shot:

For  Data definition we can query using Executable code as shown in below screenshot.

Data Definition Screen shot:

Data definition get stored in below given Tables:
  • XDO_DS_DEFINITIONS_B
  • XDO_DS_DEFINITIONS_TL
We can use below given query to find out details related to data definition.


SELECT * 
FROM XDO_DS_DEFINITIONS_B 
WHERE DATA_SOURCE_CODE = 'APXINRIR';


SELECT *
FROM XDO_DS_DEFINITIONS_TL 
WHERE DATA_SOURCE_CODE = 'APXINRIR';




Template Screenshot:


Template related detail get stored in below given table.
  • XDO_TEMPLATES_B
  • XDO_TEMPLATES_TL
  • XDO_LOBS
We can use below given query to find out template related details from back-end.


SELECT *

  FROM XDO_TEMPLATES_B
  WHERE TEMPLATE_CODE = 'APXINRIR';



SELECT *
  FROM XDO_TEMPLATES_TL
WHERE TEMPLATE_CODE = 'APXINRIR';



SELECT *
  FROM XDO_LOBS
WHERE LOB_CODE = 'APXINRIR';


One can view RTF template attached to this particular report by clicking file data column.

Just click on File data column sign [...] showing value <BLOB> for row which XDO_FILE_TYPE is RTF, it will open new window for RTF file as shown in below screenshot.



Hope this will help you guys.



Wednesday, 2 November 2016

How to migrate XML Publisher report with data template from one instance to other using LDT.

In Xml Publisher report when we use data template please follow below given are step to migrate xml publisher report from one instance to another instance using LDT.

Key Object LDT to be downloaded from dev instance.
1. Concurrent Program LDT
2. Any value set or lookup used in lookup for data template query.
3. Data definition and template LDT file.
4. .xml file attached in data definition data template.
5..rtf file attached in template for layout.

LDT Creation scripts:

1. Concurrent Program
Download :
$FND_TOP/bin/FNDLOAD apps/Password O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct XXCUST_CP.ldt PROGRAM APPLICATION_SHORT_NAME="XXCUST" CONCURRENT_PROGRAM_NAME="XXCUST_SHORT_NAME"

Upload :
FNDLOAD <username>/<password> O Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct XXCUST_CP.ldt CUSTOM_MODE=FORCE UPLOAD_MODE=REPLACE

2. Data Definition and Template
Download :
FNDLOAD apps/password 0 Y DOWNLOAD $XDO_TOP/patch/115/import/xdotmpl.lct XXCUST_DD.ldt XDO_DS_DEFINITIONS APPLICATION_SHORT_NAME='XXCUST' DATA_SOURCE_CODE='XXCUST_DD_NAME'

Upload:
FNDLOAD apps/XXXX 0 Y UPLOAD ${XDO_TOP}/patch/115/import/xdotmpl.lct XXCUST_DD.ldt

3. Data Template (.xml source file) 
Download :
java oracle.apps.xdo.oa.util.XDOLoader DOWNLOAD -DB_USERNAME apps -DB_PASSWORD userpswd -JDBC_CONNECTION '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST='HOST NAME')(PORT=1234))(CONNECT_DATA=(SERVICE_NAME=DEV)))' -LOB_TYPE DATA_TEMPLATE -LOB_CODE XXCUST_DD_NAME -APPS_SHORT_NAME XXCUST -LANGUAGE en -lct_FILE $XDO_TOP/patch/115/import/xdotmpl.lct -LOG_FILE $LOG_FILE_NAME

Upload :
java oracle.apps.xdo.oa.util.XDOLoader \
UPLOAD \
-DB_USERNAME apps \
-DB_PASSWORD XXXX \
-JDBC_CONNECTION Server:DBPort:InstanceName \
-LOB_TYPE DATA_TEMPLATE \
-APPS_SHORT_NAME XXCUST \
-LOB_CODE XXCUST_DD_NAME \
-TERRITORY 00 \
-XDO_FILE_TYPE XML-DATA-TEMPLATE \
-FILE_NAME DATA_TEMPLATE_XXCUST.xml \
-CUSTOM_MODE FORCE

4. RTF Template (Layout .rtf file)

Download:
java oracle.apps.xdo.oa.util.XDOLoader DOWNLOAD -DB_USERNAME apps -DB_PASSWORD userpswd -JDBC_CONNECTION '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST='HOST NAME')(PORT=1234))(CONNECT_DATA=(SERVICE_NAME=DEV)))'  -LOB_TYPE TEMPLATE -LOB_CODE ZBRAR_WFACT_INV_EXTRACT -APPS_SHORT_NAME AR -LANGUAGE en -TERRITORY US -lct_FILE $XDO_TOP/patch/115/import/xdotmpl.lct -LOG_FILE $LOG_FILE_NAME


Upload :
java oracle.apps.xdo.oa.util.XDOLoader \
UPLOAD \
-DB_USERNAME apps \
-DB_PASSWORD XXXX \
-JDBC_CONNECTION Server:DBPort:InstanceName \
-LOB_TYPE TEMPLATE \
-APPS_SHORT_NAME XXCUST \
-LOB_CODE XXCUST_DD_NAME \
-LANGUAGE en \
-TERRITORY 00 \
-XDO_FILE_TYPE RTF \
-FILE_NAME TEMPLATE_SOURCE_XXCUST_TMP_en.rtf \
-CUSTOM_MODE FORCE

Wednesday, 21 September 2016

Shell script to FTP file from oracle apps server to another windows/unix based server

Below given script one can use to FTP file from oracle apps server to unix/windows based client server. kindly register host program in oracle apps by giving executable file name as XXCUST_FTP_SH.prog. This program will FTP file from Oracle EBS source file path to another client server destination path which is defined in variable.

Shell script
====================================================================
# @(#) XXCUST_FTP_SH.prog
# ===================================================================
# PURPOSE: This program will FTP file from oracle EBS server to other
# windows/Unix based server
# ===================================================================
# -------------------------------------------------------------------
# PARAMETERS
# $0 = Shell Script Name
# $1 = username/password
# $2 = userid
# $3 = username
# $4 = request_id
# ===================================================================
#!/bin/bash
HOST='xxcust.host.com'
USER='ftpuser'
PASSWD='ftp1234'
SOURCE_PATH='/tmp/erpdev1/xxftp/outbox'
DEST_PATH='/xxcust/ftp/inbox'
FILE_NAME='xxtestftp.txt'
ftp -n $HOST << END_SCRIPT
user $USER $PASSWD
put $SOURCE_PATH'/'$FILE_NAME $DEST_PATH'/'$FILE_NAME
END_SCRIPT
==================================================================


Kindly note this script will only work if FTP port is opened for both source and destination server.
One can easily check by login to putty and check by using ftp command if he can able to connect to ftp server.

command:
ftp xxcust.host.com

it will ask for username
Name : ftpuser
331 Please specify the password.
Password:ftp1234
230 Login successful.




Oracle Fusion SQL Queries to get Sales Person/Sales Representative information for an Order

1) Get sales person details if the Sales Person ID is known SELECT  jrs.SALESREP_NUMBER  ,         jrs.status           ,         jrs.START_...