Articles on Emerging Technologies, Cloud Computing and Cyber Security

Tuesday, March 13, 2018

End Dating Seeded Responsibilities

End dating seeded responsibilities that are not assigned to user, meaning no users are assigned to the responsibility

--Get List of responsibilities

SELECT fr.responsibility_id,
               fr.application_id,
               fr.data_group_application_id,
               fr.data_group_id,
               fr.menu_id,
               fr.web_host_name,
               fr.web_agent_name,
               fr.group_application_id,
               fr.request_group_id,
               fr.responsibility_key,
               frt.responsibility_name,
               frt.description,
               fr.start_date,
               fr.version
          FROM fnd_responsibility_tl frt, fnd_responsibility fr
         WHERE frt.responsibility_name in ('India Local Order Management')
               AND frt.language = 'US'
               AND fr.responsibility_id = frt.responsibility_id;
             
             
--Run Below API to end date responsibility

/* Responsibility End Date */
DECLARE
    CURSOR c1
    IS
        SELECT fr.responsibility_id,
               fr.application_id,
               fr.data_group_application_id,
               fr.data_group_id,
               fr.menu_id,
               fr.web_host_name,
               fr.web_agent_name,
               fr.group_application_id,
               fr.request_group_id,
               fr.responsibility_key,
               frt.responsibility_name,
               frt.description,
               fr.start_date,
               fr.version
          FROM fnd_responsibility_tl frt, fnd_responsibility fr
         WHERE     frt.responsibility_name IN
                       ('India Local Order Management')
               AND frt.language = 'US'
               AND fr.responsibility_id = frt.responsibility_id;
BEGIN
    FOR i IN c1
    LOOP
        BEGIN
            FND_RESPONSIBILITY_PKG.UPDATE_ROW (
                X_RESPONSIBILITY_ID           => i.responsibility_id,
                X_APPLICATION_ID              => i.application_id,
                X_WEB_HOST_NAME               => i.web_host_name,
                X_WEB_AGENT_NAME              => i.web_agent_name,
                X_DATA_GROUP_APPLICATION_ID   => i.data_group_application_id,
                X_DATA_GROUP_ID               => i.data_group_id,
                X_MENU_ID                     => i.menu_id,
                X_START_DATE                  => i.start_date,
                X_END_DATE                    => SYSDATE - 1,
                X_GROUP_APPLICATION_ID        => i.group_application_id,
                X_REQUEST_GROUP_ID            => i.request_group_id,
                X_VERSION                     => i.version,
                X_RESPONSIBILITY_KEY          => i.responsibility_key,
                X_RESPONSIBILITY_NAME         => i.responsibility_name,
                X_DESCRIPTION                 => i.description,
                X_LAST_UPDATE_DATE            => SYSDATE,
                X_LAST_UPDATED_BY             => -1,
                X_LAST_UPDATE_LOGIN           => 0);

            COMMIT;

            DBMS_OUTPUT.put_line (
                i.responsibility_name || ' has been updated !!!');
        EXCEPTION
            WHEN OTHERS
            THEN
                DBMS_OUTPUT.put_line ('Inner Exception: ' || SQLERRM);
        END;
    END LOOP;
EXCEPTION
    WHEN OTHERS
    THEN
        DBMS_OUTPUT.put_line ('Main Exception: ' || SQLERRM);
END;
/

Verify Below Documents and take decision based on usage of applications/modules in your Organization.
What Is The Impact Of Disabling Oracle Seeded Users? (Doc ID 418767.1)
Is it Safe To End Date Some Applications Users like GUEST (Doc ID 783428.1)
End Dating Seeded Responsibilities (Doc ID 390448.1)

0 Comments: