Thursday, 22 August 2013

Auto Invoice Error : Invalid Value of Conversion Type (CONVERSION_TYPE)

When we run the Auto Invoice Import Program the record errors out with the details Invalid Value of Conversion Type (CONVERSION_TYPE).
This Error occurs because of the below reason :

  1. The Conversion Type Specified is not defined in the system
  2. Some times the user by mistake updates the value of USER_CONVERSION_TYPE of the table : GL_DAILY_CONVERSION_TYPES where as the value needs to be picked from the field CONVERSION_TYPE.


Auto Invoice Error : The supplied unit of measure and the primary unit of measure of your system item must share the same unit of

When importing invoice from ra_interface_lines_All table the user can be faced with an error : The supplied unit of measure and the primary unit of measure of your system item must share the same unit of.
This error message is generally reported because of either of the below reason:

  1. The Unit of Measure specified for the item in ra_interface_lines_all is different from what is specified in the item setup
  2. The item is not assigned to the warehouse for which the invoice line is being tried to be imported


Monday, 8 April 2013

API to Update External Bank Account Details

When an external bank is created in Oracle the user can access the bank details from the view : iby_ext_banks_v.

For each bank records created in the system Oracle will create a party and a party profile too in the tbale hz_oprganization_profiles. Depending on the business the users may be needed to update the bank details in the system , Oracle has provided us with an API which helps us to update banks in Oracle.

IBY_EXT_BANKACCT_PUB.update_ext_bank

   IBY_EXT_BANKACCT_PUB.update_ext_bank (
                          p_api_version     => 1.0,
                          p_init_msg_list   => FND_API.G_TRUE,
                          p_ext_bank_rec    => l_bank_rec,
                          x_return_status   => l_chr_return_status,
                          x_msg_count       => l_num_count,
                          x_msg_data        => l_msg_data,
                          x_response        => x_response_rec);

When calling the API to update the bank the important parameters to be passed are bank_id and object_Version number.

Bank Id is the Id of the bank which the user can get from iby_ext_banks_v.
Object_version_number : Query the table hz_organization_profiles from with the bank_id:

SELECT max(object_version_number)
     INTO l_num_version_number
     FROM apps.hz_organization_profiles
   WHERE party_id = l_num_bank_id;

Pass the object version number to Oracle , In case this value is not passed to the API , you will get an error message, Cannot lock the record in the table HZ_PARTIES , the record is being updated by another user.

In addition to the above values pass the varibales that you wish to update and the API will take care of it :

Sample code Snippet:

IBY_EXT_BANKACCT_PUB.update_ext_bank (
                          p_api_version     => 1.0,
                          p_init_msg_list   => FND_API.G_TRUE,
                          p_ext_bank_rec    => l_bank_rec,
                          x_return_status   => l_chr_return_status,
                          x_msg_count       => l_num_count,
                          x_msg_data        => l_msg_data,
                          x_response        => x_response_rec);   
             
                         --Check for Sucess API
            fnd_file.put_line(fnd_file.LOG,'x_response_rec.result_message '||        x_response_rec.result_message);    
            IF (l_chr_return_status <> 'S')
            THEN
               FOR i IN 1 .. l_num_count
               LOOP
                  fnd_msg_pub.get (
                                  p_msg_index       => -1,
                                  p_encoded         => 'F',
                                  p_data            => l_msg_data,
                                  p_msg_index_out   => l_msg_index_out);
                  fnd_file.put_line (
                                  fnd_file.LOG,
                                  'Error in Bank  Update  ' || l_msg_data);
                            END LOOP;
                ELSE
                   fnd_file.put_line (fnd_file.LOG,
                                               'Bank Updated Sucessfully  ');
              COMMIT;
              END IF;