Sunday, December 5, 2010

User Creation Thru API (FND_USER_PKG)



Below is the code to create multiple users and adding responsibilities to them through API
Other way around, you can load users in table and fetch cursor table data in Loop to create users.

declare
v_user_name := 'euser' ;
v_session_id := sid;
/* Pass here sid from this query- SELECT username, sid, serial#, status FROM v$session WHERE username = 'APPS'; */
BEGIN
for i in 1..1000 loop
fnd_user_pkg.createuser
(x_user_name => v_user_name||i
,x_owner => ''
,x_unencrypted_password => 'welcome1'
,x_session_number => v_session_id
,x_start_date => SYSDATE - 10
,x_end_date => SYSDATE + 100
,x_last_logon_date => SYSDATE - 10
,x_description => 'EBS user creation'
,x_password_date => SYSDATE - 10
,x_password_accesses_left => 10000
,x_password_lifespan_accesses => 10000
,x_password_lifespan_days => 10000
,x_email_address => 'user@myemail.com'
,x_fax => ''
,x_customer_id => ''
,x_supplier_id => '');

fnd_user_pkg.addresp
(username => v_user_name||i
,resp_app => 'SYSADMIN'
,resp_key => 'SYSTEM_ADMINISTRATOR'
,security_group => 'STANDARD'
,description => 'Auto Assignment'
,start_date => SYSDATE - 10
,end_date => SYSDATE + 1000);
end loop;
END;
/

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.