Script to update Customer Location Address

Script to update Customer Location Address, www.akhareesh.com

DECLARE
   p_location_rec            HZ_LOCATION_V2PUB.LOCATION_REC_TYPE;
   p_object_version_number   NUMBER;
   x_return_status           VARCHAR2 (4000);
   x_msg_count               NUMBER;
   x_msg_data                VARCHAR2 (4000);
BEGIN
   DBMS_OUTPUT.PUT_LINE ('Start of Script');
   mo_global.init ('AR');
   fnd_global.apps_initialize (user_id        => 11,
                               resp_id        => 551122,
                               resp_appl_id   => 457);
   mo_global.set_policy_context ('S', 123);

   p_object_version_number := 1;
   p_location_rec.location_id := 28195;
   p_location_rec.address1 := 'TEST1';
   p_location_rec.address2 := 'TEST2';
   p_location_rec.address3 := 'TEST3';
   p_location_rec.address4 := 'TEST4';
   p_location_rec.CITY := 'TEST5';
   p_location_rec.STATE := 'TEST6';
   p_location_rec.POSTAL_CODE := '123456';
   p_location_rec.COUNTRY := 'US';

   DBMS_OUTPUT.PUT_LINE ('Calling the API hz_location_v2pub.update_location');

   hz_location_v2pub.update_location (
      p_init_msg_list           => FND_API.G_TRUE,
      p_location_rec            => p_location_rec,
      p_object_version_number   => p_object_version_number,
      x_return_status           => x_return_status,
      x_msg_count               => x_msg_count,
      x_msg_data                => x_msg_data);

   IF x_return_status = fnd_api.g_ret_sts_success
   THEN
      COMMIT;
      DBMS_OUTPUT.PUT_LINE ('Successfully Location address updated ');
   ELSE
      ROLLBACK;

      FOR i IN 1 .. x_msg_count
      LOOP
         x_msg_data := oe_msg_pub.get (p_msg_index => i, p_encoded => 'F');
         DBMS_OUTPUT.put_line (i || ') ' || x_msg_data);
      END LOOP;

      DBMS_OUTPUT.put_line ('Location address update failed:' || x_msg_data);
   END IF;

   DBMS_OUTPUT.PUT_LINE ('End of Script');
END;
/

*/

5 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. you will need support or suggestions, write me privately.
    I interested in your implementation/use case.
    the best situs slot terbaik
    Togel2win

    ReplyDelete
  3. 25% OFF on Oracle Apps R12 Financials Self Paced Course along with 11 Additional Add On Courses (321 Session Videos of 120 Hours Recordings). Our Top Trending Course with 1700 Enrolled Udemy Students

    Please Check https://www.oracleappstechnical.com for details

    ReplyDelete