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.

Relationship between the tables

Here are the steps to create a simple search page in OA Framwork. I have used OAF Version 12.1.1 for this exercise. There are many ways to do this and here I have followed one of these.
Step 1: Create a Package
All BC4J model components must belong to a Business Components (BC4J) package. So create a package with a name like xxhci.oracle.apps.custom.LabExamples.server.
Step2: Create an Entity Object (EO)
Entity objects encapsulate business logic and DML operations for application tables.
To create a new entity object in the above defined Business Components (BC4J) package:
1. In the JDeveloper Navigator, select the BC4J package where you want to create your entity object.
2. Right click and select ‘New Entity Object’
3. Do the following steps to create an EO.
2.1 Specify a Schema Object (the exact name of the table for the entity object)

2.2 In the Attributes page (Step 2 of 5), you should see all the columns in the table that you specified in the Name page.
Select New… to create a transient attribute that is used in the business logic, such as a calculated OrderTotal in a purchase order that is used for approval checking.
2.3 In the Attribute Settings page (Step 3 of 5), verify or set the following information for each of the entity object’s attributes:
The Attribute and Database Column Name and Type properties default correctly from the table definition. For primary key columns, ensure that the Primary Key and Mandatory checkboxes are selected. For columns that are never updateable, or updateable only when new, select the appropriate Updateable radio button. For columns whose values change after database triggers execute, select the Refresh After update or insert as appropriate.
2.4 In the Java page (Step 4 of 5) page:
  • Check the option for generating an Entity Object Class. In the Generate Methods box, opt to generateAccessors, a Create Method and a Remove Method.
2.5 Click on ‘Generate default view object’ to create a VO. Select Finish to save your entity object definition and implementation. BC4J will create an XML definition file and a Java implementation file for your entity object.
Step3: Create an View Object (VO)
If you click ‘Generate default view object’ tab as mentioned above, you don’t have to create a VO separately. If you forgot this, you have to create a VO. Click on the VO to test the SQL Statement generated by the EO and check in the ‘Expert Mode’.
Step4: Create a New Application Module (AM)
To create a new application module in a Business Components (BC4J) package:
1. In the JDeveloper Navigator, select the BC4J package where you want to create your application module.
2. From the main menu, choose File > New to open the New Object Gallery.
Select the view object.
In the Java page (Step 4 of 5), deselect the Generate Java File(s) checkbox ONLY if you are certain that you won’t be writing any code for your application module (you can always delete the class later if you find that you don’t need it, so it’s probably best to simply generate it at this point unless you are creating a simple container for LOV view objects).
Select Finish to create your application module. BC4J will create an XML definition and implementation file.
Step5: Create a Page (EmpSearchPG)
Create the EmpSearchPG page as follows
  • Right click on project à New à Web Tier à OA Components à Page
  • Give the Page Name as EmpSearchPG and package as “xxhci.oracle.apps.custom.LabExamples.webui”
  • Select region1 page from Structure Window and change its properties as
    ID à PageLayoutRN
  • Select the AM Definition as ‘xxhci.oracle.apps.custom.LabExamples.server.XxhciOafTrngEmpTabAM’
  • Give a Window Title as ‘Employees Search Window’
  • Give a Title as ‘Employees’
Step6: Add a Query region and Results table
  • Right click on PageLayoutRN à New à Region. Set the properties of the new region as
    ID à QueryRN
  • Select the Region Style as ‘query’ and Construction Mode as ‘resultBasedSearch’.
  • Right click on QueryRN region on structure navigator à New à Region using wizard.
  • Select the AM and VO which we have created in earlier steps as shown in below figure.
Set the Region Style as Table
Change the Prompt and Style for all three items.
Step7: Changes the Item Properties
Go to EmpNo item and set the Search Allowed property to true. Similarly do the steps for EmpName and Department also.
Step8: Save all changes (Save All).
Step9: Run the Page (EmpSearchPG)
Creation of search page is complete. Run the EmpSearchPG to test the page. If everything works fine for you, you should able to view an output like below:
Few Note:
Understanding Query Regions
When you add a query region to a pageLayout region, OA Framework automatically generates an oracle.apps.fnd.framework.webui.beans.layout.OAQueryBean which, depending on its configuration, works in concert with a child table, advanced table or HGrid to implement any combination of simple search, advanced search and view panels. OA Framework automatically generates buttons as appropriate for toggling between the applicable regions.
Construction Modes:
There are three construction modes available. In the above example we have used ‘resultBasedSearch’construction mode. Here is a brief comparison of the three modes.
1] resultsBasedSearch:
  • OA Framework automatically renders both the Simple and Advanced search regions based on the designated queryable items in the associated table.
  • The search regions automatically include both a Go and a Clear button.
  • OA Framework automatically executes the underlying search when the user selects the Go button.
2] autoCustomizationCriteria:
  • OA Framework automatically renders both the Simple and Advanced search regions based on the corresponding Simple search and Advanced search regions that you define and specify as named children of the query region.
  • The search regions automatically include a Go button. In addition, the Advanced search region includes a Clear button.
  • OA Framework automatically executes the underlying search when the user selects the Go button. However, developers must explicitly define mappings between items in the Search panel and items in the table region.
3] none
  • The Search regions are rendered based on the Simple Search and Advanced Search regions that you define and specify as named children of the query region.
  • You must implement your own Go button in this mode.
  • The underlying search must be executed by the developer.

All discoverer folders and workbooks that you create get stored in database. You can use the below queries to find the details.
Find your Discoverer Workbook and Folder Details from Database:
select  fu.user_name owner,
doc.doc_id "Document Id",
doc.doc_name "Document Name",
doc.doc_developer_key,
doc.doc_folder_id,
doc.doc_created_by,
doc.doc_created_date,
doc.doc_updated_by,
doc.doc_updated_date,
min(qs.qs_created_date) first_acc,
max(qs.qs_created_date) Last_Acc
from disco_apps.eul5_documents doc,
apps.fnd_user fu,
disco_apps.eul5_qpp_stats qs
where '#'||fu.user_id = doc.doc_created_by
and qs.qs_doc_name=doc.doc_name
and qs.qs_doc_owner=fu.user_name
and doc.doc_created_date<qs.qs_created_date
group by fu.user_name,
doc.doc_id,
doc.doc_name,
doc.doc_developer_key,
doc.doc_folder_id,
doc.doc_created_by,
doc.doc_created_date,
doc.doc_updated_by,
doc.doc_updated_date
order by doc.doc_updated_date desc;

Find your Discoverer Workbook performance for different Business Areas:

select  ba.ba "Business Area",
usr.user_name,
doc.doc_name "Work Book",
min(qs_act_elap_time) "Fastest",
max(qs_act_elap_time) "Slowest",
round(avg(qs_act_elap_time),2) "AVG (s)",
round(avg(qs_act_elap_time)/60,2) "AVG (m)",
count(*) "Often",
doc.doc_created_date,
min(acc.qs_created_date) "First",
max(acc.qs_created_date) "Last Access"
from disco_apps.eul5_documents doc,
apps.fnd_user usr,
disco_apps.eul5_qpp_stats acc,
(select distinct gd_doc_id from disco_apps.eul5_access_privs ) privs,
(
select distinct doc.doc_id,ba.ba_name ba
from disco_apps.eul5_documents doc
,disco_apps.eul5_elem_xrefs eex
,disco_apps.eul5_ba_obj_links bol
,disco_apps.eul5_objs obj
,disco_apps.eul5_bas ba
WHERE doc.doc_id = eex.ex_from_id
AND eex.ex_to_par_name = obj.obj_name
AND obj.obj_id = bol.bol_obj_id
AND bol.bol_ba_id = ba.ba_id
)ba
where '#'||usr.user_id=doc.doc_created_by
And doc.doc_name=acc.qs_doc_name
And privs.gd_doc_id = doc.doc_id
And usr.user_name = upper(acc.QS_DOC_OWNER)
And doc.doc_created_date<acc.qs_created_date
And doc.doc_id=BA.doc_id
group by ba.ba,
usr.user_name,
doc.doc_name,
doc.doc_created_date;

To Retriew the records from Org dependent Views on Sql Developer/Toad/Sql * Plus

begin
fnd_client_info.set_org_context(Org_id);
end;

Select pha.segment1 “PO_NUMBER”,pla.line_num,plla.shipment_num,
pv.segment1 “Oracle_Supplier_number”, msib.segment1 “item_number”,pla.item_revision, pla.item_description,
NULL as “Delivery_date”, NULL as “Blank Column”, pla.unit_price, pha.rate,plla.Quantity_received,plla.Quantity_rejected,
(pla.unit_price*pla.Quantity) as “Line_Amount”, NULL as “ITEM_COST”, NULL as “Amount”, pla.VENDOR_PRODUCT_NUM
from apps. PO_HEADERS_ALL pha,
apps. PO_VENDORS pv,
apps. PO_VENDOR_SITES_ALL pvsa,
apps. PO_LINES_ALL pla,
apps. MTL_SYSTEM_ITEMS_B msib,
apps. PO_LINE_LOCATIONS_ALL plla
where pha.org_id=’xxxx’
AND pha.org_id=pvsa.org_id
AND pv.vendor_id=pha.vendor_id
AND pvsa.vendor_id=pv.vendor_id
AND pha.po_header_id=pla.po_header_id(+)
–AND pha.po_header_id=plla.po_header_id
AND plla.po_line_id(+)=pla.po_line_id
–AND msib.organization_id=’xxxx’
AND pla.item_id=msib.inventory_item_id(+)
Order by pha.segment1