Tuesday, July 19, 2016

Add Responsibility/End-date User through API in R12

How to End-date user & Add Responsibility through API:


Applications users cannot be deleted since records belonging to users are kept for security and monitoring purposes. In addition, the user is recorded in Who columns, so deleting would cause foreign table data integrity problems. Instead, set "End Date" for that user.

Also same for the responsibility. We cannot delete a responsibility. We can only end-date a responsibility.

So Users and responsibilities cannot be deleted, instead you should end-date it.
For menus, functions, custom applications, it is to delete them -- Navigate to the form, query the record, and click on the delete button (or Edit > Delete).

There is no API or scripts to delete user accounts in FND_USER. Deletion of an an e-business suite user account is not possible and not supported.

API To End-Date FND_USER:



begin
fnd_user_pkg.updateuser(x_user_name=>'RJAY',x_owner=>'CUST',x_end_date=>SYSDATE-5);
commit;
end;
/


x_owner can be either SEED or CUST:
To end date seeded users (i.e. sysadmin) x_owner= SEED
To end date custom users x_owner = CUST


API To add responsibility:



-- ---------------------------------------------------------- 
-- Add Responsibility to Oracle FND User 
-- ----------------------------------------------------------- 
DECLARE 
    lc_user_name                        VARCHAR2(100)    := 'RJAY'; 
    lc_resp_appl_short_name   VARCHAR2(100)    := 'SYSADMIN'; 
    lc_responsibility_key          VARCHAR2(100)    := 'SYSTEM_ADMINISTRATOR'; 
    lc_security_group_key        VARCHAR2(100)    := 'STANDARD'; 
    ld_resp_end_date                 DATE                        := NULL; 

BEGIN 
     fnd_user_pkg.addresp 
     (   username           => lc_user_name, 
        resp_app             => lc_resp_appl_short_name, 
        resp_key             => lc_responsibility_key, 
        security_group  => lc_security_group_key, 
        description         => NULL, 
        start_date           => SYSDATE-10, 
        end_date            => ld_resp_end_date 
    );

 COMMIT; 

EXCEPTION 
            WHEN OTHERS THEN 
                        ROLLBACK; 
                        DBMS_OUTPUT.PUT_LINE(SQLERRM); 
END; 
/

SHOW ERR;



No comments:

Post a Comment

How to Compile Forms , Reports & Custom.pll in R12.2

How to Compile Custom.pll   cd $AU_TOP/resource  cp CUSTOM.plx CUSTOM.plx_bkup  cp CUSTOM.pll CUSTOM.pll_bkup  frmcmp_batch module=CUSTOM.pl...