Skip to main content

How to End Date a Responsibility using API

We can end date a responsibility which is already assigned to all users / for a single user using the API fnd_user_pkg.delresp


DECLARE
   v_user_name                   VARCHAR2 (100) := NULL;
   v_application_name        VARCHAR2 (100) := NULL;
   v_responsibility_key        VARCHAR2 (100) := NULL;
   v_security_group              VARCHAR2 (100) := NULL;

CURSOR xx_iexpenses_cursor
IS
SELECT     
       fu.user_name,
       fa.application_short_name,
       frv.responsibility_key,
       (select security_group_key from
       apps.fnd_security_groups fsg
       where fsg.security_group_id = furgd.security_group_id) Security_Group
FROM apps.fnd_user fu,
  apps.fnd_user_resp_groups_direct furgd,
  apps.fnd_responsibility_vl frv,
  apps. fnd_application fa
WHERE fu.user_id = furgd.user_id
AND fa.application_id = frv.application_id
AND furgd.responsibility_id          = frv.responsibility_id
AND furgd.end_date                  IS NULL
AND furgd.start_date                <= sysdate
AND NVL(furgd.end_date, sysdate + 1) > sysdate
AND fu.start_date                   <= sysdate
AND NVL(fu.end_date, sysdate + 1)    > sysdate
AND frv.start_date     <= sysdate
--AND fu.user_name = 'XX12345'
AND frv.responsibility_name like 'XX%Internet%Expenses';

     l_xx_iexpenses_rec   xx_iexpenses_cursor%ROWTYPE;

BEGIN
OPEN xx_iexpenses_cursor;
LOOP
FETCH xx_iexpenses_cursor into v_user_name, v_application_name,v_responsibility_key, v_security_group ;
EXIT WHEN xx_iexpenses_cursor%NOTFOUND;

DBMS_OUTPUT.put_line (v_user_name);
DBMS_OUTPUT.put_line (v_application_name);
DBMS_OUTPUT.put_line (v_responsibility_key);
DBMS_OUTPUT.put_line (v_security_group);
        
      fnd_user_pkg.delresp
      (    username           => v_user_name,
           resp_app            => v_application_name,
           resp_key             => v_responsibility_key, 
           security_group      => v_security_group 
      );

END LOOP;

COMMIT;

CLOSE xx_iexpenses_cursor;
END;

Comments

Popular posts from this blog

How To Enable / Disable Forms Personalization Option

Forms Personalization gives great flexibility to execute custom business logic without performing so much of technical work. To start forms personalization navigate to Help -> Diagnostics -> Custom Code -> Personalize But many time when we click on personalize it give below error  " Function is not available for this respnosibility. Change responsibilities or contact your System Administrator " To Enable access to forms personalization function we need to set below profile option.  -  Utilities:Diagnostics -> Yes / No It determines the diagnostics option is enabled for a user / responsibility or site, depending on the level profile option is set. Navigate to System Administrator -> Profile -> System Query for your user / responsibility for which you want to provide access. Set the value to 'Yes' , If you want allow access to forms personalization Since we change the profile option please change the respons...

Query to find Operating Unit, Business Group and Legal Entity Information

SELECT   DISTINCT   hrl . country ,                  hroutl_bg . name              bg ,                  hroutl_bg . organization_id ,                  lep . legal_entity_id ,                  lep . name                    legal_entity ,                  hroutl_ou . name              ou_name ,               ...

Oracle Purchasing – Receipt Accounting

Oracle Purchasing – Receipt Accounting (Accrue On Receipt and Accrue at Period End) Inventory Accruals: Inventory and Purchasing provides visibility and control of accrued liabilities for inventory items. Purchasing automatically records the accrued liability for the inventory items at the time of receipt. This transaction is automatically recorded in the general ledger at the time of receipt. The inventory expense is recorded at delivery if Standard Delivery is used and at receipt if Direct Delivery used. Expense Accruals: Purchasing optionally accrues un-invoiced receipts of non-inventory items when a period is closed. Purchasing automatically creates a balanced journal entry for each receipt un-invoiced at period end which can be reversed at the beginning of the next period. Navigation: India Local Purchasing > Oracle Purchasing > Setup > Organizations > Purchasing Options Difference between 'Accrue On Receipt' and 'Accrue at Per...