Tuesday, 16 January 2018

CREATING A SUPPLIER IN R12 (Functional and SUPPLIERS IN TCA)

Who is a Supplier?

Let us now understand who is a Supplier with the help of a simple example:
We consider us as a business, who sells dry fruits on a large scale, now all the Vendors who intend to consume dry fruits would be contacting us. So with this perspective we become the Supplier to all the vendors and these vendors are our Customers.
Now to automate this process at the Vendors perspective the Supplier information are to be recorded so for this we have a suppliers window to record information about individuals and companies that provides goods or services from whom a vendor purchases those goods and services in return for payment. The information about the Supplier, Supplier Site, Supplier Contacts & Banks are recorded and these are created as one time setups and are not the daily activities which are later updated when ever required.
Change in the approach for Supplier on R12 when compare to 11i:
Release 11iRelease R12
In 11i Suppliers were defined in AP
In R12 Suppliers have been moved into the TCA Data Model.
a) Creation of a vendor/supplier record in eBusiness suite largely meant insertion of records in PO_VENDORS.a) Supplier becomes as TCA Party.
b) Suppliers Sites as TCA Party Site for each distinct address.
c) Contacts for each supplier/address , it means Single supplier address and contact can be leveraged by multiple sites, for each OU.
Banks/Branches defined in AP
Banks and Branches are defined as Parties in TCA
Suppliers in R12:
When compare to the earlier release, in R12 Suppliers and Banks are also part of TCA. Suppliers Sites are as TCA Party Site for each distinct address. A single change to an address can be seen instantly by all OUs, this has an added advantage we no longer need to manually ‘push’ updates across OUs.
This is best illustrated below:
 
Going further Bank Accounts are classified into Internal & External Bank Accounts
The typical data model for bank can be summarized as below:
Note: Adding to the above information, more details on the supplier when related to TCA (Trading Community Architecture) have been mentioned in my blog “R12 TCA (Trading Community Architecture)”, Request you to please do refer my blog for more details.
We now move further on how a supplier can be created in R12.
Supplier Creation
Supplier in R12 can be created in the below ways:
  • Front End (OAF Screen)
  • Using API
  • Using Standard Interface
 Below is the Step by Step approach for creation Supplier, we can observe that all the screens are been designed using Oracle Application Framework (OAF)
  • Navigation
  •  Create New Supplier Record: It is best to search first to ensure that duplicate suppliers are not being created.
  •  Create New Supplier: Enter the supplier organization information as displayed below. Fields with an asterisk (*) are required.
sup_screen4
  •  Create Supplier – Organization Region <additional optional fields>
  • Create Supplier – Address Book Region to add supplier sites
  • Create Supplier – Address Book Region to add supplier sites
  • Create Supplier – Address Book Region to add supplier sites
  • Create Supplier – Add site to Operating Unit
sup_screen10
  • Create Supplier – Contact Directory region – Add supplier contact
  • Create Supplier – Contact Directory region – Add supplier contact
  • Create Supplier – Banking Details region – Add/Create bank accounts. This is a change from R11i.
  • Create Supplier – Banking Details region – To Add/Create bank accounts
  • Create Supplier – Tax and reporting region captures the transaction tax information for the supplier.
  • Create Supplier – Payment Details region identifies default payment methods.
Technical details about the tables that stores the Supplier Information and the list of API’s that can be used in creating the Supplier from backend would be provided in my next post soon. keep watching this Space………


Tables Used


Suppliers in TCA - A dive into Vendor Tables in R12

Prior to R12, creation of a vendor/supplier record in eBusiness suite largely meant insertion of record in PO_VENDORS.
However, from R12 onwards, records are inserted into at least half a dozen tables when a single Supplier record is created.
This is largely due to the fact that Suppliers have been moved into the TCA DataModel.

In this article, I would like to show you the set of tables that are effected when a Supplier record gets created in Release12.
I will also touch base upon Supplier Sites and changes to taxation related tables.

End User Step 1
To begin with, we need to create a Supplier. Lets name it Go4Gold [which also happens to be the name of my old company].
Simply enter name of the Supplier in organization name field and click on Apply. This will create a Supplier.

End User Step 2.
You can doublecheck the created Supplier, which has Supplier Number 20186.
This supplier number comes from a table  named  AP_SUPPLIERS.

The registry id that you see is the Party_number field from hz_parties [TCA Party Table]


Now, lets have a look at the list of tables impacted by creating the above Supplier record.
I am not saying that inserting into below listed tables is the way to create Suppliers in R12 TCA Model.
This is purely for your understanding of the new data model for Suppliers in R12 TCA.
Of course this will be helpful to you when developing reports in R12.

Table HZ_PARTIES
SELECT * FROM hz_parties WHERE party_name= 'Go4Gold' ;
This happens to be the master table now instead of PO_VENDORS.
You will notice that the PARTY_NUMBER below is the Registry id in the R12 supplier screen.
Also, this party_id = 301934 will be referenced in the remainder set of tables.

Table HZ_PARTY_USG_ASSIGNMENTS
SELECT party_id ,party_usg_assignment_id,party_usage_code FROM hz_party_usg_assignments
WHERE party_id = 301934;
This table stores the Party Usages, for example, in this case it captures the fact that the given party_id is of type SUPPLIER.

Table HZ_ORGANIZATION_PROFILES
SELECT * FROM hz_organization_profiles WHERE party_id = 301934
This table captures additional Supplier information, for example, credit scoring details of Supplier or the Number of Employees working in Supplier Organization.

Table IBY_EXTERNAL_PAYEES_ALL
SELECT * FROM iby_external_payees_all WHERE payee_party_id = 301934
This table captures Payment related details of the Supplier.
For example :-
    1. How should the supplier's remittance advice must be sent?
    2. What is the default Payment method Code for this supplier?
    3. Who bears the bank charges when lets say SWIFT payment is made?
This information can be setup at either the Supplier level or at Supplier Site level.

Table AP_SUPPLIERS
SELECT vendor_id, vendor_name,segment1,enabled_flag FROM ap_suppliers WHERE party_id = 301934
Alongside HZ_PARTIES, this is another master table that replaces the PO_VENDORS table of 11i.
Instead of expanding the design of HZ_PARTIES, oracle decided to hold the supplier specific attributes in AP_SUPPLIERS [fair enough ! ].

Table POS_SUPPLIER_MAPPINGS
SELECT * FROM pos_supplier_mappings WHERE party_id = 301934
This table holds the mapping between the AP_SUPPLIERS.VENDOR_ID and HZ_PARTIES.PARTY_ID.
This is useful in cases whereby two vendors  effectively belong  the same HZ_Party Record.


Table ZX_PARTY_TAX_PROFILE
SELECT party_type_code, party_tax_profile_id FROM zx_party_tax_profile WHERE party_id = 301934
The taxation related details like Tax Codes, and Tax Accounts etc have been moved from AP into ZX.
ZX is the name of a new Application "E-Business Tax".
Efectively this application is the Tax repository/Taxation Engine for eBusiness Suite starting from R12.
Effectively this also means that our good old AP_TAX_CODES_ALL is no longer the master table for Taxes.
Now we have a new tax rate table, i.e. ZX_RATES_B.
ZX_ACCOUNTS is another table that has been introduced to capture accounting setup related to Tax Codes.

Database View PO_VENDORS
select vendor_name, segment1, party_number from po_vendors WHERE party_id = 301934
PO_VENDORS is a view in R12, that joins AP_SUPPLIERS & HZ_PARTIES.
Similarly, PO_VENDOR_SITES and PO_VENDOR_SITES_ALL are also views based upon AP_SUPPLIER_SITES_ALL.

Friday, 12 January 2018

Oracle Fusion :- BIP Bursting In Oracle Fusion Cloud



Business Requirement

Many a times there is a need to send details to a specific distribution list or an individual based on a specific event/transaction which has taken place in the ERP Application.
Some of such use case scenario being:
  1. Sending Payslip to Employee via Email
  2. Sending Employee Joining Info to Manager via Email
  3. Sending Invoice Details to Payment Team
  4. Sending Birthday/Work Anniversary Greetings Email to Employee
All of the above were easily achieved in an On-Premise environment (EBS particularly) either by creating a Custom Alert (Periodic/Event depending on the specific business requirement) or a custom pl/sql program which would send details over email or even by using BI Publisher Bursting Feature.
However, in a Cloud Environment we do not have the flexibility of using custom code and although the Alert Manager feature is available (starting Release 12) one need to check whether there are events already present against which one could raise the alert action.
So does this means one would not be able to perform such actions in a Cloud Setup?
No, absolutely not. While we don’t have the flexibility of writing a custom pl/sql nor can we can define new alerts as per our requirement but we still can use BI Publisher Bursting Feature and achieve desired results.
In this article, we would try to demonstrate the same.
For this example, we would try to send a “Termination Initiation Notice” to Manager whenever a subordinate submits resignation.
The manager would be send the information about the Employee Name along with his/her Person# and actual termination date in an Email. The Email should also have a static internal portal link (which will contain knowledge documents describing how to perform exit formalities). Additionally, there should also be a PDF attachment in the Email.
So, let-us begin then.

Worked Example

We would have to create a SQL Query which would form our data source for this BIP Report.
The Report should fetch details like:
  1. Employee Person Number
  2. Employee Email
  3. Employee Title
  4. Employee Display Name
  5. Employee Actual Termination Date
  6. Manager’s Email
  7. Manager Display Name

Data Model Query
SELECT papf.person_number EmployeeNumber,
      INITCAP(ppnf.title)         EmployeeTitle,
      ppnf.display_name  EmployeeName,
      pea.email_address EmployeeEmail,
      to_char(pps.actual_termination_date,'MM-DD-YYYY') TerminationDate,
      (select papf1.person_number
       from   per_all_people_f papf1
       where  papf1.person_id = pasf.manager_id
       and    trunc(sysdate) between papf1.effective_start_date and papf1.effective_end_date) AssignmentManagerPersonNumber,
      (select ppnf1.display_name
       from   per_person_names_f ppnf1
       where  ppnf1.person_id = pasf.manager_id
       and    ppnf1.name_type = 'GLOBAL'
       and    trunc(sysdate) between ppnf1.effective_start_date and ppnf1.effective_end_date) ManagerName,
     (select pea1.email_address
       from   per_email_addresses pea1
       where  pea1.person_id = pasf.manager_id
       and    pea1.email_type = 'W1') ManagerEmail,
      to_char(trunc(pps.last_update_date),'MM-DD-YYYY') ppslud,
      to_char(trunc(sysdate-1),'MM-DD-YYYY') yesterdaydate,
      to_char(trunc(sysdate),'MM-DD-YYYY') currentdate,
      papf.person_id papfpersonid,
      pasf.person_id pasfpersonid,
      pasf.manager_id pasfmgrid
FROM   per_all_people_f papf,
      per_all_assignments_m paam,
      per_assignment_supervisors_f pasf,
      per_person_names_f ppnf,
      per_email_addresses pea,
      per_periods_of_service pps
where  papf.person_id = paam.person_id
and    paam.assignment_type IN ('E','C')
and    pps.person_id = papf.person_id
and    pps.actual_termination_date is not null
and    pea.email_type = 'W1'
and    pea.person_id = papf.person_id
and    ppnf.person_id = papf.person_id
and    ppnf.name_type = 'GLOBAL'
and    pasf.person_id = paam.person_id
and    paam.primary_flag = 'Y'
and    trunc(sysdate) between papf.effective_start_date and papf.effective_end_date
and    trunc(sysdate) between paam.effective_start_date and paam.effective_end_date
and    trunc(sysdate) between ppnf.effective_start_date and ppnf.effective_end_date
and    trunc(sysdate) between pasf.effective_start_date and pasf.effective_end_date
and    pasf.manager_type = 'LINE_MANAGER'
and    trunc(pps.last_update_date) between trunc(sysdate - 1) and trunc(sysdate)
order by pps.last_update_date desc

 We would also need to create a BI Bursting Query
BI Bursting Query
SELECT EmployeeNumber KEY,
      'BITemplate' TEMPLATE,
      'en-us' LOCALE,
      'PDF' OUTPUT_FORMAT,
      'EMAIL' DEL_CHANNEL,
      'abc@mymail.com' parameter1,
      'def@mymail.net' parameter2,
      'orafusion@bursting.com' parameter3,
      'Termination Initiation' parameter4,
      'This is to inform you that one of your subordinate have decided to leave the organization for personal reasons.
       Please initiate exit formalities.
       Refer https://www.mycompany.com/exitformalities for details.
       Regards
       HR Team ' parameter5,
      'true' parameter6,
      'replyto@nowhere.com' parameter7
FROM   
(SELECT papf.person_number EmployeeNumber,
      INITCAP(ppnf.title)         EmployeeTitle,
      ppnf.display_name  EmployeeName,
      pea.email_address EmployeeEmail,
      to_char(pps.actual_termination_date,'MM-DD-YYYY') TerminationDate,
      (select papf1.person_number
       from   per_all_people_f papf1
       where  papf1.person_id = pasf.manager_id
       and    trunc(sysdate) between papf1.effective_start_date and papf1.effective_end_date) AssignmentManagerPersonNumber,
      (select ppnf1.display_name
       from   per_person_names_f ppnf1
       where  ppnf1.person_id = pasf.manager_id
       and    ppnf1.name_type = 'GLOBAL'
       and    trunc(sysdate) between ppnf1.effective_start_date and ppnf1.effective_end_date) ManagerName,
     (select pea1.email_address
       from   per_email_addresses pea1
       where  pea1.person_id = pasf.manager_id
       and    pea1.email_type = 'W1') ManagerEmail,
      to_char(trunc(pps.last_update_date),'MM-DD-YYYY') ppslud,
      to_char(trunc(sysdate-1),'MM-DD-YYYY') yesterdaydate,
      to_char(trunc(sysdate),'MM-DD-YYYY') currentdate,
      papf.person_id papfpersonid,
      pasf.person_id pasfpersonid,
      pasf.manager_id pasfmgrid
FROM   per_all_people_f papf,
      per_all_assignments_m paam,
      per_assignment_supervisors_f pasf,
      per_person_names_f ppnf,
      per_email_addresses pea,
      per_periods_of_service pps
where  papf.person_id = paam.person_id
and    paam.assignment_type IN ('E','C')
and    pps.person_id = papf.person_id
and    pps.actual_termination_date is not null
and    pea.email_type = 'W1'
and    pea.person_id = papf.person_id
and    ppnf.person_id = papf.person_id
and    ppnf.name_type = 'GLOBAL'
and    pasf.person_id = paam.person_id
and    paam.primary_flag = 'Y'
and    trunc(sysdate) between papf.effective_start_date and papf.effective_end_date
and    trunc(sysdate) between paam.effective_start_date and paam.effective_end_date
and    trunc(sysdate) between ppnf.effective_start_date and ppnf.effective_end_date
and    trunc(sysdate) between pasf.effective_start_date and pasf.effective_end_date
and    pasf.manager_type = 'LINE_MANAGER'
and    trunc(pps.last_update_date) between trunc(sysdate - 1) and trunc(sysdate)
order by pps.last_update_date desc
)
Also, we have created a ‘Schedule Trigger’ to ensure that the Scheduled Report should only send email whenever there is data returned from the mail Data Model SQL. In this case the Schedule Trigger would only return a TRUE value whenever a termination happens between Current System Date and one day prior to it.
Schedule Trigger Query
SELECT 1
FROM   per_all_people_f papf,
      per_all_assignments_m paam,
      per_assignment_supervisors_f pasf,
      per_person_names_f ppnf,
      per_email_addresses pea,
      per_periods_of_service pps
where  papf.person_id = paam.person_id
and    paam.assignment_type IN ('E','C')
and    pps.person_id = papf.person_id
and    pps.actual_termination_date is not null
and    pea.email_type = 'W1'
and    pea.person_id = papf.person_id
and    ppnf.person_id = papf.person_id
and    ppnf.name_type = 'GLOBAL'
and    pasf.person_id = paam.person_id
and    paam.primary_flag = 'Y'
and    trunc(sysdate) between papf.effective_start_date and papf.effective_end_date
and    trunc(sysdate) between paam.effective_start_date and paam.effective_end_date
and    trunc(sysdate) between ppnf.effective_start_date and ppnf.effective_end_date
and    trunc(sysdate) between pasf.effective_start_date and pasf.effective_end_date
and    pasf.manager_type = 'LINE_MANAGER'
and    trunc(pps.last_update_date) between trunc(sysdate - 1) and trunc(sysdate)
order by pps.last_update_date desc

RTF Template

Running the Report
When we run the report and check the same using the ‘Schedule Option’ we can see the following:

Verifying the Results
A quick check on the received email confirms that the expected content is delivered
And the attachment looks as per the BI Template

CREATING A SUPPLIER IN R12 (Functional and SUPPLIERS IN TCA)

Who is a Supplier? Let us now understand who is a Supplier with the help of a simple example: We consider us as a business, who sell...