2 Replies Latest reply: Aug 14, 2013 1:21 AM by 1032877 RSS

    pa_agreement_pub.add funding api Error

    591760
      Hi all,

      I m trying to create fundings using the PA_AGREEMENT_PUB.ADD_FUNDING. It threws an error 'The funding level you have entered is invalid'. Following is the code im using to create. please have a look and let me know what is the value im passing wrong or am I missing any thing.


      DECLARE
      --variables needed for API standard parameters
      l_api_version_number NUMBER := 1.0;
      l_commit VARCHAR2(1):= 'F';
      l_return_status VARCHAR2(1);
      l_init_msg_list VARCHAR2(1);
      l_msg_count NUMBER;
      l_msg_data VARCHAR2(2000);
      l_data VARCHAR2(2000);
      l_msg_entity VARCHAR2(100);
      l_msg_entity_index NUMBER;
      l_msg_index NUMBER;
      l_msg_index_out NUMBER;
      l_encoded VARCHAR2(1);
      API_ERROR EXCEPTION;
      l_funding_id_out NUMBER;
      l_pm_product_code VARCHAR2(25);
      l_pm_funding_reference VARCHAR2(25);
      l_funding_category VARCHAR2(30);
      l_project_funding_id NUMBER;
      l_agreement_id NUMBER;
      l_pa_project_id NUMBER;
      l_project_rate_type VARCHAR2(30);
      l_pa_task_id NUMBER;
      l_allocated_amount NUMBER;
      l_date_allocated DATE;
      l_desc_flex_name VARCHAR2(30);
      l_attribute_category VARCHAR2(30);
      l_attribute1 VARCHAR2(150);
      l_attribute2 VARCHAR2(150);
      l_attribute3 VARCHAR2(150);
      l_attribute4 VARCHAR2(150);
      l_attribute5 VARCHAR2(150);
      l_attribute6 VARCHAR2(150);
      l_attribute7 VARCHAR2(150);
      l_attribute8 VARCHAR2(150);
      l_attribute9 VARCHAR2(150);
      l_attribute10 VARCHAR2(150);
      l_funding_id NUMBER;
      l_projfunc_rate_type VARCHAR2(255);
      l_projfunc_exchange_rate NUMBER;
      BEGIN


      pa_interface_utils_pub.set_global_info(
      p_api_version_number =>1.0,
      p_responsibility_id =>53033,--l_resp_id_t,
      p_user_id =>62378,--l_user_id_t,
      p_msg_count =>l_msg_count,
      p_msg_data =>l_msg_data,
      p_return_status =>l_return_status
      );

      -- fnd_file.put_line (fnd_file.log,'Set Global Info status ->' || l_return_status);
      dbms_output.put_line ('Set Global Info status ->' || l_return_status);

      dbms_output.put_line ('level 1');

      -- PRODUCT RELATED DATA
      l_pm_product_code := 'TESTPRODCODE';
      l_init_msg_list := 'T';
      l_pm_funding_reference := 'TEST_M0236_REF';
      l_funding_category := 'TRANSFER';
      l_project_funding_id := Null;
      l_agreement_id := 1312;
      l_pa_project_id := 8274;
      --l_project_rate_type := 'Corporate';
      l_pa_task_id := 2492;
      l_allocated_amount := 2593.84;
      l_date_allocated := '02-DEC-2009';
      l_desc_flex_name := Null;
      l_attribute_category := Null;
      l_attribute1 := Null;
      l_attribute2 := Null;
      l_attribute3 := Null;
      l_attribute4 := Null;
      l_attribute5 := Null;
      l_attribute6 := Null;
      l_attribute7 := Null;
      l_attribute8 := Null;
      l_attribute9 := Null;
      l_attribute10 := Null;
      l_funding_id := Null;

      pa_pm_function_security_pub.set_global_vars('PA_AF_ADD_FUNDING','Y');

      pa_agreement_pub.add_funding
      (p_api_version_number => l_api_version_number
      ,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_pm_product_code => l_pm_product_code
      ,p_pm_funding_reference => l_pm_funding_reference
      ,p_funding_id => l_funding_id
      ,p_pa_project_id => l_pa_project_id
      ,p_pa_task_id => l_pa_task_id
      ,p_agreement_id => l_agreement_id
      ,p_allocated_amount => l_allocated_amount
      ,p_date_allocated => l_date_allocated
      ,p_desc_flex_name => l_desc_flex_name
      ,p_attribute_category => l_attribute_category
      ,p_attribute1 => l_attribute1
      ,p_attribute2 => l_attribute2
      ,p_attribute3 => l_attribute3
      ,p_attribute4 => l_attribute4
      ,p_attribute5 => l_attribute5
      ,p_attribute6 => l_attribute6
      ,p_attribute7 => l_attribute7
      ,p_attribute8 => l_attribute8
      ,p_attribute9 => l_attribute9
      ,p_attribute10 => l_attribute10
      ,p_funding_id_out => l_funding_id_out
      ,p_funding_category => l_funding_category);

      dbms_output.put_line(l_return_status);
      IF l_return_status != 'S'
      THEN
      dbms_output.put_line('Error Occured');
      RAISE API_ERROR;
      ELSE
      Null;
      dbms_output.put_line('Add Funding Successful');
      dbms_output.put_line('Funding ID:'||l_funding_id);
      dbms_output.put_line('Funding ID Out:'||l_funding_id_out);
      END IF;
      EXCEPTION
      WHEN API_ERROR THEN
      for i in 1..l_msg_count
      loop
      pa_interface_utils_pub.get_messages
      (p_msg_data => l_msg_data
      ,p_data => l_data
      ,p_msg_count => l_msg_count
      ,p_msg_index_out => l_msg_index_out);
      dbms_output.put_line ('error mesg:'||l_data);
      dbms_output.put_line('fnd_pub -> '||APPS.FND_MSG_PUB.Get
      ( p_msg_index => APPS.FND_MSG_PUB.G_LAST,
      p_encoded => APPS.FND_API.G_FALSE));
      end loop;
      WHEN OTHERS THEN
      pa_interface_utils_pub.get_messages
      (p_msg_data => l_msg_data
      ,p_data => l_data
      ,p_msg_count => l_msg_count
      ,p_msg_index_out => l_msg_index_out);
      dbms_output.put_line ('error mesg:'||l_data);
      END;


      Here is the error:

      Set Global Info status ->S
      level 1
      E
      Error Occured
      error mesg:
      fnd_pub -> The funding level you have entered is invalid.


      Please help me out

      THanks,
      Shashi