Sunday, August 28, 2016

Query to find out Responsibilities assigned to a user

* Formatted on 2016/08/26 16:14 (Formatter Plus v4.8.8) */
SELECT fu.user_name "User Name",
       frt.responsibility_name "Responsibility Name",
       furg.start_date "Start Date", furg.end_date "End Date",
       fr.responsibility_key "Responsibility Key",
       fa.application_short_name "Application Short Name"
  FROM fnd_user_resp_groups_direct furg,
       applsys.fnd_user fu,
       applsys.fnd_responsibility_tl frt,
       applsys.fnd_responsibility fr,
       applsys.fnd_application_tl fat,
       applsys.fnd_application fa
WHERE furg.user_id = fu.user_id
   AND furg.responsibility_id = frt.responsibility_id
   AND fr.responsibility_id = frt.responsibility_id
   AND fa.application_id = fat.application_id
   AND fr.application_id = fat.application_id
   AND UPPER (fu.user_name) =
             ('MUNGI500')  ---- Provide user id

R12 SQL Query to differentiate Customer and Suppliers Data


select * from (
select hp.party_number,hp.party_name,hp.status,decode(nvl(hpu.party_usage_code,hp.party_type),'ORGANIZATION','CUSTOMER',nvl(hpu.party_usage_code,hp.party_type)) party_type 
from  apps.HZ_PARTY_USG_ASSIGNMENTS hpu, hz_parties hp
where hp.party_id = hpu.party_id(+))
order by party_type;

Link between Supplier and Customer in R12

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.

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.

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.

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.

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.

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 ! ].

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.

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.

Wednesday, August 24, 2016

SQL Query to findout Executable, Concurrent Program and its Parameters information

SELECT DISTINCT fcpl.user_concurrent_program_name "Concurrent Program Name",
  fcp.concurrent_program_name "Short Name"                                 ,
  fat.application_name                                                     ,
  fl.meaning execution_method                                              ,
  fe.execution_file_name                                                   ,
  fcp.output_file_type                                                     ,
  fdfcuv.column_seq_num "Column Seq Number"                                ,
  fdfcuv.end_user_column_name "Parameter Name"                             ,
  fdfcuv.form_left_prompt "Prompt"                                         ,
  fdfcuv.enabled_flag " Enabled Flag"                                      ,
  fdfcuv.required_flag "Required Flag"                                     ,
  fdfcuv.display_flag "Display Flag"                                       ,
  fdfcuv.flex_value_set_id "Value Set Id"                                  ,
  ffvs.flex_value_set_name "Value Set Name"                                ,
  flv.meaning "Default Type"                                               ,
  fdfcuv.default_value "Default Value"
   FROM fnd_concurrent_programs fcp ,
  fnd_concurrent_programs_tl fcpl   ,
  fnd_descr_flex_col_usage_vl fdfcuv,
  fnd_flex_value_sets ffvs          ,
  fnd_lookup_values flv             ,
  fnd_lookups fl                    ,
  fnd_executables fe                ,
  fnd_executables_tl fet            ,
  fnd_application_tl fat
  WHERE 1                     = 1AND fcp.concurrent_program_id = fcpl.concurrent_program_id
AND fcp.enabled_flag          = 'Y'AND fcpl.user_concurrent_program_name LIKE 'Workflow Background Process' --<Your Concurrent Program Name>AND fdfcuv.descriptive_flexfield_name = '$SRS$.'
  || fcp.concurrent_program_name
AND ffvs.flex_value_set_id = fdfcuv.flex_value_set_id
AND flv.lookup_type(+)     = 'FLEX_DEFAULT_TYPE'AND flv.lookup_code(+)     = fdfcuv.default_type
AND fcpl.LANGUAGE          = 'US'AND flv.LANGUAGE(+)        = 'US'AND fl.lookup_type         ='CP_EXECUTION_METHOD_CODE'AND fl.lookup_code         =fcp.execution_method_code
AND fe.executable_id       = fcp.executable_id
AND fe.executable_id       =fet.executable_id
AND fet.LANGUAGE           = 'US'AND fat.application_id     =fcp.application_id
AND fat.LANGUAGE           = 'US'ORDER BY fdfcuv.column_seq_num;

Types of animations

Animation is a diverse and creative field with a variety of styles that artists and filmmakers use to bring their visions to life. Here are ...