07 March 2011

How to create the FND_USER using pl/sql script

Create the FND_USER using pl/sql script 


/* Formatted on 25-Mar-11 01:20:26 PM (QP5 v5.163.1008.3004) */
DECLARE
   P_HIRE_DATE         DATE;
   P_USER_NAME         VARCHAR2 (32767);
   P_PASSWORD          VARCHAR2 (32767);
   P_USER_START_DATE   DATE;
   P_USER_END_DATE     DATE;
   P_EMAIL_ADDRESS     VARCHAR2 (32767);
   P_FAX               VARCHAR2 (32767);
   P_DESCRIPTION       VARCHAR2 (32767);
   P_PASSWORD_DATE     DATE;
   P_LANGUAGE          VARCHAR2 (32767);
   P_HOST_PORT         VARCHAR2 (32767);
   P_EMPLOYEE_ID       VARCHAR2 (32767);
   P_CUSTOMER_ID       VARCHAR2 (32767);
   P_SUPPLIER_ID       VARCHAR2 (32767);
   P_USER_ID           NUMBER;
BEGIN
   P_HIRE_DATE := NULL;
   P_USER_NAME := 'muthu';
   P_PASSWORD := 'welcome1';
   P_USER_START_DATE := SYSDATE;
   P_USER_END_DATE := NULL;
   P_EMAIL_ADDRESS := NULL;
   P_FAX := NULL;
   P_DESCRIPTION := NULL;
   P_PASSWORD_DATE := NULL;
   P_LANGUAGE := 'AMERICAN';
   P_HOST_PORT := NULL;
   P_EMPLOYEE_ID := NULL;
   P_CUSTOMER_ID := NULL;
   P_SUPPLIER_ID := NULL;
   P_USER_ID := NULL;
   DBMS_OUTPUT.put_line ('entry');
   APPS.HR_USER_ACCT_INTERNAL.CREATE_FND_USER (P_HIRE_DATE,
                                               P_USER_NAME,
                                               P_PASSWORD,
                                               P_USER_START_DATE,
                                               P_USER_END_DATE,
                                               P_EMAIL_ADDRESS,
                                               P_FAX,
                                               P_DESCRIPTION,
                                               P_PASSWORD_DATE,
                                               P_LANGUAGE,
                                               P_HOST_PORT,
                                               P_EMPLOYEE_ID,
                                               P_CUSTOMER_ID,
                                               P_SUPPLIER_ID,
                                               P_USER_ID);
   COMMIT;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line ('error occured in user creation' || SQLERRM);
      ROLLBACK;
END;

THEN
UPDATE fnd_user
SET password_lifespan_days = 45
WHERE user_id = 'MUTHU';

No comments: