Tuesday 22 January 2013

R12 Supplier Contact creation API


AP_SUP_SITE_CONTACT_INT interface used in 11i for loading supplier contact. Currently in R12 contacts can not be loaded using the interface table.

ap_vendor_pub_pkg.create_vendor_contact API is used in R12 and the program has to be registered as a concurrent program.
### Sample R12 Code    

BEGIN
     v_party_usg_assignment_id := NULL;
      v_relationship_id := NULL;
      v_directional_flag := NULL;
      v_rel_rowid := NULL;
      fnd_file.put_line (fnd_file.LOG,
                            'Vendor code :'
                         || rec.vendor_name
                         || '  Vendor site code :'
                         || rec.vendor_site_code
                         || '  Person Last Name : '
                         || rec.person_last_name
                        );
      l_vendor_contact.vendor_id := rec.vendor_id;
      l_vendor_contact.vendor_site_id := rec.vendor_site_id;
      l_vendor_contact.org_id := rec.org_id;
      l_vendor_contact.person_first_name := rec.person_first_name;
      l_vendor_contact.person_middle_name := rec.person_middle_name;
      l_vendor_contact.person_last_name := rec.person_last_name;
     l_vendor_contact.phone := rec.phone;
      l_vendor_contact.email_address := rec.email_address;
      p_init_msg_list := fnd_api.g_true;
      p_commit := fnd_api.g_false;
      x_return_status := NULL;
      x_msg_count := NULL;
      x_msg_data := NULL;

      IF rec.process_flag = 'I'
      THEN
         fnd_file.put_line (fnd_file.LOG, 'Creating contacts....');
         ap_vendor_pub_pkg.create_vendor_contact
                  (p_api_version             => p_api_version,
                   p_init_msg_list           => p_init_msg_list,
                   p_commit                  => p_commit,
                   x_return_status           => x_return_status,
                   x_msg_count               => x_msg_count,
                   x_msg_data                => x_msg_data,
                   p_vendor_contact_rec      => l_vendor_contact,
                   x_vendor_contact_id       => l_vendor_contact.vendor_contact_id,
                   x_per_party_id            => l_vendor_contact.per_party_id,
                   x_rel_party_id            => l_vendor_contact.relationship_id,
                   x_rel_id                  => l_vendor_contact.rel_party_id,
                   x_org_contact_id          => l_vendor_contact.org_contact_id,
                   x_party_site_id           => l_vendor_contact.party_site_id
                  );
         error_handling (rec.r_id, x_return_status, x_msg_count, x_msg_data);
         fnd_file.put_line (fnd_file.LOG, '*************');
      END IF;
END;



No comments:

Post a Comment