比如有一个外围支持系统,用户需要在外围系统登录之后点个link就可以登录到Oracle ERP系统中,那么我们需要先把外围系统的用户创建在Oracle ERP中,并且分配职责给他。
DECLARE
a BOOLEAN;
BEGIN
-------------------------------------------------------------
--Change password
-------------------------------------------------------------
/*
a := apps.fnd_user_pkg.changepassword('SIMON','oracle');
IF NOT a THEN
--RAISE_APPLICATION_ERROR(-20002, 'Password not updated');
dbms_output.put_line('Password not updated');
ELSE
dbms_output.put_line('***Password updated');
COMMIT;
END IF;
*/
-------------------------------------------------------------
--Create User
-------------------------------------------------------------
fnd_user_pkg.CreateUser('SIMON',
'SEED',
'PW4567'
);
-------------------------------------------------------------
--Add Resp
--select * from fnd_responsibility fr where fr.responsibility_id =
--select * from fnd_responsibility_tl frt where upper(frt.responsibility_name) like '%%'
--select * from fnd_application fa where fa.application_id =
--select * from fnd_security_groups fs
-------------------------------------------------------------
fnd_user_pkg.AddResp ('SIMON',
'SYSADMIN',
'SYSTEM_ADMINISTRATOR',
'STANDARD',
'Test
API',
sysdate,
null
);
Commit;
End;
--使用下面代码可以在Link中直接登录Oracle ERP系统:
<html>
<head>
<title>iSupport Login</title>
</head>
<body nLoad="document.Login.submit()">
<form. action="http://host:port/OA_HTML/jtfavald.jsp"
method="post" name="Login" id="Login">
<input type="hidden" name="username" value="$UserName$">
<input type="hidden" name="password" value="$Password$">
</form>
</body>
</html>