SQL Loader command :
sqlldr
control=ctrl_file.ctl SKIP=1 log=logfile.log bad=badfile.log
discard=discardfile errors=150000 userid=apps/apps@instance
--xx--
FNDLOAD command:
FNDLOAD
apps/apps@instance 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct
PRG_XX.ldt PROGRAM APPLICATION_SHORT_NAME="XX"
CONCURRENT_PROGRAM_NAME="XX"
--xx--
Set Multi org in R12:
Begin
mo_global.set_policy_context('S', 99); --99 is the org id
End;
--xx--
To find Oracle forms fmb
version, run the command in unix prompt
adident Header <filename>
--xx--
To find the folder
locations of utl_file directory:
select value from
v$parameter where name = 'utl_file_dir'
--xx--
To be continued....
<xapi:requestset
xmlns:xapi="http://xmlns.oracle.com/oxp/xapi"
type="bursting">
<xapi:request select="/../../LIST_G_INVOICE/G_INVOICE">
<xapi:delivery>
<xapi:filesystem
output="/server/outputfolder/${TRX_NUMBER}.pdf" id="1234"
/>
</xapi:delivery>
<xapi:document output-type="pdf" delivery="1234">
<xapi:template type="rtf"
location="xdo://AR.INVOICE.en.US/?getSource=true">
</xapi:template>
</xapi:document>
</xapi:request>
</xapi:requestset>
Here we are trying to
send the PDF output to Server Output Folder.
xapi:delivery - Explains
where the output should be delivered
xapi:filesystem -
explains the output is destined to filesystem
xapi:template -
specifies the template shortcode prefixed with app short code, for eg:
AR.INVOICE - AR-app short code and INVOICE is the xml template short code.
location="xdo://AR.INVOICE.en.US/?getSource=true"
Above line is very
important, it takes care of pulling the latest template uploaded in the XML
Publisher Administrator responsibility, you don't need to put your template
hanging in any UNIX servers.
en - Language
US - Territory code
(when you create template definition, you make sure that you select United
States or other country)
The same above example
holds good for sending the output through email, fax, etc.,
To email a concurrent
program PDF output. We need to call a UNIX host script to read the file from
Oracle output directory and using UNIX command mailx, send the output as an
attachment to the email address.
UNIX script for sending
email:
#======================================================
=====
# derive settings
#======================================================
=====
FILE_IN_BASE=o${V_CURRENT_REQ_ID}.out
# output file generated by Application
FILE_ERR_BASE=l${V_CURRENT_REQ_ID}.log
# log file generated by Application
FILE_OUT=${APPLCSF}/${APPLOUT}
# output file directory
FILE_LOG=${APPLCSF}/${APPLLOG}
# log file directory
FILE_IN=${FILE_OUT}/${V_FILE_NAME}
FILE_ERR=${FILE_LOG}/${FILE_ERR_BASE}
#======================================================
=====
#Email Body
#======================================================
=====
#MESSAGE="Test
Message"
#======================================================
=====
#Check for Outfile
Validity and existence
#======================================================
=====
DATAFILE_COUNT='ls -l
$FILE_IN | wc -l'
if [ $DATAFILE_COUNT -eq
1 ]
then
echo "file!"
fi
if [ $DATAFILE_COUNT -lt
1 ]
then
echo "No input file
exists"
exit 1
fi
echo =======================================================
========
echo "Emailing
Outfile "
echo
======================================================= ========
uuencode $FILE_IN
Output.pdf| mailx -s "Test Request Output " $V_EMAILID
exit 0
In Oracle R12, there is a huge change in maintaining Customer Master records, we have a new centralized module called TCA(Trading Community Architecture) which will take care of maintaining customer related information.
All tables are stored in HZ module with table names starting in HZ%.
HZ tables are all related and architecture of the TCA module is,
HZ_PARTIES (party-person,organization) <--->> HZ_CUST_ACCOUNTS (customer accounts)
A party may contain one or more customer accounts related to it.
HZ_PARTIES.PARTY_ID = HZ_CUST_ACCOUNTS.PARTY_ID
jh
HZ_CUST_ACCOUNTS <--->> HZ_CUST_ACCT_SITES_ALL
Linking column: CUST_ACCT_SITE_ID
HZ_CUST_ACCT_SITES_ALL <---> HZ_PARTY_SITES_ALL
Linking column: PARTY_SITE_ID
HZ_CUST_SITE_USES_ALL <---> HZ_CUST_ACCT_SITES_ALL
Linking column: CUST_ACCT_SITE_ID
Below query explains the link and how we fetch info from HZ tables.
select hz.party_name customer_name, hca.account_number customer_number,
hps.party_site_number site_number, hcsu.location loc_number
from hz_cust_site_uses_all hcsu,
hz_cust_accounts hca,
hz_parties hp
hz_cust_acct_sites_all hcas,
hz_party_sites hps
where hcas.cust_account_id = hca.cust_account_id
and hcsu.cust_acct_site_id = hcas.cust_acct_site_id
and hcas.party_site_id = hps.party_site_id
and hp.party_id = hca.party_id
and hcsu.location = :3
and hca.account_number = :1
and hps.party_site_number = :2
There are many APIs to create/update/delete HZ parties, customers, site and location information.
Pls refer these packages,
HZ_CUST_ACCOUNT_SITE_V2PUB - To update customer sites
HZ_CUST_ACCOUNT_V2PUB - To update customers
hz_party_v2pub - To update Parties
HZ_CUSTOMER_PROFILE_V2PUB - To update customer profiles
More information can be found in Oracle TCA technical implementation user guides and also lot of samples found in Metalink when you search any of the above package names.
TCA is also used by lot of other modules include,
- TeleSales
- CRM
In R12, all TCA front end screens are in OA framework.
Item has to be loaded
into Oracle. We can import items into Oracle using item interface table
mtl_system_items_interface.
Steps to load item into
Oracle.
1. Populate interface
table mtl_system_items_interface through SQL Loader(no biz validation) or plsql
programs with validation
2. Run "Import
Items" concurrent program under Inventory responsibility.
Sample Control File for
a .csv data file:
load data
infile
'datafile.csv' "str '|\r\n'"
insert/replace/append
into table mtl_system_items_interface
fields terminated
by "," optionally enclosed by '"'
trailing nullcols
(
Process_Flag,
Set_Process_Id,
Transaction_Type,
Organization_Id,
inventory_item_id,
segment1,
description
)
"str '|\r\n'"
- this will help in getting the last field of every record without carriage
return or linefeed character on it.
Command to run SQL
Loader:
1. Login to UNIX box and
run this, sqlldr usr/pwd@instance_sid control_file.ctl log_file.log
2. The SQL loader can
also be run from our local PC if Oracle client is installed and it can be
verified by checking under oracle_home/bin. Also the oracle_home/bin should be
set under environment variable, so that if we type the sqlldr command in
windows prompt, it should get executed.