Thursday, July 30, 2015

Oracle Applications R12 Trading Community Architecture ( TCA )

Background

What is TCA?
Oracle Trading Community Architecture (TCA) is a data model that allows you to manage complex information about the parties, or customers.
Trading Community Architecture is the implementation of technology and applications to allow users to create and maintain relationships among entities. It is a way to understand who your customer interacts with inside and outside the enterprise.

The code

PARTIES:

The related tables are as follows:-
HZ_PARTIES : Stores information about parties.
HZ_FINANCIAL_PROFILE : Stores information about the financial accounts.
HZ_CREDIT_RATINGS : Stores information about the credit rating of parties
HZ_REFERENCES : Stores information about reference given by one party about another.
HZ_CERTIFICATIONS : Stores information about the certifications given by other parties.

PARTIES – TYPE PERSON:

The tables are as follows:-
HZ_PERSON_PROFILES : Stores details information about people.
HZ_PERSON_LANGUAGES :Stores information about the language that a person speaks, reads or writes
HZ_PERSON_INTEREST : Stores information about a person’s personal interests.
HZ_ CITIZENSHIP : Stores information about a person’s claimed nationality.
HZ_EDUCATIONS : Store information about a person educations.
HZ_EMPLOYMENT_HISTORY : Stores information about where the person has been employed.

PARTIES – TYPE ORGANIZATION:

The tables are as follows:-
HZ_ORGANIZATION_PROFILES : Stores details information about credit rating, financial statistics, socio-economic and corporate linkage information.
HZ_STOCK_MARKETS :Stores information about the selling and buying of financial instruments.
HZ_SECURITY_ISSUED : Stores information about financial instruments such as stocks and bonds that has been issued by the organization.
HZ_INDUSTRIAL_CLASS_APP : It is a intersection tables that link industrial classifications stores in HZ_INDUSTRIAL_CLASSES .
HZ_INDUSTRIAL_CLASSES : Stores information about names and descriptions of industrial classifications.
HZ_FINANCIAL_REPORTS : Store information details of financial reports that describe the financial status of the party.
HZ_INDUSTRIAL_REFERENCE : Stores information about industrial reference for organization.

CUSTOMER ACCOUNTS:

The tables are as follows:-
HZ_CUST_ACCOUNTS : Stores information about the relationship, if a party becomes a customer. Basically stores information about customer accounts.
HZ_CUST_ACCT_SITES_ALL : Stores information about customer sites. One customer can have more then multiple sites.
HZ_CUST_SITE_USES_ALL : Stores information about site uses or business purpose. A Single customer site can have multiple sites uses such as Bill To or Ship To.
HZ_CUST_ACCT_RELATE_ALL : Stores information about relationships between customer accounts.
HZ_CUST_ACCOUNT_ROLES : Stores information about the roles that parties perform in customer accounts.
HZ_BILLING_PREFERENCES : It describe the invoicing format preferred by customer accounts or customer account sites.
HZ_CUSTOMER_PROFILES : Stores credit information for a customer account and customer account sites.
HZ_CUST_PROFILE_AMTS : Stores profile amount limits for every currency defined for a customer account or customer account site profile.
HZ_CUST_PROF_CLASS_AMTS :Stores customer profile class amount limits for currency.
HZ_CUST_PROFILE_CLASSES : Stores standard credit profile classes.

CONTACT POINTS:

The tables are as follows:-
HZ_CONTACT_POINTS : Stores electronic methods of communicating with entities such as parties, party site. Each record in this table represents s different means of contacting an entity.
HZ_CUST_CONTACT_POINTS : This table is used to tie a contact point to a customer account, customer account site or customer account role.
HZ_CONTACT_RESTRICTIONS : It stores information about restrictions on contacting parties.

SITES/LOCATIONS:

The tables are as follows:-
HZ_PARTIES_SITES : Stores information about parties and locations. Because there is a many-to-many relationship between parties and locations.
HZ_PARTIES_SITE_USES : Stores information about the party site uses and business purposes. A party site can have multiple site uses such as ‘bill to’ or ‘ship to’ and each site is stores as a record in this table.
HZ_LOCATIONS : Stores information about the locations, namely, address information
HZ_LOC_ASSIGNMENTS : It ties locations stored in HZ_LOCATIONS to a LOC_ID stored in AR_LOCATIONS_COMBINATIONS.

Entity Relationship Diagram:







--=============================================================================
-- Filename   : Customer Data Query
-- Language   : SQL
-- Module     : AR
-- Purpose    : Lists Customer (Party), Customer Account, and Customer Site
--              related information.
--=============================================================================
SELECT
       ----------------------------------------------------------
       -- Party Information
       ----------------------------------------------------------
       hp.party_number                      "Registry ID",
       hp.party_name                        "Party Name",
       hp.party_type                        "Party Type",
       DECODE(hp.status,
              'A''Active',
              'I''Inactive',
              hp.status)                    "Party Status",
       ----------------------------------------------------------
       -- Account Information
       ----------------------------------------------------------
       hca.account_number                   "Account Number",
       DECODE(hca.status,
              'A''Active',
              'I''Inactive',
              hca.status)                   "Account Status",
       hca.account_name                     "Account Description",
       hca.customer_class_code              "Classification",
       DECODE(hca.customer_type,
              'R''External',
              'I''Internal',
              hca.customer_type)            "Account Type",
       ----------------------------------------------------------
       -- Site Information
       ----------------------------------------------------------
       hps.party_site_number                "Customer Site Number",
       DECODE(hcas.status,
              'A''Active',
              'Inactive')                   "Site Status",
       DECODE(hcas.bill_to_flag,
              'P''Primary',
              'Y''Yes',
              hcas.bill_to_flag)            "Bill To Flag",
       DECODE(hcas.ship_to_flag,
              'P''Primary',
              'Y''Yes',
              hcas.ship_to_flag)            "Ship To Flag",
       hcas.cust_acct_site_id               "Customer Acct Site ID",
       ----------------------------------------------------------
       -- Address Information
       ----------------------------------------------------------
       hl.address1                          "Address1",
       hl.address2                          "Address2",
       hl.address3                          "Address3",
       hl.address4                          "Address4",
       hl.city                              "City",
       hl.state                             "State",
       hl.postal_code                       "Zip Code",
       ter.name                             "Territory",
       ----------------------------------------------------------
       -- DFF Information (specific to client)
       ----------------------------------------------------------
       hcas.attribute4                      "SMG Key",
       hcas.attribute8                      "GLN Key",
       hca.attribute3                       "Credit Approval Date",
       hca.attribute7                       "Credit Approved By",
       hca.attribute4                       "Acct Opened Date",
       hca.attribute5                       "Credit Collection Status",
       hca.attribute1                       "BPCS Last Trx Date",
       hca.attribute2                       "BPCS Avg Pay Days",
       hca.attribute6                       "BPCS RCM Reference",
       ----------------------------------------------------------
       -- Collector Information
       ----------------------------------------------------------
       col.name                             "Collector Name",
       ----------------------------------------------------------
       -- Account Profile Information
       ----------------------------------------------------------
       hcp.credit_checking                  "Credit Check Flag",
       hcp.credit_hold                      "Credit Hold Flag",
       hcpa.auto_rec_min_receipt_amount     "Min Receipt Amount",
       hcpa.overall_credit_limit            "Credit Limit",
       hcpa.trx_credit_limit                "Order Credit Limit",
       ----------------------------------------------------------
       -- Attachment Flag
       ----------------------------------------------------------
       NVL((SELECT 'Y'
              FROM fnd_documents_vl doc,
                   fnd_lobs         blo,
                   fnd_attached_documents att
             WHERE doc.media_id = blo.file_id
               AND doc.document_id = att.document_id
               AND att.entity_name = 'AR_CUSTOMERS'
               AND att.pk1_value   = hca.cust_account_id
               AND ROWNUM = 1), 'N'
       ) "Attachment Flag",
       ----------------------------------------------------------
       -- Party Relationship Flag
       ----------------------------------------------------------
       NVL((SELECT 'Y'
              FROM hz_cust_acct_relate_all hzcar
             WHERE hzcar.cust_account_id = hca.cust_account_id
               AND hzcar.relationship_type = 'ALL'
               AND ROWNUM = 1), 'N'
       ) "Party Relationship Flag",
       ----------------------------------------------------------
       -- Account Relationship Flag
       ----------------------------------------------------------
       NVL((SELECT 'Y'
              FROM hz_cust_acct_relate_all hzcar
             WHERE hzcar.cust_account_id = hca.cust_account_id
               AND ROWNUM = 1), 'N'
       ) "Account Relationship Flag",
       ----------------------------------------------------------
       -- Party Contact Flag
       ----------------------------------------------------------
       NVL((SELECT 'Y'
              FROM hz_parties hp2
             WHERE 1=1
               AND hp2.party_id = hp.party_id
               AND (
                    hp2.url IS NOT NULL OR
                    -- LENGTH(TRIM(hp.email_address)) > 5
                    INSTR(hp2.email_address, '@') > 0 OR
                    hp2.primary_phone_purpose IS NOT NULL
                    )
           ), 'N'
       ) "Party Contact Flag",
       ----------------------------------------------------------
       -- Account Contact Flag
       ----------------------------------------------------------
       NVL((SELECT 'Y'
              FROM hz_contact_points
             WHERE status = 'A'
               AND owner_table_id =
                   (SELECT hcar.party_id
                      FROM hz_cust_account_roles   hcar,
                           ar_contacts_v           acv
                     WHERE hcar.cust_account_id   = hca.cust_account_id
                       AND hcar.cust_account_role_id = acv.contact_id
                       AND hcar.cust_acct_site_id IS NULL  -- look for account level only
                       AND ROWNUM = 1 -- add this row to show inactive sites (i.e. with no site id)
                    )
               AND ROWNUM = 1), 'N'
       ) "Account Contact Flag",
       ----------------------------------------------------------
       -- Site Contact Flag
       ----------------------------------------------------------
       NVL((SELECT 'Y'
              FROM hz_contact_points
             WHERE status = 'A'
               AND owner_table_id =
                   (
                      SELECT hcar.party_id
                        FROM hz_cust_account_roles   hcar,
                             ar_contacts_v           acv
                       WHERE hcar.cust_acct_site_id     =  hcas.cust_acct_site_id
                         AND hcar.cust_account_role_id  =  acv.contact_id
                         AND ROWNUM = 1  -- add this row to show inactive sites (i.e. with no site id)
                   )
               AND ROWNUM = 1), 'N'      -- any contact (email, phone, fax) would suffice this condition
       ) "Site Contact Flag"
  FROM
       hz_parties              hp,
       hz_party_sites          hps,
       hz_cust_accounts_all    hca,
       hz_cust_acct_sites_all  hcas,
       hz_customer_profiles    hcp,
       hz_cust_profile_amts    hcpa,
       hz_locations            hl,
       ra_territories          ter,
       ar_collectors           col
 WHERE
    hp.party_id            =  hca.party_id
   AND hca.cust_account_id    =  hcas.cust_account_id(+)
   AND hps.party_site_id(+)   =  hcas.party_site_id
   AND hp.party_id            =  hcp.party_id  
   AND hca.cust_account_id    =  hcp.cust_account_id
   AND hps.location_id        =  hl.location_id(+)
   AND col.collector_id       =  hcp.collector_id
   AND hcas.territory_id      =  ter.territory_id(+)
   AND hcp.cust_account_profile_id = hcpa.cust_account_profile_id
   ----
   AND hp.party_type          = 'ORGANIZATION'    -- only ORGANIZATION Party types
   AND hp.status              = 'A'               -- only Active Parties/Customers
   ----
   -- following conditions are for testing purpose only
   -- comment/uncomment as needed
   ----
   -- AND hp.party_number        = 11530
   -- AND hca.account_number     = 32253 --32396 --31753 --32253 --31038
 ORDER BY TO_NUMBER(hp.party_number), hp.party_name, hca.account_number;

References

http://www.club-oracle.com/threads/oracle-apps-tca-tables.16312/

Oracle Certification exams

Exam Code Exam Name:-

1z0-001 Introduction to Oracle: SQL and PL/SQL
1z0-007 Introduction to Oracle9i: SQL
1z0-013 Oracle8: Database Administration
1z0-014 Oracle8: Performance Tuning
1z0-016 Oracle8: Network Administration
1z0-020 Oracle8i: New Features for Administrators
1z0-023 Architecture and Administration
1z0-024 Performance Tuning
1z0-025 Backup and Recovery
1z0-026 Network Administration
1z0-030 Oracle9i: New Features for Administrators
1z0-031 Oracle9i:Database Fundamentals I
1z0-032 Oracle9i:Database Fundamentals II
1z0-033 Oracle9i:Performance Tuning
1z0-035 Oracle 7.3 & 8 to Oracle9i DBA OCP Upgrade
1z0-036 Managing Oracle 9i on Linux
1z0-040 Oracle Database 10g: New Features for Administrators
1z0-041 Oracle Database 10g: DBA Assessment
1z0-042 Oracle Database 10g: Administration I
1z0-043 Oracle Database 10g: Administration II
1z0-045 Oracle Database 10g: New Features for Oracle8i OCPs
1z0-046 Oracle Datebase 10g: Managing Oracle on Linux for DBAs
1z0-047 Oracle Database SQL Expert
1z0-048 Oracle Database 10g R2: Administering RAC
1z0-050 Oracle Database 11g: New Features for Administrators
1z0-051 Oracle Database: SQL Fundamentals I
1z0-052 Oracle Database 11g: Administration I
1z0-055 Oracle Database 11g: New Features for 9i OCPs
1z0-101 Develop PL/SQL Program Units
1z0-108 Oracle WebLogic Server 10g System Administration
1z0-121 Developer/2000: Build Forms I
1z0-122 Developer/2000: Build Forms II
1z0-123 Developer/2000: Build Reports
1z0-131 Oracle9i, Build Internet Applications I
1z0-132 Oracle9i, Build Internet Applications II
1z0-140 Oracle9i Forms Developer: New Features
1z0-141 Oracle9i Forms Developer: Build Internet Applications
1z0-146 Oracle Database 11g: Advanced PL/SQL
1z0-147 Oracle9i: Program with PL/SQL
1z0-200 Oracle 11i E-Business Essentials
1z0-202 Siebel 8 Consultant Exam
1z0-204 Oracle EBS R12: E-Business Essentials
1z0-208 Oracle Comm. Billing and Revenue Management: Server Developer
1z0-209 Oracle Comm. Billing & Revenue Mgmt: Server Administrator
1z0-211 Oracle 11i General Ledger
1z0-212 Oracle Payables 11i Fundamentals
1z0-213 Oracle Receivables 11i Fundamentals
1z0-216 Oracle EBS R12: General Ledger and Receivables Fundamentals
1z0-221 Oracle 11i Inventory Management Fundamentals
1z0-222 Oracle Purchasing 11i Fundamentals
1z0-223 Oracle Order Management 11i Fundamentals
1z0-231 Implement Oracle Workflow 11i
1z0-232 Oracle 11i Systems Administrator
1z0-233 Oracle 11i Install, Patch and Maintain Applications
1z0-235 Oracle 11i Applications DBA:Fundamentals I
1z0-236 11i Applications DBA Fundamentals II
1z0-241 PeopleSoft Application Developer I: People Tools & PeopleCode
1z0-242 PeopleSoft Application Developer II: Application Engine & Integration
1z0-255 Hyperion Essbase 7.1.2 Consultant
1Z0-257 Hyperion Financial Management4.1 Consultant
1z0-259 Hyperion Planning 4.1 Consultant
1z0-264 Hyperion Essbase Analytics9.3 Developer
1z0-265 Hyperion BI+ 9.3 Administrator
1z0-271 Hyperion Financial Management9.3 Administrator I&II
1z0-272 Hyperion Planning 9.3 Administrator I&II
1z0-273 Hyperion Financial Management 4.1 Administrator I&II
1z0-301 Oracle9iAS: Basic Administrations
1z0-311 Oracle Application Server 10g: Administration I
1z0-312 Oracle Application Server 10g:Administration II
1z0-402 Oracle Enterprise Linux: Fundamentals
1z0-403 Enterprise Linux System Administration
1z0-501 Java Certified Programmer
1z0-615 Siebel 7.7 Consultant Core Exam
1z0-640 Siebel 7.7 Analytics Data Warehouse Dev.Prof.Core Exam
1z1-007 Oracle9i SQL
1z1-031 Oracle9i Database Fundamentals
1z1-033 Oracle 9i Performance Tuning

http://www.aiotestking.com/oracle/

Monday, July 27, 2015

the macro cannot be found or has been disabled because of your macro security settings(BI Publisher office 2010 and 2007)

Recently I have upgraded MS Office from 2007 to 2010. As I work on some BI projects, part of mine set of oracle programs is oracle BI Publisher Desktop, which use Word as report template designer. When I run BI Publisher macros in Word 2010 I got following error:



When I google term it seems that all advices were not useful. Here are two most common errors and how should Word be setup correctly:


Templates were correctly enabled:

But in Windows event viewer, curious error was more than obvious:



The solution

The solution shown here really works (tested on several computers), so I'm writing this down to be more like documentation for future reference to anyone stack on this case. Idea is to remove old *.EXD files from any location in %USERPROFILE% folders that might exists.
Because mine praxis is to have separate %USERPROFILE% folder location then where are OS files (different then partition then C:), exd file was found as shown. In mine case it was only in one folder:
D:\Users\DamirV\Application Data\Microsoft\Forms>dir
 Volume in drive D is Data

 Volume Serial Number is 505E-794F

 Directory of D:\Users\DamirV\Application Data\Microsoft\Forms

01.02.2011  11:45    <DIR>          .
01.02.2011  11:45    <DIR>          ..

12.03.2009  15:17           165.808 MSComctlLib.exd
31.08.2010  10:34            11.776 WINPROJ.box

01.02.2011  11:19             7.168 WINWORD.box
               3 File(s)        184.752 bytes

               2 Dir(s)  51.699.859.456 bytes free

D:\Users\DamirV\Application Data\Microsoft\Forms>
So all you have to do is:
Rename existing "MSComctlLib.exd" file to "MSComctlLib.exd_bak"
Open Word 2010
Open menu Add-Ins|Oracle BI Publisher|Log On
Last action will create new MSComctlLib.exd file in background:
D:\Users\DamirV\Application Data\Microsoft\Forms>dir
 Volume in drive D is Data

 Volume Serial Number is 505E-794F

 Directory of D:\Users\DamirV\Application Data\Microsoft\Forms

01.02.2011  11:45    <DIR>          .
01.02.2011  11:45    <DIR>          ..

01.02.2011  13:51           167.456 MSComctlLib.exd
12.03.2009  15:17           165.808 MSComctlLib.exd_old

31.08.2010  10:34            11.776 WINPROJ.box
01.02.2011  11:19             7.168 WINWORD.box

               3 File(s)        184.752 bytes
               2 Dir(s)  51.699.859.456 bytes free


D:\Users\DamirV\Application Data\Microsoft\Forms>

Notice different file size and file date of "MSComctlLib.exd". This is now Office 2010 version of EXD file which was not able to be created because of previous version. And that is all.



The EndIf you have upgraded several Office versions (i.e. 2000->2003->2007->2010), you might find ".EXD" files as well in following folders:
%USERPROFILE%\Application Data\Microsoft\Forms
%USERPROFILE%\Local Settings\Temp\Excel8.0

%USERPROFILE%\Local Settings\Temp\VBE
%USERPROFILE%\Local Settings\Temp\Word8.0
Like in previous example rename them and later (when you are sure that all works) you may delete.

Hope this helps!

Cheers!
Post festum part-IMPORTANT!!!
I have received many asks that people complaint about this issue was resolved and later after some Windows updates, all is back to same problem.
For them I have wrote this part what should help them.
Again first step is to rename all .exd files.
For 64-bit operating systems, type the following:
Regsvr32 "C:\Windows\SysWOW64\MSCOMCTL.OCX"
For 32-bit operating systems, type the following:
Regsvr32 "C:\Windows\System32\MSCOMCTL.OCX"
Restart your machine.