1

我们正在尝试使用 fnd_user_pkg.UPDATEUSER 更新用户并收到以下错误。从自定义过程调用 API

create or replace procedure change_name as 
begin 

fnd_user_pkg.UPDATEUSER ( 
 x_user_name => 'ALDELEON',
x_owner => 'CUST',
 x_description => 'dragonssss'
);

END;

/

SHOW ERRORS;

SQL> exec change_name
BEGIN change_name; END;

*
ERROR at line 1:
ORA-20001: Unable to update user ALDELEON with userid 5523 for the following
reason: Unabled to call fnd_ldap_wrapper.update_user due to the following
reason:
ORA-20001: Unabled to call fnd_ldap_wrapper.update_user due to the following
reason:
An unexpected error occurred. Please contact your System Administrator.
(USER_NAME=ALDELEON). (USER_NAME=ALDELEON).
ORA-06512: at "APPS.APP_EXCEPTION", line 72
ORA-06512: at "APPS.FND_USER_PKG", line 570
ORA-06512: at "APPS.FND_USER_PKG", line 1811
ORA-06512: at "APPS.CHANGE_NAME", line 4
ORA-06512: at line 1

对于同一用户,当从匿名块调用 fnd_user_pkg.UPDATEUSER 时更新正常

begin 

fnd_user_pkg.UPDATEUSER ( 
 x_user_name => 'ALDELEON',
x_owner => 'CUST',
 x_description => 'dragonssss'
);

END;

请注意,过程和匿名块都是从 APPS 模式调用的。该过程也在APPS模式中编译

知道是否需要进行设置才能从过程中执行 API。

我们在 Oracle Apps R12.2 技术堆栈上

4

1 回答 1

0

请尝试以下代码。用正确的值初始化 user_id、responsibility_id 和 responsiblity_application_id。

create or replace procedure change_name
 as 
  ln_user_id NUMBER := '124';
  ln_resp_id NUMBER := '1234';
   ln_resp_appl_id NUMBER := '12';
begin 

fnd_global.apps_initialize(ln_user_id,ln_resp_id,ln_resp_appl_id);

 fnd_user_pkg.UPDATEUSER ( 
   x_user_name => 'ALDELEON',
   x_owner => 'CUST',
    x_description => 'dragonssss'
   ); 
     commit;

    EXCEPTION WHEN OTHERS THEN

   DBMS_OUTPUT.PUT_LINE ('Error: '|| sqlerrm);

    END; 
于 2018-11-24T07:58:34.223 回答