Wednesday, June 16, 2021

Query to get Legal Entity, Operating Unit, Inventory Org details in Oracle Apps

 SELECT xep.name legal_entity_name

      ,gl.name  ledger_name

  ,hou.name operating_unit

  ,hou.short_code

  ,hou.organization_id org_id

  ,hou.set_of_books_id

  ,hou.business_group_id

  ,ood.organization_name inventory_organization_name

  ,ood.organization_code inv_organization_code

  ,ood.organization_id   inv_organization_id

  ,ood.chart_of_accounts_id

FROM hr_operating_units hou

    ,org_organization_definitions ood

,gl_ledgers gl

,xle_entity_profiles xep

WHERE hou.organization_id(+) = ood.operating_unit

  AND ood.set_of_books_id = gl.ledger_id

  AND ood.legal_entity = xep.legal_entity_id

ORDER BY hou.organization_id;

Query to get Patch Details in Oracle Apps

 SELECT DISTINCT RPAD(a.bug_number,

11)|| RPAD(e.patch_name,

11)|| RPAD(TRUNC(c.end_date),

12)|| RPAD(b.applied_flag, 4)  bug_applied

FROM apps.ad_bugs a,

     apps.ad_patch_run_bugs b,

     apps.ad_patch_runs c,

     apps.ad_patch_drivers d ,

     apps.ad_applied_patches e

WHERE a.bug_id = b.bug_id 

  AND b.patch_run_id = c.patch_run_id 

  AND c.patch_driver_id = d.patch_driver_id 

  AND d.applied_patch_id = e.applied_patch_id

  AND c.end_date > '01-JAN-21';

ORDER BY 1 DESC;

Query to get Customer Related Information in Oracle Apps R12

 SELECT party.party_id

      ,cust_acct.cust_account_id

  ,party_site.party_site_id

  ,party_site.location_id

  ,cust_acct_site.cust_acct_site_id

  ,cust_site_use.site_use_id

  ,cust_site_use.site_use_code

  ,party.party_name

  ,location.address1

  ,location.address2

  ,location.city

  ,location.state

  ,location.postal_code

  FROM hz_parties party

      ,hz_cust_accounts cust_acct

  ,hz_party_sites party_site

  ,hz_cust_acct_sites_all cust_acct_site

  ,hz_cust_site_uses_all cust_site_use

  ,hz_locations location

 WHERE party.party_id = cust_acct.party_id

   AND party_site.party_id = party.party_id

   AND party_site.party_site_id = cust_acct_site.party_site_id

   AND cust_acct_site.cust_account_id = cust_acct.cust_account_id

   AND cust_site_use.cust_acct_site_id = cust_acct_site.cust_acct_site_id

   AND cust_site_use.site_use_code = 'BILL_TO'

   AND party_site.location_id = location.location_id

   AND cust_acct.account_number = '123456789'

Query to get Supplier Contacts in Oracle Apps R12

 SELECT DISTINCT

asu.party_id

,asu.segment1 vendor_number

,asu.vendor_name 

,hpc.party_name contact_name 

,hpr.primary_phone_country_code 

,hpr.primary_phone_area_code 

,hpr.primary_phone_number 

,assa.vendor_site_code 

,assa.vendor_site_id 

,asco.vendor_contact_id 

,assa.party_site_id

    ,asco.org_party_site_id

FROM apps.hz_relationships hr 

    ,apps.ap_suppliers asu 

,apps.ap_supplier_sites_all assa 

,apps.ap_supplier_contacts asco 

,apps.hz_org_contacts hoc 

,apps.hz_parties hpc 

,apps.hz_parties hpr 

,apps.hz_contact_points hpcp

WHERE hoc.party_relationship_id = hr.relationship_id

  AND hr.subject_id         = asu.party_id

  AND hr.relationship_code  = 'CONTACT'

  AND hr.object_table_name  = 'HZ_PARTIES'

  AND asu.vendor_id         = assa.vendor_id

  AND hr.object_id          = hpc.party_id

  AND hr.party_id           = hpr.party_id

  AND asco.relationship_id  = hoc.party_relationship_id

  AND assa.party_site_id    = asco.org_party_site_id

  AND hpr.party_type        ='PARTY_RELATIONSHIP'

  AND hpr.party_id          = hpcp.owner_table_id

  AND hpcp.owner_table_name = 'HZ_PARTIES'

  AND assa.vendor_site_id   = asco.vendor_site_id

  AND asu.vendor_name       = 'XX_VENDOR_NAME'

Commonly asked D2K Interview Questions

  • Which triggers are created when Master-Detail Relationship?
    • Master Delete Property
      • NON-ISOLATED (by default)
        1. On Check Delete Master
        2. On Clear Details
        3. On Populate Details
      •  ISOLATED
        1. On Clear Details
        2. On Populate Details
      • CASCADE
        1. Pre-Delete
        2. On Clear Details
        3. On Populate Details
  • What are the System variables can be set by users?
    • SYSTEM.MESSAGE_LEVEL
    • SYSTEM.DATE_THRESHOLD
    • SYSTEM.EFFECTIVE_DATE
    • SYSTEM.SUPPRESS_WORKING 
  • What is Object Group?
    • An Object Group is a container for a group of objects. 
    • You define an object group when you want package related objects so that you can copy or reference them in another module. 
  • What are referenced objects?
    • Referencing allows you to create objects that inherit their functionality and appearance from other objects. 
    • Referencing an object is similar to copying an object, except that the resulting reference object maintains a link to its source object. 
    • A reference object automatically inherits any changes that have been made to the source object when you open or regenerate the module that contains the reference object. 
  • Can you issue DDL Statement in forms?
    • We can issue DDL statement in Forms by using FORMS_DDL.
    • Any string expression up to 32K. A literal an expression or a variable representing the text of a block of dynamically created PL/SQL code DML statement or a DDL statement.
    • Restrictions:-
      • The statement you pass to FORMS_DDL may not contain bind variable references in the string, but the values of bind variables can be concatenated into the string before passing the result to FORMS_DDL.  
  • What is secure property?
    • Hides characters that the operator types into the text item.  
    • This setting is typically used for  password protection. 
  • What are the types of triggers and how the sequence of firing in text item?
    • Triggers can be classified as Key Triggers, Mouse Triggers ,Navigational Triggers. 
    • Key Triggers:
      • Key Triggers are fired as a result of Key actions.
      • Ex:   
        • Key-next-field
        • Key-up
        • Key-Down, etc
    • Mouse Triggers:
      • Mouse Triggers are fired as a result of the mouse navigation.
      • Ex:
        • When-mouse-button-pressed
        • when-mouse-double-clicked, etc
    • Navigational Triggers:
      • These Triggers are fired as a result of Navigation. 
      • Ex:
        • Post-Text-item
        • Pre-text-item.
    • We also have event triggers like when –new-form-instance and when-new-block-instance.
    • We cannot call restricted procedures like go_to(‘my_block.first_item’) in the Navigational triggers but can use them in the Key-next-item.
    • The Difference between Key-next and Post-Text is an very important question. 
    • The key-next is fired as a result of the key action while the post text  is fired as a result of the mouse movement. 
    • Key next will not fire unless there is a key event.
    • The sequence of firing in a text item are as follows:
      • pre-text
      • when new item 
      • key-next
      • when validate 
      • post text
  • What are Property Classes?
    • Property class inheritance is a powerful feature that allows you to quickly define objects that conform to your own interface and functionality standards. 
    • Property classes also allow you to make global changes to applications quickly.  
    • By simply changing the definition of a property class, you can change the definition of all objects that inherit properties from that class.
    • Property Classes have all type of triggers.
  • If you have property class attached to an Item and you have same trigger written for the item. Which will fire first?
    • If item level trigger fires, property level trigger won't fire. 
    • Triggers at the lowest level are always given the first preference. 
    • The item level trigger fires first and then the block and then the Form level trigger.
  • What are Record Groups? Can record groups create at run-time?
    • A record group is an internal Oracle Forms data structure that has a column/row framework similar to a database table.  
    • However, unlike database tables, record groups are separate objects that belong to the form module in which they are defined.  
    • A record group can have an unlimited number of columns of type CHAR, LONG, NUMBER, or DATE provided that the total number of columns does not exceed 64K.  
    • Record group column names cannot exceed 30 characters. 
    • Programmatically Record Groups can be used whenever the functionality offered by a two-dimensional array of multiple data types is desirable. 
  • Types of Record groups?
    • Query Record Group: 
      • A query record group is a record group that has an associated SELECT statement.
      • The columns in a query record group derive their default names, data types, and lengths from the database  columns referenced in the SELECT statement.  
      • The records in a query record group are the rows retrieved by the query associated with that record group. 
    • Non-query Record Group:
      • A non-query record group is a group that does not have an associated query, but whose structure and values can be modified programmatically at runtime.
    • Static Record Group:
      • A static record group is not associated with a query; rather, you define its structure and row values at design time, and they remain fixed at runtime.
  • What are ALERT? 
    • An Alert is a modal window that displays a message notifying operator of some application condition.
  • What is mouse navigate property of button?
    • When Mouse Navigate is True (the default), Oracle Forms performs standard navigation to move the focus to the item when the operator activates the item with the mouse.  
    • When Mouse Navigate is set to False, Oracle Forms does not perform navigation (and the resulting validation) to move to the item when an operator activates the item with the mouse. 
  • What is FORMS_MDI_WINDOW?
    • Forms run inside the MDI application window. This property is useful for calling a form from another one.
  • When When-Timer-Expired does not fire?
    •  The When-Timer-Expired trigger can not fire during trigger, navigation, or transaction processing.
  • Can object group have a block?
    • Yes , object group can have block as well as program units.
  

Tuesday, June 15, 2021

Query to view all Form Personalizations in Oracle Apps

 SELECT fp.application_id

       ,fp.application_short_name

   ,fpt.application_name

   ,ff.form_name

   ,fft.user_form_name

   ,fft.description

   ,fff.function_name

   ,ffft.user_function_name

   ,ffft.description

   ,ffcr.function_name

   ,ffcr.description

   ,ffcr.trigger_event

   ,ffcr.trigger_object

   ,ffcr.condition

   ,ffcr.sequence

   ,ffcr.enabled

   ,frt.responsibility_name

   ,frt.description

   ,fu.user_id

   ,fu.user_name

   FROM fnd_application fp

       ,fnd_application_tl fpt

       ,fnd_form ff

       ,fnd_form_tl fft

       ,fnd_form_functions fff

       ,fnd_form_functions_tl ffft

       ,fnd_form_custom_rules ffcr

       ,fnd_form_custom_scopes ffcs

       ,fnd_responsibility_tl frt

       ,fnd_user fu

       ,fnd_form_custom_actions ffca

       ,fnd_form_custom_prop_list ffcpl

 WHERE fp.application_id = fpt.application_id

   AND fpt.application_id = ff.application_id

   AND ff.form_id = fft.form_id

   AND ff.form_id = fff.form_id 

   AND fff.function_id = ffft.function_id

   AND ff.form_name = ffcr.form_name

   AND ffcr.function_name = fff.function_name

   AND ffcr.id = ffcs.rule_id

   AND ffcs.created_by = fu.user_id

   and ffcr.last_updated_by = fu.user_id

   and ff.last_updated_by = fu.user_id

Query to get the Request Groups & Request Sets in Oracle Apps

 SELECT *

  FROM (SELECT frg.request_group_name

, (CASE

WHEN (NVL (frg.created_by, 0) > 99) THEN 'Y'

ELSE 'N'

END) custom_request_group

, (SELECT user_name

  FROM fnd_user

WHERE user_id = frg.created_by) req_group_owner

, fcpt.user_concurrent_program_name

, fcpt.concurrent_program_name

, (SELECT application_name

  FROM fnd_application_vl

WHERE application_id = fcpt.application_id) program_appl_name

, (SELECT application_short_name

  FROM fnd_application_vl

WHERE application_id = fcpt.application_id) program_appl_short_name

, (SELECT user_name

  FROM fnd_user

WHERE user_id = fcpt.created_by) program_created_by

, (CASE

WHEN (NVL (fcpt.created_by, 0) > 99) THEN 'Y'

ELSE 'N'

END)

custom_program_unit

FROM fnd_request_groups frg

,fnd_request_group_units frgu

,fnd_concurrent_programs_vl fcpt

WHERE frgu.request_group_id = frg.request_group_id

  AND fcpt.concurrent_program_id = frgu.request_unit_id

  AND NVL (fcpt.enabled_flag, 'Y') = 'Y')

 WHERE custom_program_unit = 'Y'

UNION

SELECT *

  FROM (SELECT frg.request_group_name

, (CASE

WHEN (NVL (frg.created_by, 0) > 99) THEN 'Y'

ELSE 'N'

END) custom_request_group

, (SELECT user_name

  FROM fnd_user

WHERE user_id = frg.created_by) req_group_owner

, fcpt.user_request_set_name

, fcpt.request_set_name

, (SELECT application_name

  FROM fnd_application_vl

WHERE application_id = fcpt.application_id) req_set_appl_name

, (SELECT application_short_name

  FROM fnd_application_vl

WHERE application_id = fcpt.application_id) req_set_appl_short_name

, (SELECT user_name

  FROM fnd_user

WHERE user_id = fcpt.created_by)

req_set_created_by

, (CASE

WHEN (NVL (fcpt.created_by, 0) > 99) THEN 'Y'

ELSE 'N'

END)

custom_request_set

FROM fnd_request_groups frg

,fnd_request_group_units frgu

,fnd_request_sets_vl fcpt

WHERE frgu.request_group_id = frg.request_group_id

  AND fcpt.request_set_id = frgu.request_unit_id

  AND NVL (fcpt.end_date_active, SYSDATE) >= SYSDATE)

 WHERE custom_request_set = 'Y'

ORDER BY 1

,2

,3

,4;


Sample code to create Project Deliverable Action in Oracle Apps

 DECLARE

   l_action           pa_project_pub.action_out_tbl_type;

   l_return_status    VARCHAR2 (100);

   l_return_status1   VARCHAR2 (100);

   l_msg_count        NUMBER;

   l_msg_data         VARCHAR2 (2000);

   l_msg_data1        VARCHAR2 (2000);

   l_msg_index_out    NUMBER;

BEGIN

   pa_interface_utils_pub.set_global_info

      (p_api_version_number      => 1.0

      ,p_responsibility_id       => 12345 --Replace p_responsibility_id with valid projects responsilbility

      ,p_user_id                 => 12345 --Replace p_user_id with valid user_id having the above responsilbility

      ,p_msg_count               => l_msg_count

      ,p_msg_data                => l_msg_data

      ,p_return_status           => l_return_status

      );

   

dbms_output.put_line ('l_return_status' || l_return_status);

   

pa_project_pub.create_deliverable_action

      (p_api_version              => '1.0'

      ,p_init_msg_list            => 'F'

      ,p_debug_mode               => 'N'

      ,p_commit                   => 'F'

      ,p_action_name              => 'Invoice/Revenue Action'

      ,p_action_owner_id          => 12345 --Replace p_action_owner_id

      ,p_function_code            => 'BILLING'

      ,p_event_type               => 'Product'

      ,p_event_number             => 1

      ,p_description              => '-- Pass Description Here --'

      ,p_pm_source_code           => 'ABC'

      ,p_pm_action_reference      => '12345' --Replace Element Number from PA_PROJ_ELEMENT

      ,p_currency                 => 'USD'

      ,p_deliverable_id           => 12345 --Replace 

      ,p_organization_id          => 12345 --Replace 

      ,p_project_id               => 12345 --Replace 

      ,p_invoice_amount           => 55555 --Replace 

      ,p_revenue_amount           => 55555 --Replace 

      ,x_action_out               => l_action 

      ,x_return_status            => l_return_status1

      ,p_pm_event_reference       => 'ABC-XYZ-123' --Replace

      ,x_msg_count                => l_msg_count

      ,x_msg_data                 => l_msg_data1

      );

      

   dbms_output.put_line (   'Status :'

                         || l_return_status1

                         || '    Message   : '

                         || l_msg_data1);

                         

IF l_msg_count >= 1 THEN

FOR i IN 1..l_msg_count 

LOOP

pa_interface_utils_pub.get_messages(

p_msg_data => l_msg_data

   ,p_encoded  => 'F'

   ,p_data => l_msg_data

   ,p_msg_count => l_msg_count

   ,p_msg_index => l_msg_count

   ,p_msg_index_out => l_msg_index_out

   );

dbms_output.put_line('Error Message :' || l_msg_data|| ' Status '     || l_return_status1);

END LOOP;           

ROLLBACK;

END IF;           

EXCEPTION

   WHEN OTHERS THEN

      dbms_output.put_line ('Error occured in Main Exception. Error Message: ' || SQLERRM);

END;


  

Query to get E-Biz Tax Details in Oracle Apps

 SELECT xep.name entity_name

      ,ledger.name                  ledger

  ,hou.name                     operating_unit

  ,zxr.tax_regime_code          tax_regime_code

  ,zxr.tax                      tax_code

  ,zxr.inclusive_tax_flag       inclusive_tax_flag

  ,zxr.tax_status_code          tax_status_code

  ,zxr.tax_rate_code            tax_rate_code

  ,zxr.tax_jurisdiction_code    tax_jurisdiction_code

  ,zxr.rate_type_code           rate_type_code

  ,zxr.percentage_rate          percentage_rate

  ,zxr.effective_from           rate_effective_from

  ,zxr.effective_to             rate_effective_to   

  ,account.tax_account_ccid     tax_account_ccid

  ,gcc.concatenated_segments    tax_account

  FROM zx_rates_vl    zxr

      ,zx_accounts         account

  ,hr_operating_units  hou

  ,gl_ledgers          ledger

  ,gl_code_combinations_kfv  gcc

  ,xle_entity_profiles xep

 WHERE account.tax_account_entity_code = 'RATES'

   AND zxr.active_flag = 'Y'

   AND TRUNC (SYSDATE) BETWEEN TRUNC (zxr.effective_from) AND NVL (TRUNC (zxr.effective_to), TRUNC (SYSDATE) + 1)

   AND ledger.ledger_id = hou.set_of_books_id

   AND gcc.code_combination_id = account.tax_account_ccid

   AND hou.organization_id = account.internal_organization_id

   AND account.tax_account_entity_id = zxr.tax_rate_id

   and hou.default_legal_context_id = xep.legal_entity_id

   --AND zxr.tax_regime_code = 'TAX_REGIME_CODE'

   --AND zxr.tax_rate_code = 'TAX_RATE_CODE'

Profile Options Specific to Operating Units in Oracle Apps

  • Profile Options, AR: Receipt Batch Source and AR: Transaction Batch Source, reference data that is secured by operating unit. You must set these profile options at the responsibility level. You should choose a value corresponding to the operating unit of the responsibility.


  •  The following profile options need to be set for each responsibility for each operating unit where applicable:
    • HR: Business Group
    • HR: User Type
      • The HR: User Type profile option limits field access on windows shared between Oracle Human Resources and other applications. If you do not use Oracle Payroll, it must be to HR User for all responsibilities that use tables from Oracle Human Resources. For example, responsibilities used to define employees and organizations.

    • GL: Set of Books Name
      • Oracle General Ledger forms use the GL: Set of Books profile option to determine your current set of books. 
      • If you have different sets of books for your operating units, you should set the GL: Set of Books profile option for each responsibility that uses Oracle General Ledger forms.
    • OM: Item Validation Organization
    • INV: Inter company Currency Conversion
    • Tax: Allow Override of Tax Code
    • Tax: Invoice Freight as Revenue
    • Tax: Inventory Item for Freight
    • Sequential Numbering

The Advantages of Moving to Multi-Org in Oracle Apps

  • Product Integration
  • Global Enterprise Management and Visibility
  • Cross-Organization Features
  • Multiple Sets of Accounting Books 
  • Application Administration 
  • Reduction in support and maintenance costs 
  • Data Security 
  • Inventory Organization Security by Responsibility 
  • Reporting  

Few R12 Inventory Interview Questions in Oracle Apps

  1. What is Master Item? 
  2. What is Onhand quantity and Available quantity?
  3. What is Move Orders? 
  4. What are the Inventory Organizations, Name few Sub-Inventories?
  5. What is KFF? Name few KFF's.
  6. Tell some of the base tables in Inventory Module? 
  7. In which column item will be stored?
  8. What is the Primary key in MTL_SYSTEM_ITEMS_B table?
  9. In which table we an find out Master Organizations?
  10. In which table we can find out Sub-inventories?
  11. In which column we can find out Item category name?
  12. What is ABC analysis and ATP date? 
  13. What are the Item Transactions we have?
  14. What are the reports you have developed or Customized in Inventory Module?
  15. What is min-max planning?

Query to get Element Advance Salary in Oracle Apps

 SELECT prrv.result_value

      ,paa.assignment_id

  ,paaf.assignment_id

  ,papf.employee_number

 FROM pay_run_results prr1

     ,pay_element_types_f petf

,pay_run_result_values prrv

,pay_input_values_f piv

,pay_assignment_actions paa

,pay_payroll_actions ppa

,per_all_assignments_f paaf

,per_all_people_f papf

WHERE prr1.element_type_id = petf.element_type_id

  AND prr1.run_result_id = prrv.run_result_id

  AND prrv.input_value_id = piv.input_value_id

  AND prr1.assignment_action_id = paa.assignment_action_id

  AND paaf.assignment_id = paa.assignment_id

  and paaf.person_id = papf.person_id

  AND element_name = 'Advance Salary'

  AND piv.name = 'Pay Value'

  AND ppa.payroll_action_id = paa.payroll_action_id                         

  AND ppa.action_type IN ('Q', 'R')

  AND SYSDATE BETWEEN piv.effective_start_date AND  piv.effective_end_date

  AND SYSDATE BETWEEN petf.effective_start_date AND  petf.effective_end_date

  AND SYSDATE BETWEEN paaf.effective_start_date AND  paaf.effective_end_date

  AND SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date

  and prrv.result_value > '0'

  AND ppa.effective_date='31-DEC-2020'

Saturday, June 12, 2021

Oracle Process Manufacturing General API GMP_CALENDAR_API

  • Public level package used for fetching data from the OPM Shop Calendar. 
  • These APIs are used by OPM Process Execution


Oracle Process Manufacturing Resources API GMP_RSRC_AVL_PKG

  • Public level package used for resource availability calculations.
  • Oracle Process Manufacturing Resources API GMP_RESOURCE_DTL_PUB

    • Public level package used for creating, updating, and deleting plant resources in OPM.

    Oracle Process Manufacturing Resources API GMP_RESOURCES_PUB

    • Public level package used for creating, updating, and deleting generic resources in OPM.

    Oracle Process Manufacturing Status API GMD_STATUS_PUB

    • Public API that modifies the status for routings, recipes, operations, and validity rules

    Oracle Process Manufacturing Activities API GMD_ACTIVITY_PUB

    • Public Activity package that the user defined function calls. 
    • The business API is used for creating, modifying, or deleting activity information.

    Oracle Process Manufacturing Operation Resources GMD_OPERATION_RESOURCES_PUB

    • Public Operation Resources package that the wrapper or user defined function calls. 
    • The business API is used for creating, modifying, or deleting operation resources.

    Oracle Process Manufacturing Operation Activities GMD_OPERATION_ACTIVITIES_PUB

    • Public Operation Activities package that the wrapper or user defined function calls. 
    • The business API is used for creating, modifying, or deleting operation activities. 
    • When creating an operation activity, the API also creates operation resources associated with this operation activity.

    Oracle Process Manufacturing Operations GMD_OPERATIONS_PUB

    • Public Operation package that the user defined function calls. 
    • The business API is used for creating, modifying, or deleting a operation header. 
    • When creating an operation header, the API also creates activities and resources associated with this header.

    Oracle Process Manufacturing Dependency GMD_STEP_DEPENDENCY_PUB

    • Public Routing package that the user defined function calls. 
    • The business API is used for creating or modifying routing step dependency information associated to the routing steps.

    Oracle Process Manufacturing Routing Steps GMD_ROUTING_STEPS_PUB

    • Public Routing package that the user defined function calls. 
    • The business API is used for creating or modifying routing steps associated to the routing header

    Oracle Process Manufacturing Routings GMD_ROUTINGS_PUB

    • Public Routing package that the user defined function calls. The business API is used for creating, modifying, or deleting a routing header.

    Oracle Process Manufacturing Recipe GMD_FETCH_VALIDITY_RULES

    • Public Recipe API that Recipe Header and Recipe Detail APIs call.

    Oracle Process Manufacturing Recipe GMD_RECIPE_FETCH_PUB

    • Public Recipe API that Recipe Header and Recipe Detail APIs call.

    Oracle Process Manufacturing Recipe GMD_RECIPE_DETAIL

    • Public Recipe API that the user defined function calls.

    Oracle Process Manufacturing Recipe GMD_RECIPE_HEADER

    • Public Recipe API that the user defined function calls.

    Oracle Process Manufacturing API GMD_FORMULA_EFFECTIVITY_PUB

    • Public Formula 
    • Effectivity package that the wrapper or user defined function calls. 
    • The business API can be used for Creating, Modifying, or deleting a formula effectivity.

    Oracle Process Manufacturing API GMD_FORMULA_DETAIL_PUB

    • Public Formula 
    • Detail package that the wrapper or user defined function calls.
    • The business API can be used for creating, modifying, or deleting a formula detail.

    Oracle Process Manufacturing API GMD_FORMULA_PUB

    • Public Formula
    • Header package that the user defined function calls. 
    • The business API can be used for creating, modifying, or deleting a formula header. 
    • While creating a Formula header the API also creates Detail and Effectivity associated with this header.

    Thursday, June 10, 2021

    API to Create Element & Retro Components

    • Below are the sequence of steps to create Element and its Retro Components

      1. API to Create Element Type & Parent Element
      2. API to Create Element Type for Retro & Child Element
      3. API to Create Retro Component Usage
      4. API to Create Element Span Usages


    • API to Create Element Type & Parent Element

    DECLARE

       l_classification_id                 NUMBER := NULL;

       l_event_group_id                NUMBER := NULL;

       l_formula_id                        NUMBER := NULL;

       l_element_name                  VARCHAR2 (500) := 'Misc Allowance';

       l_element_type_id               NUMBER := NULL;

       l_effective_start_date          DATE := NULL;

       l_effective_end_date            DATE := NULL;

       l_object_version_number         NUMBER := NULL;

       l_comment_id                        NUMBER := NULL;

       l_processing_priority_warning   BOOLEAN := NULL;

    BEGIN

       SELECT classification_id

         INTO l_classification_id

         FROM pay_element_classifications

        WHERE UPPER (classification_name) = 'EARNINGS'

              AND legislation_code = 'US';


       SELECT event_group_id

         INTO l_event_group_id

         FROM pay_event_groups

        WHERE UPPER (event_group_name) = 'ENTRY CHANGES';


       SELECT formula_id

         INTO l_formula_id

         FROM ff_formulas_f

        WHERE formula_name = 'US_ONCE_EACH_PERIOD';


       pay_element_types_api.

        create_element_type (

          p_validate                       => FALSE,

          p_effective_date                 => TO_DATE ('01-JAN-2020', 'DD-MON-YYYY'),

          p_classification_id              => l_classification_id,

          p_element_name                   => l_element_name,

          p_input_currency_code            => 'USD',

          p_output_currency_code           => 'USD',

          p_multiple_entries_allowed_fla   => 'N',

          p_processing_type                => 'N' ,

        --N -> Non Recurring

         --R -> Recurring                               

          p_business_group_id              => 101,

          p_legislation_code               => NULL,

          p_formula_id                     => l_formula_id,

          p_reporting_name                 => l_element_name,

          p_description                    => l_element_name,

          p_recalc_event_group_id          => l_event_group_id,

          p_element_type_id                => l_element_type_id,

          p_effective_start_date           => l_effective_start_date,

          p_effective_end_date             => l_effective_end_date,

          p_object_version_number          => l_object_version_number,

          p_comment_id                     => l_comment_id,

          p_processing_priority_warning    => l_processing_priority_warning

        );

       COMMIT;

       DBMS_OUTPUT.put_line (l_element_type_id || ' has been created Successfully !!!');

    EXCEPTION

       WHEN OTHERS

       THEN

          DBMS_OUTPUT.put_line ('Main Exception: ' || SQLERRM);

    END;


    • API to Create Element Type for Retro & Child Element


    DECLARE

       l_classification_id             NUMBER := NULL;

       l_event_group_id                NUMBER := NULL;

       l_formula_id                    NUMBER := NULL;

       l_element_name                  VARCHAR2 (500) := 'Misc Allowance Retro';

       l_element_type_id               NUMBER := NULL;

       l_effective_start_date          DATE := NULL;

       l_effective_end_date            DATE := NULL;

       l_object_version_number         NUMBER := NULL;

       l_comment_id                    NUMBER := NULL;

       l_processing_priority_warning   BOOLEAN := NULL;

    BEGIN

       SELECT classification_id

         INTO l_classification_id

         FROM pay_element_classifications

        WHERE UPPER (classification_name) = 'EARNINGS'

              AND legislation_code = 'US';



       SELECT formula_id

         INTO l_formula_id

         FROM ff_formulas_f

        WHERE formula_name = 'US_ONCE_EACH_PERIOD';


       pay_element_types_api.

        create_element_type (

          p_validate                       => FALSE,

          p_effective_date                 => TO_DATE ('01-JAN-2020', 'DD-MON-YYYY'),

          p_classification_id              => l_classification_id,

          p_element_name                   => l_element_name,

          p_input_currency_code            => 'USD',

          p_output_currency_code           => 'USD',

          p_multiple_entries_allowed_fla   => 'N',

          p_processing_type                => 'N' ,

            --N -> Non Recurring 

            --R -> Recurring                                          

          p_business_group_id              => 101,

          p_legislation_code               => NULL,

          p_formula_id                     => l_formula_id,

          p_reporting_name                 => l_element_name,

          p_description                    => l_element_name,

          p_recalc_event_group_id          => l_event_group_id,

          p_element_type_id                => l_element_type_id,

          p_effective_start_date           => l_effective_start_date,

          p_effective_end_date             => l_effective_end_date,

          p_object_version_number          => l_object_version_number,

          p_comment_id                     => l_comment_id,

          p_processing_priority_warning    => l_processing_priority_warning);

       COMMIT;

       DBMS_OUTPUT.put_line (l_element_type_id || ' has been created Successfully !!!');

    EXCEPTION

       WHEN OTHERS

       THEN

          DBMS_OUTPUT.put_line ('Main Exception: ' || SQLERRM);

    END;


    • API to Create Retro Component Usage

    DECLARE

       l_retro_component_id         NUMBER := NULL;

       l_element_type_id            NUMBER := NULL;

       l_reprocess_type             VARCHAR2 (50) := NULL;

       l_retro_component_usage_id   NUMBER := NULL;

       l_object_version_number      NUMBER := NULL;

    BEGIN

       SELECT retro_component_id

         INTO l_retro_component_id

         FROM pay_retro_components

        WHERE UPPER (short_name) = 'STANDARD';


       SELECT element_type_id

         INTO l_element_type_id

         FROM pay_element_types_f

        WHERE UPPER (element_name) = 'MISC ALLOWANCE';


       SELECT hl.lookup_code

         INTO l_reprocess_type

         FROM hr_lookups hl

        WHERE hl.lookup_type = 'RETRO_REPROCESS_TYPE'

              AND UPPER (hl.meaning) = 'REPROCESS';


       PAY_RCU_INS.

        ins (p_effective_date             => TO_DATE ('01-JAN-2020', 'DD-MON-YYYY'),

             p_retro_component_id         => l_retro_component_id,

             p_creator_id                 => l_element_type_id,

             p_creator_type               => 'ET',

             p_default_component          => 'Y',

             p_reprocess_type             => l_reprocess_type,

             p_business_group_id          => 101,

             p_retro_component_usage_id   => l_retro_component_usage_id,

             p_object_version_number      => l_object_version_number,

             p_replace_run_flag           => 'N',

             p_use_override_dates         => 'N'

            );

       COMMIT;

       DBMS_OUTPUT.put_line (

          l_retro_component_usage_id || ' has been created Successfully !!!');

    EXCEPTION

       WHEN OTHERS

       THEN

          DBMS_OUTPUT.put_line ('Main Exception: ' || SQLERRM);

    END;


    • API to Create Element Span Usages


    DECLARE

       l_time_span_id               NUMBER := NULL;

       l_retro_component_usage_id   NUMBER := NULL;

       l_retro_element_type_id      NUMBER := NULL;

       l_element_span_usage_id      NUMBER := NULL;

       l_object_version_number      NUMBER := NULL;

    BEGIN

       SELECT time_span_id

         INTO l_time_span_id

         FROM pay_time_spans

        WHERE CREATOR_ID = 1;


       SELECT prcu.retro_component_usage_id

         INTO l_retro_component_usage_id

         FROM pay_retro_component_usages prcu, pay_element_types_f petf

        WHERE petf.element_type_id = prcu.creator_id

              AND UPPER (petf.element_name) = 'MISC ALLOWANCE';


       SELECT petf.element_type_id

         INTO l_retro_element_type_id

         FROM pay_element_types_f petf

        WHERE UPPER (petf.element_name) = 'MISC ALLOWANCE RETRO';


       PAY_ESU_INS.

        ins (p_effective_date             => TO_DATE ('01-JAN-2020', 'DD-MON-YYYY'),

             p_time_span_id               => l_time_span_id,

             p_retro_component_usage_id   => l_retro_component_usage_id,

             p_retro_element_type_id      => l_retro_element_type_id,

             p_business_group_id          => 101,

             p_element_span_usage_id      => l_element_span_usage_id,

             p_object_version_number      => l_object_version_number);

       COMMIT;

       DBMS_OUTPUT.put_line (

          l_retro_component_usage_id || ' has been created Successfully !!!');

    EXCEPTION

       WHEN OTHERS

       THEN

          DBMS_OUTPUT.put_line ('Main Exception: ' || SQLERRM);

    END;


    Script to get Table Structure in Oracle

     DECLARE

      x_table_header  VARCHAR2(50);

      x_data_type_row VARCHAR2(100);

      x_data_type     VARCHAR2(100);

      tab_count       NUMBER := 0;

      x_column_id     NUMBER := 0;


      CURSOR tab 

      IS

        SELECT ao.object_name

          FROM all_objects ao

         WHERE ao.object_type = 'TABLE'

           AND ao.object_name LIKE 'XX%';


      CURSOR c1(p_table_name VARCHAR2) 

      IS

        SELECT *

          FROM all_tab_columns atc

         WHERE atc.table_name = p_table_name

         ORDER BY column_id;


    BEGIN

    dbms_output.enable(10000000);  


    FOR tbl IN tab 

    LOOP

        

    tab_count      := tab_count + 1;

    x_table_header := 'CREATE TABLE ' || tbl.object_name || ' (';

       

    dbms_output.put_line(x_table_header);

       

    FOR tbl_cols IN c1(tbl.object_name) 

    LOOP  

      

      SELECT MAX(atc.column_id)

    INTO x_column_id

    FROM all_tab_columns atc

       WHERE atc.table_name = tbl.object_name;

    IF  tbl_cols.column_id <> x_column_id THEN

    SELECT tbl_cols.data_type || DECODE(tbl_cols.data_type,

                                       'VARCHAR2',

                                       '(' || tbl_cols.data_length || '),',

                                       ',')

      INTO x_data_type

      FROM dual;

        

    x_data_type_row := RPAD(tbl_cols.column_name,30,' ') || '      ' || x_data_type;

    ELSIF  tbl_cols.column_id = x_column_id THEN

    SELECT tbl_cols.data_type || DECODE(tbl_cols.data_type,

                                       'VARCHAR2',

                                       '(' || tbl_cols.data_length || '));',');')

      INTO x_data_type

      FROM dual;

    x_data_type_row := RPAD(tbl_cols.column_name,30,' ') || '      ' || x_data_type;

    END IF;

          

    dbms_output.put_line(x_data_type_row);

         

      

    END LOOP;

    dbms_output.put_line(' ');

    END LOOP;


    END;

         




    Query to get Oracle Payroll Net Pay

       SELECT paf.assignment_number

            ,ppf.full_name

    ,paygr.payroll_name

    ,paygr.payroll_id

    ,element_name

    ,pbt.balance_name

    ,ppa.effective_date

    ,prv.result_value

        FROM pay_element_types_f pet

        ,pay_input_values_f piv

    ,pay_run_result_values prv

    ,pay_run_results prr

    ,pay_assignment_actions paa

    ,pay_payroll_actions ppa

    ,pay_balance_types pbt

    ,pay_balance_feeds_f pbff

    ,per_people_f ppf

    ,per_assignments_f paf

    ,per_grades gr

    ,pay_all_payrolls_f paygr

       WHERE prr.element_type_id = pet.element_type_id

         AND piv.element_type_id = pet.element_type_id

         AND prv.input_value_id = piv.input_value_id

         AND prv.run_result_id = prr.run_result_id

         AND prr.assignment_action_id = paa.assignment_action_id

         AND paa.payroll_action_id = ppa.payroll_action_id

         AND pbff.balance_type_id = pbt.balance_type_id

         AND piv.input_value_id = pbff.input_value_id

         AND ppa.effective_date BETWEEN :P_FROM_DATE AND :P_TO_DATE

         AND ppf.person_id = paf.person_id

         AND SYSDATE BETWEEN ppf.effective_start_date

                         AND ppf.effective_end_date

         AND paf.effective_start_date =

                    (SELECT MAX(effective_start_date)

                       FROM per_assignments_f paf1

                      WHERE paf.assignment_id = paf1.assignment_id)

         AND paa.assignment_id = paf.assignment_id

         AND gr.grade_id = paf.grade_id

         AND paygr.payroll_id = paf.payroll_id

         AND SYSDATE BETWEEN paygr.effective_start_date

                         AND paygr.effective_end_date


    Wednesday, June 9, 2021

    Excel Settings for ADF Desktop Integration and Smart View

    Step1: Excel Security Options and VB Options

    • For ADFdi to work in Excel and word, the following steps have to be performed. 
    • Open an empty excel spreadsheet. 
    • Navigate to Excel Options.

    • Click on Options. Navigate to Trust Center. 

    • Click on Trust Center Settings.
    • Navigate to Active X settings and make sure it looks like the below.

    • Navigate to Macro Settings and make sure it looks like this.


    Step2: Check for Add-Ins

    • Navigate to Excel Options and click on Add-Ins and select Com Add-Ins as shown in below screenshot and select Go.


    • And check if Oracle ADF Desktop Integration Add-In for Excel and Smart View for Office are enabled.


    • Sometime Client IE Browsers may have a lot of security enabled to prevent attacks. If you want to consider moving the oraclecloud.com domain to the Trusted Sites area.

    Step4: ADF Desktop Integration Setting Checker

    • Oracle Support has created a tool to check ADF Desktop Integration settings and is available as an exe. The exe should be downloaded and run and will list issues that can be resolved.
    • How to use ADF Desktop Integration Client Health Check Tool (Doc ID 2010222)







    Tuesday, June 8, 2021

    Payroll Interview Questions in Oracle Apps

    • What are the mandatory fields while creating Payroll?
      • Payroll Name
      • Period Type
      • Start Date
    • Define Elements?
      • Elements are the building blocks for earnings, deductions, etc. of a Payroll. 
      • It is a Data Structure which is used to hold information for both Human Resources and Payroll.
      • In Human Resources elements may represents compensation types including Earnings such as Salary, Hourly Wages and Bonuses.
      • In Payroll, elements constitute all the items in the Payroll run process.

    • What the Element can represent?
      • Earnings such as Salary, Wages & Bonuses
      • Benefits such as employee stock & pension plans
      • Non-Payroll items such as Expenses
      • Employer Taxes and other Liabilities.
      • Absences from work
      • Voluntary and In-Voluntary deductions

    • What are the Element Entry Concepts?
      • Recurring: Entries can exists over many Payroll periods
      • Non-Recurring: Entries are valid for single Payroll period only.
    • What are the types of Element Entry?
      • There are four types
        1. Normal Entry
        2. Override Entry
        3. Additional Entry
        4. Adjustment Entry
          • Additive Adjustment
          • Replacement Adjustment
          • Balance Adjustment

    • How can we add a new input value to an existing Element?
      • We can add an additional input values to an existing Element if the element has not been processed in a Payroll run and  the Effective data is the same date of creation of the Element.
    • What is Salary Basis ?
      • Salary basis is the duration on which the salary is reckoned. It is a rule to administer pay.

    • Define Quick Pay & Batch Processing?
      • When calculating pay, we can use either Quick Pay Process or Batch Process
      • Quick Pay Process which is for one employee.
      • Batch Process for all employees together.

    • What is Quick Pay/ Advance Pay/ Retro Pay?
      • QuickPay: 
        • QuickPay enables you to carry out payroll processing for individual employees. 
        • You can use QuickPay to pay employees who are leaving and who require payment immediately.
        • If an employee asks what their net pay will be this month, you can run QuickPay to find the answer, then roll it back to remove all results from the database.

      • Advance Pay:
        • The Advance Pay process enables you to pay employees in advance for holidays or other events. 
        • The process performs payroll runs for the periods to be advanced, using all date effective information in place, and stores the final net figure as the amount to be advanced.

      • Retro Pay: 
        • Payment for any previous cycle in the current payroll run

    • What is Retro Pay, Advance Pay & Absence Pay?
      • Retro Pay: Payment for any previous cycle in the current payroll run
      • Advance Pay: Payment for any future cycle/advance in the current payroll run
      • Absence Pay: Payment for leaves like sick leave, maternity leave, annual leave and other statutory leaves

    • Define Batch Element Entry?
      • This is an open interface specially designed for elements. With Batch Element Entry we can quickly incorporate mass updates in any specific elements.


    Query To Fetch AP Invoice Details From SO Number(Doc ID 2949013.1)

    SELECT dh.source_order_number       ,df.source_line_number as so_line_number   ,df.fulfill_line_number    ,ddr.doc_user_key as po_number...