Friday, November 18, 2016

Difference between Valuesets and Lookups

Difference between Valuesets and Lookups
Difference 1

Value sets can be attached to parameters of a concurrent program or to a DFF segments where as Lookups are attached only to the fields of a Form/Page

Difference 2

Lookups can be maintained by end users where as Value Sets are almost never maintained by end users, with the exception of GL Flexfield codes. Value sets are usually maintained by System Administrators.


Difference 3

Lookups can have translated values in different languages but not the values in the Value Sets

Difference 4


Value sets can contain values that are a result of an SQL Statement. Hence it is possible to make Value Set list of values dynamic.
On the contrary, Lookup Codes are Static list of values which can only be entered through Lookups Form.

Difference 5

We have several different types of value sets but not lookups.

Query for link between OM to Receivables

SELECT ooh.order_number, ool.line_number, ool.ordered_item,
       ool.ordered_quantity * ool.unit_selling_price,
       rcta.trx_number invoice_number, rcta.trx_date, rctl.line_number,
       rctl.unit_selling_price, ooh.org_id
  FROM oe_order_headers_all ooh,
       oe_order_lines_all ool,
       ra_customer_trx_all rcta,
       ra_customer_trx_lines_all rctl
 WHERE ooh.header_id = ool.header_id
   AND rcta.interface_header_context = 'ORDER ENTRY'
   AND rctl.interface_line_context = 'ORDER ENTRY'
   AND rctl.interface_line_attribute1 = TO_CHAR (ooh.order_number)
   AND rctl.interface_line_attribute6 = TO_CHAR (ool.line_id)
   AND rctl.customer_trx_id = rcta.customer_trx_id
   AND ooh.order_number = NVL (:p_order_number, ooh.order_number)
--AND  ooh.org_id=nvl(:p_org_id,ooh.org_id)

Tuesday, November 15, 2016

Create Host/Shell Script Concurrent Program in R12

Create Host/Shell Script Concurrent Program in R12

Below is the step by step process of registering shell script as a host program or concurrent program in Oracle Applications R12

Step 1 : Create the executable name HOST_TEST_PROGRAM and Executable File Name demo_sh


Step 2 : Register the concurrent program Demo Shell Script Concurrent Program




Options : encrypt it will avoid displaying apps password in unix command prompt
wont get the password using unix command ps -ef | grep "apps"

Step 3 : Adding two parameter in the concurrent program
             Parameter1  Parameter2


Step 4:  Add the concurrent program in to the request group & Add that request group into the Responsibility.

Step 5:

1.Create a shell script ( say demo.prog)  in appropriate $CUSTOM_TOP/bin directory
Script name : demo.prog
  #! /bin/ksh
  param1="$5"
  param2="$6"
  echo "Parameter1 : $param1"
  echo "Parameter2 : $param2"

2.Change Permissions to 755 for the demo.prog file. ($chmod 755 $CUSTOM_TOP/bin/demo.prog)
3.Create soft Link to the shell Script ln -s $FND_TOP/bin/fndcpesr   $CUSTOM_TOP/bin/demo_sh) to create demo_sh file.
4. First 5 params are reserved for Application, user defined params starts from 5th param

                      ORA_USER_PASS=$1

                     USERID=$2

                     USERNAME=$3

                     REQUESTID=$4

5. fndcpesr is a standard utility available in $FND_TOP directory. Its mainly used by the application to parse arguments for shell scripts.
Step 6:

Submit the concurrent program Demo Shell Script Concurrent Program
from Added responsibility



Program should be completed in normal and out put parameter values are displayed in log file.


Note : The above method should allow spaces in the user defined parameters

Monday, November 14, 2016

HZ TABLES IN ORACLE RECEIVABLES

HZ_PARTIES:
The HZ_PARTIES table stores basic information about parties that can be shared with any relationship that the party might establish with another party. The primary key for this table is PARTY_ID.
Few Important Columns are
  • PARTY_ID: Party identifier
  • PARTY_NUMBER: Unique identification number for this party
  • PARTY_NAME: Name of the party
  • PARTY_TYPE: The party type can only be Person, Organization, Group or Relationship.
HZ_PARTY_SITES:
The HZ_PARTY_SITES table links a party (HZ_PARTIES) and a location (HZ_LOCATIONS) and stores location-specific party information. One party can optionally have one or more party sites. One location can optionally be used by one or more parties. The primary key for this table is PARTY_SITE_ID.
Few Important Columns are
  • PARTY_SITE_ID: Party site identifier.
  • PARTY_ID: Identifier for the party. Foreign key to the HZ_PARTIES table.
  • LOCATION_ID: Identifier for the party site. Foreign key to the HZ_LOCATIONS table.
  • PARTY_SITE_NUMBER: Party site number.
  • PARTY_SITE_NAME: User-defined name for the site.
  • ADDRESSEE: Addressee information.
HZ_LOCATIONS:
The HZ_LOCATIONS table stores information about a delivery or postal address such as building number, street address, postal code, and directions to a location. This table provides physical location information about parties (organizations and people) and customer accounts. The primary key for this table is LOCATION_ID.
Few Important Columns are
  • LOCATION_ID: Unique identifier for this location
  • COUNTRY: Country code from the TERRITORY_CODE column in the FND_TERRITORY table
  • ADDRESS1: First line for address
  • ADDRESS2: Second line for address
  • ADDRESS3: Third line for address
  • ADDRESS4: Fourth line for address
  • CITY: City
  • POSTAL_CODE: Postal Code
  • STATE: State
  • ADDRESS_KEY: Derived key that facilitates fuzzy searches
HZ_CUST_ACCOUNTS:
The HZ_CUST_ACCOUNTS table stores information about customer accounts , or business relationships that the deploying company establishes with a party of type Organization or Person. This table focuses on business relationships and how transactions are conducted in the relationship. Since a party can have multiple customer accounts, this table might contain several records for a single party. For example, an individual person can establish a personal account, family account, and a professional account for a consulting practice. The primary key for this table is CUST_ACCOUNT_ID.
Few Important Columns are
  • CUST_ACCOUNT_ID: Customer account identifier
  • PARTY_ID: A foreign key to the HZ_PARTY table.
  • ACCOUNT_NUMBER: Account Number
  • CUSTOMER_TYPE: Receivables lookup code for the CUSTOMER_TYPE attribute. I for internal customers, R for revenue generating external customers.
  • CUSTOMER_CLASS_CODE: Customer class identifier
HZ_CUST_ACCT_SITES_ALL:
The HZ_CUST_ACCT_SITES_ALL table stores all customer account sites across all operating units. Customer account sites are addresses, for customer accounts, where the deploying company does business with its customers. One customer account can have multiple customer account sites, and customer account sites for one customer account can belong to multiple operating units. The primary key for this table is CUST_ACCT_SITE_ID.
Few Important Columns are
  • CUST_ACCT_SITE_ID: Customer site identifier
  • CUST_ACCOUNT_ID: Identifier for a customer account. Foreign key to the HZ_CUST_ACCOUNTS table
  • PARTY_SITE_ID: Identifier for a party site. Foreign key to the HZ_PARTY_SITES table
  • BILL_TO_FLAG: Indicates if this is a Bill-To site.
  • SHIP_TO_FLAG: Indicates if this is a Ship-To site.
  • MARKET_FLAG: Indicates if this is a Marketing site.
HZ_CUST_SITE_USES_ALL:
The HZ_CUST_SITE_USES_ALL table stores business purposes assigned to customer account sites, for example Bill-To, Ship-To, and Statements. Each customer account site can have one or more purposes. This table is a child of the HZ_CUST_ACCT_SITES_ALL table, with the foreign
key CUST_ACCT_SITE_ID. The HZ_CUST_SITE_USES_ALL table also stores operating unit identifier, though the HZ_CUST_ACCT_SITES_ALL table itself stores the operating unit for customer account sites. The primary key for this table is SITE_USE_ID.
Few Important Columns are
  • SITE_USE_ID: Site use identifier
  • CUST_ACCT_SITE_ID: Identifier for the customer account site. Foreign key to the HZ_CUST_ACCT_SITES_ALL table
  • SITE_USE_CODE: Business purpose assigned to customer site account, such as Bill-To, Market, and Statements.
  • PRIMARY_FLAG: Indicates if this site is the primary site for this customer account. Y for the primary customer account site. N for other customer account sites.
HZ_CUSTOMER_PROFILES:
The HZ_CUSTOMER_PROFILES table stores information about the credit characteristics of a single customer account or a customer account site or a party. A profile class defined in the
HZ_CUSTOMER_PROFILE_CLASSES table can be used to provide default values for the attributes in this table. The primary key for this table is CUST_ACCOUNT_PROFILE_ID.
Few Important Columns are
  • CUST_ACCOUNT_PROFILE_ID: Unique identifier of this customer profile
  • CUST_ACCOUNT_ID: Identifier for the Customer Account. Foreign key to the HZ_CUST_ACCOUNTS table.
  • STATUS: Indicates whether the profile is active or inactive
HZ_CUST_PROFILE_CLASSES:
The HZ_CUST_PROFILE_CLASSES table stores information about the credit characteristics that are common across a group of customer accounts. The characteristics specified in this table can be used as default characteristics for similar customer accounts. The primary key for this table is PROFILE_CLASS_ID.
HZ_PARTY_RELATIONSHIPS:
The HZ_PARTY_RELATIONSHIPS table stores information about relationships between parties.

Realated Queries
-------------------
select distinct ra.address1, ra.address2, ra.address3, ra.address4, ra.city, ra.state,ra.postal_code, ras.location,ra.attribute1
from 
--oe_order_headers_all h, oe_order_lines_all l ,
ra_customers rc,RA_SITE_USES_ALL RAS,RA_addresses_all RA
where 
---h.open_flag='Y'
--and h.header_id=l.header_id
---and h.sold_to_org_id in ( select customer_id from ra_customers where customer_name like 'KMART%')
----and h.sold_to_org_id=rc.customer_id 
 RA.ADDRESS_ID = RAS.ADDRESS_ID 
AND RA.CUSTOMER_ID =rc.customer_id
--and location in('2676')
and customer_number=2022;



--------Customer address FOR R12----------------------------

select distinct loc.address1, loc.address2, loc.address3, loc.address4, loc.city, loc.state,loc.postal_code, hcsua.location,acct_site.attribute1
from ra_customers c, 
hz_party_sites party_site,
hz_locations loc,
hz_cust_acct_sites_all acct_site,
hz_cust_site_uses_all hcsua
where acct_site.party_site_id = party_site.party_site_id
AND loc.location_id = party_site.location_id
and acct_site.cust_acct_site_id = hcsua.cust_acct_site_id
and acct_site.cust_account_id = c.customer_id
and c.customer_number='1218';

------------preferable

select  loc.address1, loc.address2, loc.address3, loc.address4, 
loc.city, loc.state,loc.postal_code, hcsua.location,acct_site.attribute1
from ra_customers c, 
hz_party_sites party_site,
hz_locations loc,
hz_cust_acct_sites_all acct_site,
hz_cust_site_uses_all hcsua
where acct_site.party_site_id = party_site.party_site_id
AND loc.location_id = party_site.location_id
and acct_site.cust_acct_site_id = hcsua.cust_acct_site_id
and acct_site.cust_account_id = c.customer_id
and acct_site.status='A' 
--and  hcsua.location in ('288')
and c.customer_number='1757';
Relationship between the tables



Thursday, November 10, 2016

Query for Running sheduling,pending,on hold requests

SELECT   fcr.request_id,
         DECODE (fcr.phase_code,
                 'P', DECODE (fcr.hold_flag, 'Y', 'Inactive', fl_pend.meaning),
                 fl_pend.meaning
                ) phase,
         DECODE (fcr.phase_code,
                 'P', DECODE (fcr.hold_flag,
                              'Y', 'On Hold',
                              DECODE (SIGN (fcr.requested_start_date - SYSDATE),
                                      1, 'Scheduled',
                                      fl_stat.meaning
                                     )
                             ),
                 fl_stat.meaning
                ) status,
         fcpt.user_concurrent_program_name, fcr.increment_dates,
         fcr.resubmit_interval, fcr.resubmit_interval_unit_code,
         fcr.resubmit_interval_type_code, parent_request_id,
         fcr.requested_start_date, fu.user_name requested_by
    FROM fnd_concurrent_requests fcr,
         fnd_concurrent_programs_tl fcpt,
         fnd_lookups fl_pend,
         fnd_lookups fl_stat,
         fnd_user fu
   WHERE 1 = 1
     AND fcpt.concurrent_program_id = fcr.concurrent_program_id
     AND fcpt.LANGUAGE = USERENV ('LANG')
     AND fcr.phase_code = fl_pend.lookup_code
     AND fl_pend.lookup_type = 'CP_PHASE_CODE'
     AND fcr.status_code = fl_stat.lookup_code
     AND fl_stat.lookup_type = 'CP_STATUS_CODE'
     AND fl_pend.meaning != 'Completed'
     AND fu.user_id = fcr.requested_by
ORDER BY fcr.request_id DESC

Oracle Fusion - Cost Lines and Expenditure Item link in Projects

SELECT   ccd.transaction_id,ex.expenditure_item_id,cacat.serial_number FROM fusion.CST_INV_TRANSACTIONS cit,   fusion.cst_cost_distribution_...