18 August, 2025

Query to get ORG_ID from Responsibility Name

 SELECT fpov.profile_option_value, fr.*
             FROM applsys.fnd_profile_option_values fpov
                , applsys.fnd_profile_options fpo
                , applsys.fnd_profile_options_tl fpot
                , applsys.fnd_responsibility_tl fr
            WHERE 1 = 1
              AND fpo.profile_option_name = fpot.profile_option_name
              AND fpo.profile_option_id = fpov.profile_option_id
              AND fr.responsibility_id(+) = fpov.level_value
              and fpot.language = 'US'
              and fr.language = 'US'
              AND fpot.profile_option_name = 'ORG_ID'
              and fr.responsibility_name like '%XX%OM%Manager%';

Query to get the profile option details - Oracle EBS

 SELECT fpo.profile_option_name SHORT_NAME,
         fpot.user_profile_option_name NAME,
         DECODE (fpov.level_id,
                 10001, 'Site',
                 10002, 'Application',
                 10003, 'Responsibility',
                 10004, 'User',
                 10005, 'Server',
                 'UnDef')
            LEVEL_SET,
         DECODE (TO_CHAR (fpov.level_id),
                 '10001', '',
                 '10002', fap.application_short_name,
                 '10003', frsp.responsibility_key,
                 '10005', fnod.node_name,
                 '10006', hou.name,
                 '10004', fu.user_name,
                 'UnDef')
            "CONTEXT",
         fpov.profile_option_value VALUE
    FROM fnd_profile_options fpo,
         fnd_profile_option_values fpov,
         fnd_profile_options_tl fpot,
         fnd_user fu,
         fnd_application fap,
         fnd_responsibility frsp,
         fnd_nodes fnod,
         hr_operating_units hou
   WHERE     fpo.profile_option_id = fpov.profile_option_id(+)
         AND fpo.profile_option_name = fpot.profile_option_name
         AND fu.user_id(+) = fpov.level_value
         AND frsp.application_id(+) = fpov.level_value_application_id
         AND frsp.responsibility_id(+) = fpov.level_value
         AND fap.application_id(+) = fpov.level_value
         AND fnod.node_id(+) = fpov.level_value
         AND hou.organization_id(+) = fpov.level_value
         AND upper(fpot.user_profile_option_name) like '%DEFAULT%BUYER%'
ORDER BY short_name; 

Script to delete concurrent program from backend - Oracle EBS

  DECLARE
l_prog_short_name VARCHAR2 (240);
l_exec_short_name VARCHAR2 (240);
l_appl_full_name VARCHAR2 (240);
l_appl_short_name VARCHAR2 (240);
l_del_prog_flag VARCHAR2 (1) := 'Y'; --Set flag whether to delete Concurrent program or not
l_del_exec_flag VARCHAR2 (1) := 'Y'; --Set flag whether to delete executable or not
BEGIN
-- set concurrent program and executable short name
l_prog_short_name := 'XX_SHORT_NAME'; -- Concurrent program short name
l_exec_short_name := 'XX_SHORT_NAME'; -- Executable short name
l_appl_full_name := 'TEXT Custom Application'; -- Application full name
l_appl_short_name := 'TST_TOP'; -- Application Short name
-- Check if the program exists. if found, delete the program
IF fnd_program.program_exists (l_prog_short_name, l_appl_short_name)
AND fnd_program.executable_exists (l_exec_short_name, l_appl_short_name)
THEN
IF l_del_prog_flag = 'Y'
THEN
--API call to delete Concurrent Program
fnd_program.delete_program (l_prog_short_name, l_appl_full_name);
END IF;
IF l_del_exec_flag = 'Y'
THEN
--API call to delete Executable
fnd_program.delete_executable (l_exec_short_name, l_appl_full_name);
END IF;
COMMIT;
--
DBMS_OUTPUT.put_line ('Concurrent Program '||l_prog_short_name || ' deleted successfully');
DBMS_OUTPUT.put_line ('Executable '||l_exec_short_name || ' deleted successfully');
-- if the program does not exist in the system
ELSE
DBMS_OUTPUT.put_line (l_prog_short_name ||' or '||l_exec_short_name|| ' not found');
END IF;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('Error while deleting: ' || SQLERRM);
END;