9 Replies Latest reply on Oct 29, 2013 3:27 PM by Raghavan G-Oracle

    Trying to update Project scheduled finish date - newbie help needed!


      Guys, I am super new to Oracle Projects, I have never used it before.  I've just learned a few things in the UI and read through the docs documenting the stored procs.  My question is simple (hopefully)   In the UI I choose a responsibility, then under "Projects : Delivery" I choose "Search Projects", I enter the Project ID in the field and click Go, I am able to see all the project details and the Tasks.  No problem there!  What I would like to do through the Update_Project API is to change the "Scheduled Finish Date" of the Project.


      I have the following information that I have managed to scrape up:

      Project_id, Responsibility_id, User_id, Resp_Appl_Id


      I retrieved the project id using:

               Select project_id,name from pa_projects_all

                where name = 'My Project';


      So first I call set_global_info with the appropriate parameters, then this:


          -- SET GLOBAL VALUES


           p_api_version_number => 1.0,

           p_responsibility_id => fnd_profile.value('57203'),

           p_user_id => fnd_profile.value('1013415'),

           p_msg_count => l_msg_count,

           p_msg_data => l_msg_data,

           p_return_status => l_return_status);


           l_project_in.pa_project_id := 4608;

           l_project_in.scheduled_finish_date := to_date('2008-02-27', 'YYYY-MM-DD');





                          p_commit => l_commit,

                          p_init_msg_list => l_init_msg_list,

                          p_msg_count => l_msg_count,

                          p_msg_data => l_msg_data,

                          p_return_status => l_return_status,

                          p_workflow_started => l_workflow_started,

                          p_pm_product_code => null,

                          p_project_in => l_project_in,

                          p_project_out => l_project_out,

                          p_key_members => l_key_members,

                          p_class_categories => l_class_categories,

                          p_tasks_in => l_tasks_in,

                          p_tasks_out => l_tasks_out);


      What I am getting is the message "error :Project ID is invalid" and the status is "E"


      I'm not sure why it is invalid as it is the exact Project ID from the projects table.  The only thing I can think of is that the p_pm_product_code is set to null but I am not sure where this value comes from and why it even matters.  I checked the documents and it says it refers to some external system.  Why does the external system code matter if I am changing data within Oracle Projects?

        • 1. Re: Trying to update Project scheduled finish date - newbie help needed!
          Raghavan G-Oracle



          Looks like you are not setting the Initialization values correctly. Oracle Project APIs are Org specific and require proper initialization before being called for them to work.


          Few things i noticed from the code is :


          1.  The following is being used to set the User ID and Responsibility ID  :


               p_responsibility_id => fnd_profile.value('57203'),

               p_user_id => fnd_profile.value('1013415'),


          I think the call should be like this. This should be used only if you are going to call the API through a concurrent program from the submit request window (Oracle Apps environment). fnd_profile.value will get the responsibility id and the used id of the user running the program and assign it to the variables.


               p_responsibility_id => fnd_profile.value('RESP_ID'),

               p_user_id => fnd_profile.value('USER_ID'),


          Or If you are directly passing the IDs hardcoded then, This can be used if you are running the script from a Non-Oracle Applications environment, for example from SQL*Plus.


               p_responsibility_id => 57203

               p_user_id => 1013415


          2. I notice that you are not passing P_OPERATING_UNIT_ID parameter in the call to pa_interface_utils_pub.set_global_info. This is fine if you are not using MOAC  and you have set MO: Operating Unit profile for the responsibility being passed.  If you are using MOAC or are not sure, then it is always a good practice to explicitly  pass the P_OPERATING_UNIT_ID parameter in the call to pa_interface_utils_pub.set_global_info.


          Note :  DO NOT use fnd_profile.value('ORG_ID') to set the P_OPERATING_UNIT_ID parameter. In a MOAC environment this may not work.


          3. Always ensure you check the return status of the pa_interface_utils_pub.set_global_info for success before calling the Project APIs. This will save you a lot of frustration when testing.


          4. You might find the following note useful


          Project API Overview and Reference (Doc ID 1424156.1)



          Raghavan Gopalakrishnan

          • 2. Re: Trying to update Project scheduled finish date - newbie help needed!

            Thanks Raghavan, I am running this script from Toad so I needed to hardcode the values for userid/responsibility id and then everything worked great!!

            • 3. Re: Trying to update Project scheduled finish date - newbie help needed!
              Raghavan G-Oracle

              Glad I could help. Good Day !.



              Raghavan Gopalakrishnan

              • 4. Re: Trying to update Project scheduled finish date - newbie help needed!

                I'm having one more issue... I am able to change the Scheduled Finish Date on the project but I cannot change the "Actual Start Date" on the project.  I am not getting any errors and the update_project completes with status code S and msg_count is 0 (no messages returned).  I am also unable to change the Project Name.  What is weird is that the name updates  in the PA_PROJECTS_ALL view but no longer comes up when searching the project in the UI.  Any ideas?

                • 5. Re: Trying to update Project scheduled finish date - newbie help needed!
                  Raghavan G-Oracle

                  Hi ,


                  Probably a commit has not been issued after the end of the API call. Issue a commit and then check from the application.



                  Raghavan Gopalakrishnan

                  • 6. Re: Trying to update Project scheduled finish date - newbie help needed!

                    Thanks, I am actually doing the update in one single call to update_project, so it looks like it is ignoring the Actual Start Date but making the change to Scheduled Finish Date.  When I manually updated the PA_PROJECTS_ALL table the change was reflected in the UI but for some reason the API does not want to do it.  I also tried doing an explicit commit but that didn't help.


                    I'm also having issues with updating Task information, I call Update Task, the API works fine and returns with a "S" but the updates do not show up in the UI...when viewing tasks under the "Workplan" tab


                    What I discovered was that the information coming in the WorkPlan tab in the UI is from the PA_TASK_PROGRESS_V view (pa_project_elements table) and the update_task API is updating the task information in PA_TASKS table is not used.


                    attached images:


                    cap1 - query from the PA_TASKS_V view, I updated the Task name and description for Task id# 79844 to "Kevins task" but it does not show in the UI here...



                    cap2 - query from the PA_TASK_PROGRESS_V which shows the current UI info, note Task id# 79844 has the original value



                    cap3 - UI reference shot



                    I know I can use the update_task_progress API but if the current information is not stored int he PA_TASK table then what is the point of that table and also the update_task API?  Is this table redundant?  It does not look like I can see info from this table anywhere in the UI!!

                    • 7. Re: Trying to update Project scheduled finish date - newbie help needed!
                      Raghavan G-Oracle



                      Please publish the workplan, The changes made by the API should be visible after publishing.



                      Raghavan Gopalakrishnan

                      • 8. Re: Trying to update Project scheduled finish date - newbie help needed!

                        Thanks Raghavan for all your help, I appreciate it!   Is there a specific API to publish the workplan?  I noticed that there is another API called update_task_progress that will update the progress directly.  My question- what is the difference between using update_task and then publishing as opposed to directly using update_task_progress?  Also, is there a way of publishing from the UI?  or viewing data in the PA_TASK table?

                        • 9. Re: Trying to update Project scheduled finish date - newbie help needed!
                          Raghavan G-Oracle

                          Hi ,


                          The PA_PROJECT_PUB.change_structure_status can be used to publish the workplan.  Regarding the update_task_progress, (you must be referring to the execute_update_task_progress API) , this API is used to update the progress and progress is always updated on the latest published version. update_task is used for updating certain attributes of the WBS or FBS (working version).

                          You can publish from the application, from the maintain version page or the working workplan version. Please refer to the Oracle Project Management User Guide for more information.

                          Regarding viewing data in PA_TASKS, the Tasks that you see in the forms is from pa_tasks (which is the FBS). This can also be seen under the "Financials" tab under the tasks link.

                          As we seem to be deviating away from the topic of the thread , in case you have any further questions other than the thread topic,  I'ld suggest to log a new thread so that it will be easier for users searching for specific topics to find what they are looking for.