Foundation APIs

Download Foundation APIs

Post on 08-Mar-2015

430 views

Category:

Documents

4 download

Embed Size (px)

TRANSCRIPT

<p>Implementation of Project Foundation APIs(Create_project &amp; Update_project)(Oracle Projects11.5.9) An Oracle White Paper 14/Mar/05</p> <p>Vamsi Andavarapu, Global Product Support,Oracle.</p> <p>Table of Contents</p> <p>Abstract.................................................................................................................... 3 Audience.................................................................................................................. 3 Introduction.............................................................................................................. 4 Prerequisites ........................................................................................................... 5 Activity Management Setup ............................................................................... 5 Template Setup................................................................................................... 6 Other Setups ....................................................................................................... 8 PA_PROJECT_PUB.Create Project..................................................................... 8 Parameters for Create_Projects :...................................................................... 8 Project Information............................................................................................ 13 Task Structure................................................................................................... 13 Classifications ................................................................................................... 14 Key Members .................................................................................................... 14 PA_PROJECT_PUB.Update Project .................................................................. 15 Project Information............................................................................................ 16 Task Structure................................................................................................... 16 Classifications ................................................................................................... 17 Key Members .................................................................................................... 17 Implementation of Project APIs Case Study................................................... 17 Requirement Description.................................................................................. 17 Solution Approach ............................................................................................ 18 Trouble shooting ................................................................................................... 20 Example Code for the Create_project API......................................................... 21 Example Code for the Update_project API ........................................................ 24 Known Issues........................................................................................................ 27</p> <p>Implementation of Project Foundation APIs</p> <p>2</p> <p>Abstract This paper has been created to assist the usage of Oracle Project Foundation APIs create_project and update_project. Further it also discusses the pre-requisites for usage of APIs and general observed behaviour with respect to API parameters- key members, classifications, work break down structures (WBS) etc. The paper also illustrates how the project APIs be used in migrating projects from legacy systems. Problems that are usually encountered in the implementation of APIs, solutions for the same and workarounds to resolve the problems are discussed. To sum up the objective of this paper is to share the experience we have had in the implementation of APIs- create_project and update_project and how the APIs can be used in the migration of the projects.</p> <p>Audience</p> <p>You are an Oracle Application professional interested in implementing projects APIs (create_project and Update_project) for creating projects or updating projects in Oracle Projects Module. This paper is written with the assumption that you have working knowledge of Oracle Projects module and APIs in Oracle Applications. Information sources are provided at the end of this paper. To get most out of this paper, it is recommended that you have good understanding of the concepts in creating projects, creating project templates and using APIs. A case study is also included which will be helpful for the consultants involved in the design of migrating projects from legacy systems.</p> <p>Implementation of Project Foundation APIs</p> <p>3</p> <p>Introduction Any project-based organization implementing Oracle ERP application will require migrating all the projects information from legacy system. If the organization uses third party applications apart from the Oracle applications ERP like Primavera, Microsoft Projects, CASH etcthen there may be business requirements to integrate Oracle Projects with external systems. In such a scenario, projects are required to be maintained parallel in both the systems and further they are periodically updated in both the systems. We can use Project Foundation APIs to integrate both the systems. This paper explains behaviour of APIs and how to use APIs in migration of projects defined in the external systems, how one can use the APIs to make necessary updations to projects created. This paper does not delve into the integration of the systems as such. Projects can be created in different ways. Setup a template project and copy the projects from the template. This approach is best suited if number of projects to be migrated is very less. If projects are maintained in Microsoft projects, MS projects have a functionality to create the same projects in Oracle projects with the same structure. This is supported by Oracle. Using Projects APIs.</p> <p>A case study in the later section of this paper discusses how data is to be migrated from external systems to Oracle Projects using APIs. In general, we can expect data in flat files in predefined format to be loaded into staging tables (custom tables created to load the data given in flat files) for validation before passing the values to API. This loading of data from flat files into custom tables can be done using any of the tools like SQL loader etc. After the validation, these values will be passed to API as parameters and the project is created or updated as desired.</p> <p>Implementation of Project Foundation APIs</p> <p>4</p> <p>Prerequisites Activity Management Setup Step 1: Setting up of source product is mandatory. Navigation to setup Source Product: Projects Responsibility Setup </p> <p>Activity Management Gateway Source Product</p> <p>Note: One can define any number of product sources depending on the requirement. The product source code defined here will be passed as a value to the parameter p_pm_product_code.</p> <p>Step 2: Navigation to setup control actions: Projects Responsibility Setup Activity Management Gateway Control Actions</p> <p>Implementation of Project Foundation APIs</p> <p>5</p> <p>Note: Entering an action in this window prevents users from performing actions in Oracle Projects, on a record that originated in the specified external system. (For more information on control actions refer to Integration with NonOracle Applications Activity Management gateway section in Oracle Projects User guide)</p> <p>Template Setup Step 3: Setup template project with all the required setups. Setup quick entry fields as mandatory to enable API to validate these fields as mandatory parameters for the project being created. Navigation to setup template: Projects Responsibility Setup Projects Project Templates New.</p> <p>Implementation of Project Foundation APIs</p> <p>6</p> <p>Click on the Setup Quick Entry to set up the quick entry fields</p> <p>Note: Enabling the Required field will enforce the API to validate the parameter as mandatory when using this template. For more information on setup of Project Templates and setup Quick Entry please refer Oracle Projects user guide.</p> <p>Implementation of Project Foundation APIs</p> <p>7</p> <p>Other Setups Step 4: Prior to migrating projects from legacy applications, following prerequisites should be ensured: Organization - Organization setup must be completed in Oracle HRMS. Employee Employee setup must be completed in Oracle HRMS.</p> <p> Customer Customer setup must be completed in Oracle Receivables. Employees being defined as key members on the projects should be defined in HRMS with valid date range and have a valid assignment. Customers should be setup in Oracle receivables with valid ship-to-address, bill-toaddresses and the bill-to-addresses should have bill to contact setup. Create Project and Update Project APIs PA_PROJECT_PUB.Create Project This API is used to create project from an existing project template/project. The section below discusses how the project can be created using the AMG API create_project Parameters for Create_Projects: The parameters to create_project and their structures are discussed below.Name P_API_VERSION_NUMBER P_COMMIT P_INIT_MSG_LIST P_MSG_COUNT P_MSG_DATA P_RETURN_STATUS P_WORKFLOW_STARTED P_PM_PRODUCT_CODE P_PROJECT_IN P_PROJECT_OUT P_KEY_MEMBERS P_CLASS_CATEGORIES P_TASKS_IN P_TASKS_OUT P_ORG_ROLES P_STRUCTUR_IN P_EXT_ATTR_TBL_IN Usage IN IN IN OUT OUT OUT OUT IN IN OUT IN IN IN OUT IN IN IN TYPE NUMBER VARCHAR2(1) VARCHAR2(1) NUMBER VARCHAR2(2000) VARCHAR2(1) VARCHAR2 VARCHAR2(30) PROJECT_IN_REC_TYPE PROJECT_OUT_REC_TYPE PROJECT_ROLE_TBL_TYPE CLASS_CATEGORY_TBL_TYPE TASK_IN_TBL_TYPE TASK_OUT_TBL_TYPE TABLE TYPE TABLE TYPE TABLE TYPE Required? Yes No No</p> <p>Yes Yes No No No No No No</p> <p>Implementation of Project Foundation APIs</p> <p>8</p> <p>PROJECT_IN_REC_TYPE: Note: Required? Yes: Indicates that the parameter is necessarily required to be passed. No: Parameter is not required (not mandatory). B: Indicates that the value will be based on Project Template.</p> <p>Namepm_project_reference pa_project_id pa_project_number project_name long_name created_from_project_id carrying_out_organization_id public_sector_flag project_status_code description start_date completion_date distribution_rule customer_id project_relationship_code actual_start_date actual_finish_date early_start_date early_finish_date late_start_date late_finish_date scheduled_start_date scheduled_finish_date attribute_category attribute1 attribute2 attribute3 . . attribute10 output_tax_code retention_tax_code project_currency_code allow_cross_charge_flag project_rate_date project_rate_type cc_process_labor_flag abor_tp_schedule_id labor_tp_fixed_date cc_process_nl_flag nl_tp_schedule_id nl_tp_fixed_date cc_tax_task_id role_list_id work_type_id calendar_id location_id probability_member_id project_value</p> <p>TypeVARCHAR2(25) NUMBER VARCHAR2(25) VARCHAR2(30) VARCHAR2(240) NUMBER NUMBER VARCHAR2(1) VARCHAR2(30) VARCHAR2(250) DATE DATE VARCHAR2(30) NUMBER VARCHAR2(30) DATE DATE DATE DATE DATE DATE DATE DATE VARCHAR2(30) VARCHAR2(150) VARCHAR2(150) VARCHAR2(150)</p> <p>Required?Y For Update N N Y B B B B B B B B B Y N N N N N N N N N N N N</p> <p>VARCHAR2(150) VARCHAR2(30) VARCHAR2(30) VARCHAR2(15) VARCHAR2(1) DATE VARCHAR2(30) VARCHAR2(1) NUMBER DATE VARCHAR2(1) NUMBER DATE NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER</p> <p>N N N N N N N N N N N N N N N N N N N N</p> <p>Implementation of Project Foundation APIs</p> <p>9</p> <p>expected_approval_date cost_job_group_id bill_job_group_id team_template_id country_code region city emp_bill_rate_schedule_id job_bill_rate_schedule_id invproc_currency_type revproc_currency_code project_bil_rate_date_code project_bil_rate_type project_bil_rate_date project_bil_exchange_rate projfunc_currency_code projfunc_bil_rate_date_code projfunc_bil_rate_type projfunc_bil_rate_date projfunc_bil_exchange_rate funding_rate_date_code funding_rate_type funding_rate_date funding_exchange_rate baseline_funding_flag multi_currency_billing_flag competence_match_wt availability_match_wt job_level_match_wt enable_automated_search search_min_availability search_org_hier_id search_starting_org_id search_country_id min_cand_score_reqd_for_nom max_num_of_sys_nom_cand non_lab_std_bill_rt_sch_id search_country_code inv_by_bill_trans_curr_flag projfunc_cost_rate_type projfunc_cost_rate_date assign_precedes_task split_cost_from_workplan_flag split_cost_from_bill_flag adv_action_set_id start_adv_action_set_flag priority_code retn_billing_inv_format_id retn_accounting_flag opp_value_currency_code revaluate_funding_flag include_gains_losses_flag security_level labor_disc_reason_code non_labor_disc_reason_code Bill_To_Customer_id Ship_To_Customer_id</p> <p>DATE NUMBER NUMBER NUMBER VARCHAR2(250) VARCHAR2(250) VARCHAR2(250) NUMBER NUMBER VARCHAR2(30) VARCHAR2(15) VARCHAR2(30) VARCHAR2(30) DATE NUMBER VARCHAR2(15) VARCHAR2(30) VARCHAR2(30) DATE NUMBER VARCHAR2(30) VARCHAR2(30) DATE NUMBER VARCHAR2(1) VARCHAR2(1) NUMBER NUMBER NUMBER VARCHAR2(1) NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER VARCHAR2(2) VARCHAR2(1) VARCHAR2(30) DATE VARCHAR2(1) VARCHAR2(1) VARCHAR2(1) NUMBER VARCHAR2(1) VARCHAR2(30) NUMBER VARCHAR2(1) VARCHAR2(15) VARCHAR2(1) VARCHAR2(1) NUMBER VARCHAR2(30) VARCHAR2(30) NUMBER NUMBER</p> <p>N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N N</p> <p>PROJECT_OUT_REC_TYPE:</p> <p>Implementation of Project Foundation APIs</p> <p>10</p> <p>Name pa_project_id pa_project_number return_status</p> <p>Type NUMBER VARCHAR2(25) VARCHAR2(1)</p> <p>PROJECT_ROLE_TBL_TYPE: IS TABLE OF project_role_rec_type The definition of Project_Role_rec_type is as follows: Nameperson_id project_role_type start_date end_date</p> <p>TypeNUMBER VARCHAR2(20) DATE DATE</p> <p>Required?Y Y N N</p> <p>CLASS_CATEGORY_TBL_TYPE: IS TABLE OF class_category_rec_typeThe definition of class_category_rec_type is as follows:</p> <p>Nameclass_category class_code code_percentage</p> <p>TypeVARCHAR2(30) VARCHAR2(30) NUMBER</p> <p>Required?Y Y N</p> <p>TASK_IN_TBL_TYPE IS TABLE OF task_in_rec_typeThe definition of task_in_rec_type is as follows</p> <p>Namepm_task_reference pa_task_id task_name long_task_name pa_task_number task_description task_start_date task_completion_date pm_parent_task_reference pa_parent_task_id address_id carrying_out_organization_id service_type_code task_manager_person_id billable_flag chargeable_flag ready_to_bill_flag ready_to_distribute_flag limit_to_txn_controls_flag labor_bill_rate_org_id labor_std_bill_rate_schdl labor_schedule_fixed_date labor_schedule_discount non_labor_bill_rate_org_id non_labor_std_bill_rate_schdl non_labor_schedule_fixed_date non_labor_schedule_discount labor_cost_multiplier_name cost_ind_rate_sch_id rev_ind_rate_sch_id</p> <p>TypeVARCHAR2(25) NUMBER VARCHAR2(20) VARCHAR2(240) VARCHAR2(25) VARCHAR2(250) DATE DATE VARCHAR2(25) NUMBER NUMBER NUMBER VARCHAR2(30) NUMBER VARCHAR2(1) VARCHAR2(1) VARCHAR2(1) VARCHAR2(1) VARCHAR2(1) NUMBER VARCHAR2(20) DATE NUMBER NUMBER VARCHAR2(30) DATE NUMBER VARCHAR2(20) NUMBER NUMBER</p> <p>Required?Y U Y Y N N N N N U N N N N N N...</p>