Showing posts with label Projects. Show all posts
Showing posts with label Projects. Show all posts

Tuesday, June 15, 2021

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;


  

APEX$TASK_PK

  APEX$TASK_PK is a substitution string holding the primary key value of the system of records