Friday, January 10, 2025

EBS : Package Development Process


======================Package Specification==================================

CREATE OR REPLACE PACKAGE xx_emp_package IS

    PROCEDURE log_message (

        p_procedure  VARCHAR2,

        p_message    VARCHAR2

    );


    PROCEDURE xx_validate;


    PROCEDURE xx_insert_valid_emp;

    

    PROCEDURE xx_insert_in_valid_emp;


    PROCEDURE xx_calling_prc;


END xx_emp_package;

=======================================================================


 ========================Package Body====================================

CREATE OR REPLACE PACKAGE BODY xx_emp_package IS


/*

Procedure To Print Messages 

*/


    PROCEDURE log_message (

        p_procedure  VARCHAR2,

        p_message    VARCHAR2

    ) IS

        l_err_msg VARCHAR2(2000);

    BEGIN

        l_err_msg := '<<'

                     || p_procedure

                     || ' - '

                     || p_message

                     || '>>';

        dbms_output.put_line('<<'

                             || p_procedure

                             || ' - '

                             || p_message

                             || '>>');


        fnd_file.put_line(fnd_file.log, l_err_msg);

    END log_message;

/*

Procedure To Validate Employee Record Columns 

*/


    PROCEDURE xx_validate IS


        l_error_msg   VARCHAR2(32000);

        status        VARCHAR2(20);

        v_first_name  VARCHAR2(200);

        v_last_name   VARCHAR2(200);

        v_full_name   VARCHAR2(200);

        v_sex         VARCHAR2(200);

        v_party_id    VARCHAR2(200);

        v_title       VARCHAR2(200);

        CURSOR c1 IS

        SELECT

            *

        FROM

            xx_temp_t

        WHERE

            nvl(status, 'N') IN ( 'N', 'E' );


    BEGIN

        FOR i IN c1 LOOP

            l_error_msg := NULL;

            status := NULL;

    

    --Validation For First Name


            log_message('xx_validate', 'Validating First Name');

            BEGIN

                SELECT

                    first_name

                INTO v_first_name

                FROM

                    xx_papf

                WHERE

                        person_id = i.person_id

                    AND first_name = i.firstname;


            EXCEPTION

                WHEN no_data_found THEN

                    l_error_msg := l_error_msg

                                   || ' ~ '

                                   || 'First Name Is In-valid';

                WHEN OTHERS THEN

                    l_error_msg := l_error_msg

                                   || ' ~ '

                                   || substr(sqlerrm, 1, 250);

            END;

    

    --Validation For Last Name


            log_message('xx_validate', 'Validating Last Name');

            BEGIN

                SELECT

                    last_name

                INTO v_last_name

                FROM

                    xx_papf

                WHERE

                        person_id = i.person_id

                    AND last_name = i.lastname;


            EXCEPTION

                WHEN no_data_found THEN

                    l_error_msg := l_error_msg

                                   || ' ~ '

                                   || 'Last Name Is In-valid';

                WHEN OTHERS THEN

                    l_error_msg := l_error_msg

                                   || ' ~ '

                                   || substr(sqlerrm, 1, 250);

            END;

    

    --Validation For Full Name


            log_message('xx_validate', 'Validating Full Name');

            BEGIN

                SELECT

                    full_name

                INTO v_full_name

                FROM

                    xx_papf

                WHERE

                        person_id = i.person_id

                    AND full_name = i.fullname;


            EXCEPTION

                WHEN no_data_found THEN

                    l_error_msg := l_error_msg

                                   || ' ~ '

                                   || 'Full Name Is In-valid';

                WHEN OTHERS THEN

                    l_error_msg := l_error_msg

                                   || ' ~ '

                                   || substr(sqlerrm, 1, 250);

            END;

        

    --Validation For Sex


            log_message('xx_validate', 'Validating Sex');

            BEGIN

                SELECT

                    sex

                INTO v_sex

                FROM

                    xx_papf

                WHERE

                        person_id = i.person_id

                    AND sex = i.sex;


            EXCEPTION

                WHEN no_data_found THEN

                    l_error_msg := l_error_msg

                                   || ' ~ '

                                   || 'Sex Is In-valid';

                WHEN OTHERS THEN

                    l_error_msg := l_error_msg

                                   || ' ~ '

                                   || substr(sqlerrm, 1, 250);

            END;

    

    --Validation For Party Id


            log_message('xx_validate', 'Validating Party Id');

            BEGIN

                SELECT

                    party_id

                INTO v_party_id

                FROM

                    xx_papf

                WHERE

                        person_id = i.person_id

                    AND party_id = i.party_id;


            EXCEPTION

                WHEN no_data_found THEN

                    l_error_msg := l_error_msg

                                   || ' ~ '

                                   || 'Party Id Is In-valid';

                WHEN OTHERS THEN

                    l_error_msg := l_error_msg

                                   || ' ~ '

                                   || substr(sqlerrm, 1, 250);

            END;

--Validation For Title


            log_message('xx_validate', 'Title');

            BEGIN

                SELECT

                    title

                INTO v_title

                FROM

                    xx_papf

                WHERE

                        person_id = i.person_id

                    AND title = i.title;


            EXCEPTION

                WHEN no_data_found THEN

                    l_error_msg := l_error_msg

                                   || ' ~ '

                                   || 'Title Is In-valid';

                WHEN OTHERS THEN

                    l_error_msg := l_error_msg

                                   || ' ~ '

                                   || substr(sqlerrm, 1, 250);

            END;


            IF l_error_msg IS NULL THEN

                UPDATE xx_temp_t

                SET

                    error_msg = l_error_msg,

                    status = 'V'

                WHERE

                    person_id = i.person_id;


                dbms_output.put_line('Employee Valid');

                log_message('xx_validate', 'Employee Valid:' || i.person_id);

            ELSE

                UPDATE xx_temp_t

                SET

                    error_msg = l_error_msg,

                    status = 'E'

                WHERE

                    person_id = i.person_id;


                log_message('xx_validate', 'Employee In-Valid:' || i.person_id);

            END IF;


        END LOOP;


        COMMIT;

    END xx_validate;

/*

Procedure To Insert Valid Employees In Table

*/


    PROCEDURE xx_insert_valid_emp IS

        v_count NUMBER;

        CURSOR c1 IS

        SELECT

            *

        FROM

            xx_temp_t

        WHERE

            status = 'V';


    BEGIN

        FOR i IN c1 LOOP

            log_message('xx_insert', 'Started Inserting Valid Employees In Table');

            INSERT INTO xx_valid_emp (

                person_id,

                empno,

                firstname,

                lastname,

                fullname,

                sex,

                title,

                party_id

            ) VALUES (

                i.person_id,

                i.empno,

                i.firstname,

                i.lastname,

                i.fullname,

                i.sex,

                i.title,

                i.party_id

            );


            log_message('xx_insert', 'END Inserting');

        END LOOP;


        BEGIN

            SELECT

                COUNT(*)

            INTO v_count

            FROM

                xx_valid_emp;


        END;

        log_message('xx_insert', 'Total Count Of Valid Employee Records Inserted:' || v_count);

        COMMIT;

    END xx_insert_valid_emp;

    


/*

Procedure To Insert In-Valid Employees In Table

*/


    PROCEDURE xx_insert_in_valid_emp IS

        v_count NUMBER;

        CURSOR c1 IS

        SELECT

            *

        FROM

            xx_temp_t

        WHERE

            status = 'E';


    BEGIN

        FOR i IN c1 LOOP

            log_message('xx_insert_in_valid_emp', 'Started Inserting In-Valid Employees In Table');

            INSERT INTO XX_IN_VALID_EMP (

                person_id,

                empno,

                firstname,

                lastname,

                fullname,

                sex,

                title,

                party_id,

                status,

                error_msg

            ) VALUES (

                i.person_id,

                i.empno,

                i.firstname,

                i.lastname,

                i.fullname,

                i.sex,

                i.title,

                i.party_id,

                i.status,

                i.error_msg

            );


            log_message('xx_insert_in_valid_emp', 'END Inserting');

        END LOOP;


        BEGIN

            SELECT

                COUNT(*)

            INTO v_count

            FROM

                xx_valid_emp;


        END;

        log_message('xx_insert_in_valid_emp', 'Total Count Of In-Valid Employee Records Inserted:' || v_count);

        COMMIT;

    END xx_insert_in_valid_emp;



/*

Procedure Call The Above Procedures In A Sequence

*/


    PROCEDURE xx_calling_prc IS

    BEGIN

        log_message('XX_CALLING_PRC', 'Calling XX_VALIDATE Procedure');

        xx_validate;

        log_message('XX_CALLING_PRC', 'Calling XX_INSERT_VALID_EMP Procedure');

        xx_insert_valid_emp;

        log_message('XX_CALLING_PRC', 'Calling XX_INSERT_IN_VALID_EMP Procedure');

        xx_insert_in_valid_emp;

    END xx_calling_prc;


END xx_emp_package;


=======================================================================

=========================Testing Scripts====================================

--Similar Table Created as per_all_people_f to do comparison of data


SELECT

    *

FROM

    xx_papf;


--To Set STATUS and ERROR_MSG Null


UPDATE xx_temp_t

SET

    status = '',

    error_msg = '';


--Temporary Table created in which STATUS & ERROR_MSG is stored.


SELECT

    *

FROM

    xx_temp_t;


--Execution Of Calling Procudure in which all other Procedures are invoked in a sequence.


EXEC xx_emp_package.xx_calling_prc;


-- Table created to insert all the valid records in the Custom table.


SELECT

    *

FROM

    xx_valid_emp;


-- To delete all the records from custom table in which valid records are inserted.


TRUNCATE TABLE xx_valid_emp;


-- Table created to insert all the In-valid records in the Custom table.


SELECT

    *

FROM

    xx_in_valid_emp;


-- To delete all the records from custom table in which In-valid records are inserted.


TRUNCATE TABLE xx_in_valid_emp;

Thursday, January 9, 2025

Fusion : BIP Report With Multi Selection & Parameter Printing Logic

Fusion :  BIP Report With Multi Selection & Parameter Printing Logic 


=========================================================

Tracking

=========================================================


Select *

from hr_all_organization_units

where ORGANIZATION_ID=300000001829266 

  

Select *

from ap_invoices_all

where 1=1

and ORG_ID=300000001829266

and invoice_id=1094


Select *

from poz_suppliers_v

where vendor_id=300000004110228


Select *

from poz_supplier_sites_v

where vendor_id=300000004110228


=========================================================

MAIN Query

=========================================================

Select 

hou.NAME Organization_NAME,

    aia.INVOICE_NUM,

    aia.invoice_amount,

    (Select segment1

from poz_suppliers_v

where vendor_id=aia.vendor_id) Supplier_Number,

(Select VENDOR_NAME

from poz_suppliers_v

where vendor_id=aia.vendor_id) Supplier_Name,

    (Select VENDOR_SITE_CODE

from poz_supplier_sites_v

where vendor_id=aia.vendor_id

and vendor_site_id=aia.vendor_site_id) Supplier_Site_Name

from 

hr_all_organization_units hou,

ap_invoices_all aia

Where 

1=1

and hou.ORGANIZATION_ID=aia.ORG_ID

--and hou.ORGANIZATION_ID = NVL(:P_ORG_NAME,hou.ORGANIZATION_ID)

and (hou.ORGANIZATION_ID IN(:P_ORG_NAME) OR 'ALL' IN(:P_ORG_NAME||'ALL'))

--and aia.invoice_id= NVL(:P_INVOICE_ID,aia.invoice_id)

and (aia.invoice_id IN(:P_INVOICE_NUM) OR 'ALL' IN(:P_INVOICE_NUM||'ALL'))

=========================================================

Parameter LOV Query

=========================================================

Select name,ORGANIZATION_ID

from hr_all_organization_units

Select invoice_num,invoice_id

from ap_invoices_all

where org_id in(:P_ORG_NAME)

--(hou.ORGANIZATION_ID In(:P_ORG_NAME) Or 'All' In(:P_ORG_NAME||'All'))

   (aia.invoice_id IN(:P_INVOICE_NUM) OR 'ALL' IN(:P_INVOICE_NUM||'ALL'))  ---Logic used in main Query for multiselection of paramters values


===========Parameters Printing Logic ================================

------------------------------------------------------

Parameter Priniting When parameters are multiselected 


LISTAGG() is used to print the multiselected paramter 

values ',' comma seperated.

------------------------------------------------------

select 

nvl(

(Select  listagg(name,',')within group(order by name)

from hr_all_organization_units

where ORGANIZATION_ID in(:P_ORG_NAME)),'All'

)v_bu,

 

nvl(

(Select  listagg(invoice_num,',')within group(order by invoice_num)

from ap_invoices_all

where invoice_id in(:P_INVOICE_NUM)),'All'

)v_in

from dual

---------------------------------------------------------------------

Parameter Priniting when parameter are not multiselected

---------------------------------------------------------------------

nvl2(:P_INVOICE_ID,

(Select invoice_num

from ap_invoices_all

where invoice_id =:P_INVOICE_NUM

),'All' )v_in

=========================================================

Wednesday, January 8, 2025

AP Invoice Payment Accounting Tacking

 

Select *

from ap_invoice_payments_all

where invoice_id=10033;                --CHECK_ID=10228, ACCOUNTING_EVENT_ID=51758


Select *

from ap_checks_all

where CHECK_ID=10228;            --CHECK_NUMBER=29151


Select *

from ap_payment_schedules_all

where invoice_id=10033;


Select *

from xla_ae_headers

where event_id=51758;                --AE_HEADER_ID=16698


Select *

from xla_ae_lines

where AE_HEADER_ID=16698

and ACCOUNTING_CLASS_CODE='LIABILITY';     --GL_SL_LINK_ID=25983,                      CODE_COMBINATION_ID=1015


Select *

from gl_import_references

where GL_SL_LINK_ID=25983;            --JE_HEADER_ID=8161, JE_LINE_NUM=2


Select *

from gl_je_headers

where JE_HEADER_ID=8161;


Select *

from gl_je_lines

where JE_HEADER_ID=8161

and JE_LINE_NUM=2;                --PERIOD_NAME=Feb-11


Select *

from gl_balances

where period_name='Feb-11'

and CODE_COMBINATION_ID=1015;            --5169750.52


Select sum(NVL(ACCOUNTED_DR,0))dd

from gl_je_lines

where period_name='Feb-11'

and CODE_COMBINATION_ID=1015;            --5169750.52


Sum of ACCOUNTED_DR from GL_JE_LINES should be equal to PERIOD_NET_DR of GL_BALANCES  i.e.

5169750.52          = 5169750.52

AP Invoice Accounting Tracking

 Select *

from ap_invoices_all

where INVOICE_NUM='110120309';


Select *

from ap_invoice_lines_all

where invoice_id=10033;


Select *

from ap_invoice_distributions_all

where invoice_id=10033;--ACCOUNTING_EVENT_ID=43069,DIST_CODE_COMBINATION_ID=2044


Select *

from xla_ae_headers

where event_id=43069;--AE_HEADER_ID=10324


Select *

from xla_ae_lines

where AE_HEADER_ID=10324

and ACCOUNTING_CLASS_CODE='LIABILITY';--GL_SL_LINK_ID=10664


Select *

from ap_suppliers

where vendor_id=113;


select *

from ap_supplier_sites_all

where vendor_id=113

and vendor_site_id=116;

Tuesday, December 3, 2024

Interface In Oracle Apps R12

 

What is Interface

What is a interface?
In terms of oracle applications interface is a communication channel that allows the data to move in and out of the system.

How many types of interfaces are there?
1.INBOUND INTERFACES
2.OUTBOUND INTEFACES

Inbound InterFace:The one which allows data to get into oracle application from outside is called inbound interface.

OutBound Interface:The one which allows data to get data from oracle applications to other systems is called outbound interface.

What are different types of inbound interfaces available?
1.Open interfaces
2.API's(Application Program Interface)
3.EDI(Electronic Data interchange)--Mainly used for automation transactions with third party systems
4.XML GATEWAY --Mainly used for automation transactions with third party systems
5.WEBADI--Used for uploading data from excel with the scope to have some validations--mainly used for one time loading..Just like sqlloader+validation program..
5. PLSQL Packages for Reading XML Data--Use this in case of importing non standard transactions

What are different types of outbound interfaces available?
1. Custom programs where we pull data to a csv file using UTL_FILE in the required format
2.EDI
3.XMLGATEWAY
4.PLSQL Packages for generating XML

what is the difference between OPEN INTERFACE & API's?
OPEN INTERFACE:
I dont see much difference between the open other than the way we load data.
In case of open interface the data is loaded in to open interfce table like GL_INTERFACE or Sales Order Interface(OE_ORDER_HEADERS_IFACE_ALL).
Run the interface import program.
This will validate the data and put it into oracle applications.All the invalid records are marked as Error.
One thing is there are GUI Screens available for most of these interface where you check the errror message correct it there only and resubmit the interface.
From the technical perspective there are Error tables available for each interface

API:
API's are the oracle built packages where the validation logic is wrapped inside a package and the data is passed as parameters to the API.
Most of these api's use the PLSQL tables as parameters to take the advantage of bulk binding concepts for faster loading data.
They will have the two OUT parameters to throw back the error code and message in case of data validation failure
Apis' are comparatively faster than open interfaces.
If a API's and open interface are available it is better to load through API's.If the records are more...


Interfaces and conversions procedure
Data can feeded in 3 ways

1. The Data can be entered using the application Screens.

2.The data can be entered using Oracle’s Open System Interface.

3. The data can be stored in the database table directly

Conversion An overview of its process

(Inbound Process)

1. Get data from legacy system Called Flat file.

2. Load the flat file data into temporary table called staging table using sqlloader

(control files are used .ctl extensions)

3. Validate the data in staging table using pl/sql procedures to define rules of validation.

4. Successful Validation rakes up the data to the interface tables.

5. These Validate data can be directed to base tables using predefined Seeded programs.

(Outbound process)

 
outbound Interface Process:
=============================

1)Develop the PL/SQL Program (Either Procedure or Package)

2)Write the Cursor to retrieve the data from database tables.

3)Create file or Open the File by using UTL_File.fopen().

4)Open the Cursor

5)If any validations are there write the validations

6)Transfer the Data into File by using UTL_File.Put_Line().

7)Close the Cursor.

8)Close the File by using UTL_File.fclose();

9)Register the Procedure or Package as Concurrent Program and submit from SRS Window.


We will use following three functions to generate the file.

1)Utl_File.fopen     = To open (or) Create the file
2)Utl_File.Put_line  = To Transfer the data into the File.
3)Utl_File.fclose    = To close the File after Data transfer.


Difference between Conversion and Interface

1. Conversion is one-time process 1. Interface is the post production

which is performed once before process. Productions go on live. (Pre-production process)

2. Data comes in to Oracle Applications 2. Interface is the integration of

only (One way process) two systems.

3. Interactive Process 3. Scheduled and repetive process.

 

Open Interface Tables are standard Oracle tables.

-Oracle uses OITs to provide a simple interface to Oracle base tables.

-Oracle has list of all the open interface that oracle offered in their product.

Interface Program



- It is an inbuilt program in most of the modules to pull up the data from the interface table

Under validations sends data to base tables,if validation fails Displays data to Error a error message






Important Interface Tables
GL INTERFACE TABLES 

GL_BUDGET_INTERFACE TABLE
GL_DAILY_RATES_INTERFACE TABLE
GL_IEA_INTERFACE TABLE
GL_INTERFACE TABLE
GL_INTERFACE_CONTROL TABLE
GL_INTERFACE_HISTORY TABLE

AP INTERFACE TABLES

AP_INTERFACE_CONTROLS TABLE
AP_INTERFACE_REJECTIONS TABLE
AP_INVOICES_INTERFACE TABLE
AP_INVOICE_LINES_INTERFACE TABLE

AR INTERFACE TABLES

 
AR_PAYMENTS_INTERFACE_ALL TABLE
AR_TAX_INTERFACE TABLE
HZ_DQM_SYNC_INTERFACE TABLE
HZ_PARTY_INTERFACE TABLE
HZ_PARTY_INTERFACE_ERRORS TABLE
RA_CUSTOMERS_INTERFACE_ALL TABLE
RA_INTERFACE_DISTRIBUTIONS_ALL TABLE
RA_INTERFACE_ERRORS_ALL TABLE
RA_INTERFACE_LINES_ALL TABLE
RA_INTERFACE_SALESCREDITS_ALL TABLE
FA INTERFACE TABLES

 
FA_BUDGET_INTERFACE TABLE
FA_INV_INTERFACE TABLE
FA_PRODUCTION_INTERFACE TABLE
FA_TAX_INTERFACE TABLE

INVENTORY INTERFACE TABLES

MTL_CC_ENTRIES_INTERFACE TABLE
MTL_CC_INTERFACE_ERRORS TABLE
MTL_CI_INTERFACE TABLE
MTL_CI_XREFS_INTERFACE TABLE
MTL_COPY_ORG_INTERFACE TABLE
MTL_CROSS_REFERENCES_INTERFACE TABLE
MTL_DEMAND_INTERFACE TABLE
MTL_DESC_ELEM_VAL_INTERFACE TABLE
MTL_EAM_ASSET_NUM_INTERFACE TABLE
MTL_EAM_ATTR_VAL_INTERFACE TABLE
MTL_INTERFACE_ERRORS TABLE
MTL_INTERFACE_PROC_CONTROLS TABLE
MTL_ITEM_CATEGORIES_INTERFACE TABLE
MTL_ITEM_CHILD_INFO_INTERFACE TABLE
MTL_ITEM_REVISIONS_INTERFACE TABLE
MTL_ITEM_SUB_INVS_INTERFACE TABLE
MTL_OBJECT_GENEALOGY_INTERFACE TABLE
MTL_RELATED_ITEMS_INTERFACE TABLE
MTL_RESERVATIONS_INTERFACE TABLE
MTL_RTG_ITEM_REVS_INTERFACE TABLE
MTL_SECONDARY_LOCS_INTERFACE TABLE
MTL_SERIAL_NUMBERS_INTERFACE TABLE

MTL_SO_RMA_INTERFACE TABLE
MTL_SYSTEM_ITEMS_INTERFACE TABLE
MTL_TRANSACTIONS_INTERFACE TABLE
MTL_TRANSACTION_LOTS_INTERFACE TABLE
MTL_TXN_COST_DET_INTERFACE TABLE

PO INTERFACE TABLES

PO_DISTRIBUTIONS_INTERFACE TABLE
PO_HEADERS_INTERFACE TABLE
PO_INTERFACE_ERRORS TABLE
PO_LINES_INTERFACE TABLE
PO_REQUISITIONS_INTERFACE_ALL TABLE
PO_REQ_DIST_INTERFACE_ALL TABLE
PO_RESCHEDULE_INTERFACE TABLE
RCV_HEADERS_INTERFACE TABLE
RCV_LOTS_INTERFACE TABLE
RCV_SERIALS_INTERFACE TABLE
RCV_TRANSACTIONS_INTERFACE TABLE

BOM INTERFACE TABLES


BOM_BILL_OF_MTLS_INTERFACE TABLE
BOM_INTERFACE_DELETE_GROUPS TABLE
BOM_INVENTORY_COMPS_INTERFACE TABLE
BOM_OP_RESOURCES_INTERFACE TABLE
BOM_OP_ROUTINGS_INTERFACE TABLE
BOM_OP_SEQUENCES_INTERFACE TABLE
BOM_REF_DESGS_INTERFACE TABLE
BOM_SUB_COMPS_INTERFACE TABLE
CST_COMP_SNAP_INTERFACE TABLE
CST_INTERFACE_ERRORS TABLE
CST_ITEM_COSTS_INTERFACE TABLE
CST_ITEM_CST_DTLS_INTERFACE TABLE
CST_PC_COST_DET_INTERFACE TABLE
CST_PC_ITEM_COST_INTERFACE TABLE

WIP INTERFACE TABLES

WIP_COST_TXN_INTERFACE TABLE
WIP_INTERFACE_ERRORS TABLE
WIP_JOB_DTLS_INTERFACE TABLE
WIP_JOB_SCHEDULE_INTERFACE TABLE
WIP_MOVE_TXN_INTERFACE TABLE
WIP_SCHEDULING_INTERFACE TABLE
WIP_TXN_INTERFACE_ERRORS TABLE

Thursday, November 7, 2024

R12-TCA -Trading Community Architecture

 

R12-TCA -Trading Community Architecture

1.Overview TCA (Trading Community Architecture)

• TCA is a structure which was based out of R11 Customer Model designed to support complex trading relationships to cater additional need which further extended in R12 with Supplier and Bank.

• So, TCA is a data model that allows you to manage complex information about the parties, or customers or suppliers or bank who belong to your commercial community, including organizations, locations, and the network of hierarchical relationships among them.

TCA is a universal data schema for

  1. Customer
  2. Bank and Branch
  3. Supplier
  4. Student
  5. Employee
  6. Legal entity & intercompany
  7. Prospects
  8. Distributors
  9. Resellers
  10. Consortiums

TCA Terminology

Party is any entity with which you could potentially do business. It could be an organisation, an individual or

a relationship (like a partnership or consortium).

Location is a point in geographical space described by a street address. In previous releases of Oracle, there

was a risk of some data redundancy if more than one customer shared the same site or location. The new

model eliminates this redundancy.

An Account represents the business (selling) relationship that a company deploying Oracle Applications has with

a party. (Thus your customers have become accounts as you migrated to 11i and your old Accounts

Receivable customer number is now the new TCA account number.). You can have more than one account

with a single party, if you need to model separate selling relationships. For example two of your lines of

business might conduct business with a party on different terms.

Relationship between 2 parties is also treated as a party of the type relationship. Relationships can be

independent of you (the deploying company), thus you can now capture the link between a partner who sells

on your behalf and their customers, as well as relationship between your customers like “competitor of”.

Party Site links a party with a location, indicating that party’s usage of the location.

An Account Site is a party site that is used by a customer account, for example, for billing or shipping purposes.

(Account Sites are Organisation specific in Multi-Org terms, just as Customer Sites were.)

Contact is a person in the context of an organisation, modelled as a relationship between an organisation and a

person or between two people, (this can be either a party contact or an account contact).

Contact Point is a means of contacting a party, for example, a phone number, e-mail address, or fax number.

2 . Suppliers – Moved to TCA

We have seen in 11i

  • Suppliers defined in AP.
  • Supplier contacts replicated for each supplier site.

Where as in R12

  • Supplier becomes as TCA Party.
  • Suppliers Sites as TCA Party Site for each distinct address.
  • Contacts for each supplier/address , it means Single supplier address and contact can be leveraged by multiple sites, for each OU
    • A single change to an address can be seen instantly by all OUs
    • No longer need to manually ‘push’ updates across OUs.This can be best understood by the figure below

 

TOI : Solution Overview

The Supplier, Sites/Locations, and their Contact information will be migrated to TCA. As part of the migration we have introduced three new tables: AP_SUPPLIERS, AP_SUPPLIER_SITES_ALL, and AP_SUPPLIER_CONTACTS. These tables will hold the attributes that represent the terms and conditions of the deploying company doing business with this supplier and the necessary transaction defaults. To minimize the impact to the other products, views are provided with the names PO_VENDORS, PO_VENDOR_SITES_ALL, and PO_VENDOR_CONTACTS. These views will be based on the information from TCA and Payables Suppliers tables.

As a result of this, the Suppliers (AP_SUPPLIERS) will represent the Supplier account and will carry all Supplier level profile information that will default to the transactions. The Suppliers Sites (AP_SUPPLIER_SITES_ALL) will represent the supplier site account information in the context of an operating unit. The Contacts (AP_SUPPLIER_CONTACTS) are created to support backwards compatibility, so that impacted products (such as Purchasing ) do not have to upgrade transaction data that carries the reference to vendor contact IDs.

Note: The existing Suppliers tables PO_VENDORS, PO_VENDOR_SITES_ALL, and PO_VENDOR_CONTACTS are obsoleted and renamed as PO_VENDORS_OBS, PO_VENDOR_SITES_OBS, and PO_VENDOR_CONTACTS_OBS.

  • Suppliers — With the new architecture, the Supplier entity will represent the supplier account for a party record in TCA. The Suppliers table will be updated with the unique Party identifier for reference purposes.
  • Supplier Sites — The supplier sites table will store the Site account attributes per Operating Unit, which will default into transactions. Going forward, supplier site creation will involve either selecting an existing location for the supplier or creating a new location in HZ_LOCATIONS. The user will then have to select the Operating Unit based on the security profile, and enter the site attributes as they are entered today.
  • Contacts — Contacts are modeled as a child entity to Supplier Sites in Release 12. Since the Supplier Sites are striped by Operating Unit, the contact records are implicitly striped by Operating Unit. This required our customers to enter/maintain the same contact information more than once if the implementing company did business with the same Supplier Site in more than one Operating Unit.
    For example: Adam Smith is the Contact in the San Mateo site of ABC supplier. If Company A does business with ABC supplier from two operating units, then the contact Adam Smith should be entered as a contact twice, once for the San Mateo Site – OU1 and another for the San Mateo Site – OU2. In an ideal case, Contacts could be defined for Supplier or for a particular Location of the Supplier. There is no need to stripe the contact information by Operating Unit. With the decision to move the address information to TCA, the suggested approach for modeling contacts would be to leverage the TCA contacts model completely.
    Contacts in TCA are modeled differently. Each contact (person) is represented as a party first. A relationship is then created between the person party and the organization party (customer, supplier, etc). This relationship itself is reflected as a party record in TCA. All the contact points (for example, email, fax, phone) are tied to the party record, which represents the relationship. The contact information can be defined for a Party, Party Site, and Party Relationship in TCA. Since contact information is maintained at the Supplier Site level for a particular Operating Unit, Payables will do an as-is approach to replicate the data into TCA. TCA does not have the relationship party reference with respect to the Site (it is not required), AP will have to link Supplier Site contact to the TCA Relationship party using the TCA’s HZ_ORG_CONTACTS table. The HZ_ORG_CONTACTS table will carry some information about the contact such as department information.
    If we take the case mentioned above, Adam Smith will be defined as a person party. One new relationship record will be created between Adam Smith and ABC Supplier. This relationship is also a party. All the information about Adam’s Departments will be moved to Org Contacts with reference to the San Mateo Site and Adam’s relationship with ABC Supplier. All contact details will be represented as Contact Point records against the relationship party reference.

Employees who were created as Suppliers for expense reimbursement now are associated with Person Parties.

Suppliers open interface tables in Release 12

There is a new interface table for banks in R12 ,IBY_TEMP_EXT_BANK_ACTS. If records are populated in the IBY External Payee Accounts table, then the program will call the necessary APIs from Oracle Payments to create the Supplier Bank Accounts for the supplier/site.

3 . Banking Details – Moved to TCA

 

If we compare the bank with 11i vs R12, we can notice the bank was utilized into three different places,which requires altogether a different setup.

  • finance
  • payroll
  • treasury

So now r12 this was well taken care and integration is built. There are plans under way for all bank account data models in the various products to be consolidated in the new TCA architecture

In 11i

  • Banks/Branches defined in AP
  • Bank accounts often replicated in multiple OUs Before

R12

  • Suppliers, Banks and Branches are defined as Parties in TCA
  • Supplier (party’s) payment information and all payment instruments (Bank Accounts, Credit Cards) moved into Oracle Payments.
  • Internal Bank Account in Cash Management which is owned by a Legal Entity. Here the Operating units have granted usage rights
  • In Release 12, each internal bank account is assigned to a Legal Entity. Any or all operating units associated with that legal entity are permitted to use that bank account
  • In Release 12 provides a centralized repository for suppliers and customers bank account and credit card information. All data is stored in one, secure place, providing shared service centers and collection departments consistent information that they need

 

Three banks you can manage in EBS

  • House Bank or internal bank – In Release 12, each internal bank account is assigned to a Legal Entity. Any or all operating units associated with that legal entity are permitted to use that bank account.
  • External bank for supplier and Customer – In Release 12 provides a centralized repository for suppliers and customers bank account and credit card information. All data is stored in one, secure place, providing shared service centers and collection departments consistent information that they need.
  • Intermediary bank for SEPA payment : An intermediary bank is a financial institution that as a relationship with the destination bank (in this case the supplier bank account you are setting up) which is not a direct correspondent of the source bank (the disbursement bank in AP/Payments), which facilities the funds transfer to the destination bank.
  • This is important when paying a foreign supplier from a domestic disbursement account, there may be an intermediary bank used, and it would be set up on the supplier bank account. Although the intermediary bank UI is owned by Payments, the implementation is as embeddable UI components in pages owned by i-supplier Portal (suppliers) and AR/Collections (customers). You can enter intermediary bank accounts on Suppliers->Entry->Banking Details->Bank Account Details

In Release 12, bank accounts can be assigned at the following four levels:

1. Supplier

2. Site

3. Address

4. Address-Operating Unit

New accounts can be created using existing bank and branch details or new bank/branches can also be entered.The bank accounts for a supplier can also be setup from iSupplier portal and this initiates a change request process. The buyer administrator is notified of the bank account addition in the “To-Do List” and can either approve the account, verify the account or reject the account assignment.

TCA Model – Bank  

Within TCA model, here is various BANK attributes how they fits inside the model

Key Tables in Cash Management & TCA

• CE_BANK_ACCOUNTS stores bank account attributes

• CE_BANK_ACCT_USES_ALL  – This stores the bank account use attributes specific to Operating Unit (AR, AP) and Legal Entity (Treasury).
• CE_GL_ACCOUNTS_CCID for bank account use accounting data

Bank accounts, bank account uses are migrated into cash management. Bank Accounts will be stored in a new table called CE_BANK_ACCOUNTS and will be located at a Bank Branch

The TCA party model is being used to model banks and bank branches as parties with the associated attributes of Relationships, Address, Contact and Locations. The TCA tables used by Cash Management for modeling Banks and Bank Branches are listed below:

  1. HZ_PARTIES
  2. HZ_RELATIONSHIPS
  3. HZ_RELATIONSHIP_TYPES
  4. HZ_ORG_CONTACTS
  5. HZ_ORG_CONTACT_ROLES
  6. HZ_CONTACT_POINTS
  7. HZ_PARTY_SITES
  8. HZ_LOCATIONS
  9. HZ_ORGANIZATION_PROFILES

The HZ_ORGANIZATION_PROFILES table stores additional attributes of banks and bank branches along with the history of changes made to Banks and Bank Branches. The contact person at the bank, bank branch and bank account is defined as a party in HZ_PARTIES, while the contact details will be stored in HZ_CONTACT_POINTS (stores contact methods), HZ_ORG_CONTACTS (stores the contact’s title) and HZ_ORG_CONTACT_ROLES (stores the contact’s purpose or role). The address details of Banks and Bank Branches will be in HZ_LOCATIONS (stores addresses) and HZ_PARTY_SITES (stores party sites).

The new table CE_BANK_ACCOUNT stores bank account attributes while the CE_BANK_ACCT_USES_ALL table stores the bank account use attributes specific to Operating Unit (AR, AP) and Legal Entity (Treasury).

The accounting data pertaining to the bank account use will be stored in the CE_GL_ACCOUNTS_CCID table.

All of the bank, branch and bank account related attributes in AP_BANK_BRANCHES and AP_BANK_ACCOUNTS_ALL tables will be upgraded to HZ_PARTIES and the new tables in Cash Management.

 

 

ER Diagram(Bank Model) TCA ,Bank & Suppliers

Table level information

  • The supplier bank account information is in the table: IBY_EXT_BANK_ACCOUNTS, the bank and bank branches information is in the table HZ_PARTIES.
  • Creating a supplier in AP now creates a record in HZ_PARTIES. In the create Supplier screen, you will notice that that Registry_id is the party_number in HZ_Parties.
  • The table hz_party_usg_assignments table stores the party_usage_code SUPPLIER, and also contains the given party_id for that supplier. Running this query will return if customer was a SUPPLIER or CUSTOMER
  • Payment related details of supplier are also inserted in iby_external_payees_all as well as iby_ext_party_pmt_mthds
  • IBY_EXT_BANK_ACCOUNTS, the bank and bank branches information is in the table: HZ_PARTIES.
  • The master record that replaces PO_VENDORS is now AP_SUPPLIERS. PO_VENDORS is a view that joins AP_SUPPLIERS and HZ_PARTIES.
  • The table that hold mappings between AP_SUPPLIERS.VENDOR_ID and HZ_PARTIES.PARTY_ID is PO_SUPPLIER_MAPPINGS. Query by party_id.
  • The bank branch number can be found in the table: HZ_ORGANIZATION_PROFILES .The HZ_ORGANIZATION_PROFILES table stores a variety of information about a party. This table gets populated when a party of the Organization type is created.
  • The link between PO_VENDORS and HZ_PARTIES is PO_VENDORS.party_id.
  • The link between PO_VENDOR_SITES_ALL and HZ_PARTY_SITES is PO_VENDOR_SITES_ALL.party_site_id.
  • When a Supplier is created Record will be Inserted in HZ_PARTIES. When the Supplier Site is created Record will be Inserted in HZ_PARTY_SITES. When Address is created it will be stored in HZ_LOCATIONS
  • When a bank Is Created, the banking information will be stored in
  • IBY_EXT_BANK_ACCOUNTS IBY_EXT_BANK_ACCOUNTS.BANK_id = hz_paties.party_id
  • When the Bank is assigned to Vendors then it will be updated in HZ_CODE_ASSIGNMENTS.
  • HZ_CODE_ASSIGNMENTS.owner_table_id = IBY_EXT_BANK_ACCOUNTS.branch_id.

Obsolete Tables

Table Name                                 Feature Area                                          Replaced By                                                                  
AP_BANK_BRANCHESBank/Bank Branches CE_BANK_BRANCHES_V
AP_BANK_ACCOUNTS_ALL Bank Accounts including Internal and External CE_BANK_USES_OU_V/IBY_EXT_BANK_ACCOUNTS_V
AP_BANK_ACCOUNTS_USES_ALL Remit to Bank Account Uses

AR TO TCA Tracking

 SELECT *

FROM   ra_customer_trx_all rct
WHERE  rct.trx_number = Nvl(:P_TRX_NUM, '263')
==============================================================================================================================================================================

SELECT *
FROM   hz_cust_accounts hca
WHERE  hca.cust_account_id IN (SELECT rct.bill_to_customer_id
                               FROM   ra_customer_trx_all rct
                               WHERE  rct.trx_number = Nvl(:P_TRX_NUM, '263'))
==============================================================================================================================================================================

SELECT *
FROM   hz_parties hp
WHERE  hp.party_id IN (SELECT hca.party_id
                       FROM   hz_cust_accounts hca
                       WHERE  hca.cust_account_id IN
                              (SELECT rct.bill_to_customer_id
                               FROM   ra_customer_trx_all rct
                               WHERE
                              rct.trx_number = Nvl(:P_TRX_NUM, '263')))
==============================================================================================================================================================================

SELECT *
FROM   hz_party_sites HPS
WHERE  hps.party_id IN (SELECT hca.party_id
                        FROM   hz_cust_accounts hca
                        WHERE  hca.cust_account_id IN
                               (SELECT rct.bill_to_customer_id
                                FROM   ra_customer_trx_all rct
                                WHERE
                               rct.trx_number = Nvl(:P_TRX_NUM, '263')))
==============================================================================================================================================================================

SELECT *
FROM   hz_locations hl
WHERE  hl.location_id IN (SELECT hps.location_id
                          FROM   hz_party_sites HPS
                          WHERE  hps.party_id IN (SELECT hca.party_id
                                                  FROM   hz_cust_accounts hca
                                                  WHERE  hca.cust_account_id IN
                                 (SELECT rct.bill_to_customer_id
                                  FROM   ra_customer_trx_all rct
                                  WHERE
                                 rct.trx_number = Nvl(:P_TRX_NUM, '263'))))
==============================================================================================================================================================================

SELECT *
FROM   hz_cust_acct_sites_all hcasa
WHERE  hcasa.cust_account_id IN (SELECT hca.cust_account_id
                                 FROM   hz_cust_accounts hca
                                 WHERE  hca.cust_account_id IN
                                        (SELECT rct.bill_to_customer_id
                                         FROM   ra_customer_trx_all rct
                                         WHERE  rct.trx_number =
                                                Nvl(:P_TRX_NUM, '263')
                                        ))
==============================================================================================================================================================================

SELECT *
FROM   hz_cust_site_uses_all HCSU
WHERE  hcsu.cust_acct_site_id IN (SELECT hcasa.cust_acct_site_id
                                  FROM   hz_cust_acct_sites_all hcasa
                                  WHERE  hcasa.cust_account_id IN
                                         (SELECT hca.cust_account_id
                                          FROM   hz_cust_accounts hca
                                          WHERE  hca.cust_account_id IN
                                                 (SELECT rct.bill_to_customer_id
                                                  FROM   ra_customer_trx_all rct
                                                  WHERE  rct.trx_number =
                                                         Nvl(:P_TRX_NUM, '263')
                                                 )))
==============================================================================================================================================================================

SELECT *
FROM   hz_customer_profiles_f hcp
WHERE  hcp.cust_account_id IN (SELECT hca.cust_account_id
                               FROM   hz_cust_accounts hca
                               WHERE  hca.cust_account_id IN
                                      (SELECT rct.bill_to_customer_id
                                       FROM   ra_customer_trx_all rct
                                       WHERE  rct.trx_number =
                                              Nvl(:P_TRX_NUM, '263')))
============================================================================================================================================================================== 

EBS : Package Development Process

====================== Package Specification ================================== CREATE OR REPLACE PACKAGE xx_emp_package IS     PROCEDURE lo...