Followers

Monday, February 15, 2016

User Creation from backend For Oracle Apps

DECLARE
   l_user_id   NUMBER;
   l_resp_id   NUMBER;
   l_app_id    NUMBER;
BEGIN
   FND_USER_PKG.CreateUser
                          (x_user_name                       => 'TEST',---Use your user name
                            x_owner                              => NULL,
                            x_unencrypted_password   => 'welcome123',--default passsword
                            x_email_address                 => null);

   SELECT user_id
     INTO l_user_id
     FROM fnd_user
    WHERE user_name = 'TEST'; --Change as per the user name

   SELECT responsibility_id, application_id
     INTO l_resp_id, l_app_id
     FROM fnd_responsibility
    WHERE responsibility_key = 'SYSTEM ADMIN - USER CREATION';

   FND_USER_RESP_GROUPS_API.insert_assignment
                      (user_id                                      => l_user_id,
                       responsibility_id                       => l_resp_id,
                       responsibility_application_id   => l_app_id,
                       security_group_id                     => NULL,
                       start_date                                  => SYSDATE,
                       end_date                                   => NULL,
                       description                                => NULL);

   COMMIT;
EXCEPTION
   WHEN OTHERS THEN
      raise_application_error ( -20001, 'An error was encountered - ' || SQLCODE || ' -ERROR- ' || SQLERRM);

END;

Setup for JTF Grid in Search Eligibility to include new column

1. Go to CRM Administrator Responsibility
2. Go to Spread Table -> MetaData Administration
3. F11 the view you need to add the new column
4. Check the visible check boxes and save.

Query to get the Concurrent Request Details of the Concurrent Program

SELECT DISTINCT fcp.user_concurrent_program_name,
                fcp.concurrent_program_name,
                fcr.request_id,
                fcr.request_date,
                fcr.requested_start_date,
                fcr.actual_start_date,
                fcr.actual_completion_date,
                flv.meaning status,
                fcr.status_code,
                fcr.completion_text,
                fcr.logfile_name,
                fcr.outfile_name,
                fcr.argument_text
           FROM apps.fnd_concurrent_programs_vl fcp,
                apps.fnd_concurrent_requests fcr,
                apps.fnd_lookup_values flv
          WHERE fcr.concurrent_program_id = fcp.concurrent_program_id
            AND flv.lookup_code = fcr.status_code
            AND flv.lookup_type = 'CP_STATUS_CODE'
            AND flv.LANGUAGE = 'US'
            AND (fcp.user_concurrent_program_name) =:p_program_name
       ORDER BY fcr.request_date,
                fcr.request_id DESC;