Friday, 30 August 2013

Creating User in R12 Oracle Apps using API

This article helps in creating a New Oracle user from backend using FND_USER_PKG.CREATE_USER API.

This API is tested in R12.1.3  


DECLARE
   l_responsibility_id   NUMBER;
   l_application_id      NUMBER;
   l_user_id             NUMBER := fnd_global.user_id;
   x_user_id             NUMBER;
   l_password            VARCHAR2 (2000) := 'password';
BEGIN
   hr_user_acct_internal.create_fnd_user (p_user_name         => 'user_name',
                                          p_password          => l_password,
                                          p_employee_id       => NULL,
                                          p_user_id           => x_user_id,
                                          p_user_start_date   => SYSDATE,
                                          p_email_address     => NULL,
                                          p_description       => NULL,
                                          p_password_date     => NULL);
   DBMS_OUTPUT.put_line (x_user_id);

   IF x_user_id IS NOT NULL
   THEN
      UPDATE fnd_user
         SET password_lifespan_days = 90
       WHERE user_id = x_user_id;

      COMMIT;
   END IF;
END;

No comments:

Post a Comment