Introduction:
In this article we’ll delete concurrent program and executable from backend using API fnd_program.delete_program() in oracle apps r12.
What we’ll demonstrate in this article with a code snippet how to achieve this by giving a clear example.
We all know that we can’t delete concurrent program from the application GUI. because basically it’s prohibited from Oracle. but we have an API to do it from the backend or database.
Goal:
Delete concurrent program and executable from backend using API fnd_program.delete_program() & fnd_program.delete_executable().
Forms Or Pages:
Prerequisites:
No prerequisites to use this API. except the concurrent that we need to delete 🙂
Note:
Deletes a concurrent program. All the references to the concurrent program are also deleted as well (cascaded)
Example:
Delete concurrent program and executable from backend parameters clarification and code snippet
API IN/OUT Parameters :
— IN
— program_short_name IN VARCHAR2 Required
— application IN VARCHAR2 IN VARCHAR2 Required
API Parameters clarifications:
- @param program_short_name The short name used as the developer name of the concurrent program.
- @param application Short Name of the application that owns the concurrent program.
API Calling example:
/*
-- Program name : delete concurrent program and executable from backend using API's
-- Produced for : Oraask.com
-- Creation date : 15-April-2020
*/
DECLARE
-- Internal variables
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) := 'N';
l_del_exec_flag VARCHAR2 (1) := 'N';
BEGIN
--
-- set internal variables with corresponding values
--
l_prog_short_name := 'OSK_TEST'; -- Concurrent program short name
l_exec_short_name := 'OSK_TEST'; -- Executable short name
l_appl_full_name := 'Inventory'; -- Application Full name
l_appl_short_name := 'INV'; -- Application Short name
--
dbms_output.put_line ('***************************');
-- Check if concurrent program exists.or not ?
IF (fnd_program.program_exists (l_prog_short_name, l_appl_short_name)) THEN
-- Check if you want to delete the concurrent or not?
IF (l_del_prog_flag = 'Y') THEN
--
fnd_program.delete_program (l_prog_short_name, l_appl_full_name);
dbms_output.put_line ('Concurrent Program ' || l_prog_short_name || ' deleted successfully');
END IF;
--
ELSE
dbms_output.put_line (' Concurrent program (' || l_prog_short_name || ') is not found, Please make sure that you have passed the correct concurrent name');
END IF;
--
-- Check if executable exists.or not ?
IF (fnd_program.executable_exists (l_exec_short_name, l_appl_short_name)) THEN
-- Check if you want to delete the executable or not?
IF (l_del_exec_flag = 'Y') THEN
--
fnd_program.delete_executable (l_exec_short_name, l_appl_full_name);
dbms_output.put_line ('Executable ' || l_exec_short_name || ' deleted successfully');
END IF;
--
ELSE
dbms_output.put_line (' Executable (' || l_exec_short_name || ') is not found, Please make sure that you have passed the correct executable name');
END IF;
-- Check if delete parameters is No
IF (l_del_exec_flag = 'N'
AND l_del_prog_flag = 'N') THEN
dbms_output.put_line ('Yup, There is no action to take; Please refer to l_del_exec_flag and l_del_prog_flag arguments. at least one of them is: Y');
END IF;
--
dbms_output.put_line ('***************************');
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line ('***************************');
dbms_output.put_line ('There is an exception has been raised while deleting concurrent program from API with error message: ' || sqlerrm);
dbms_output.put_line ('***************************');
END;
We didn’t commit the changes in our code sample, so if you want to commit you have to write the command or commit the changes explicitly from your IDE.
Final Result:
[convertkit form=1415728]In this article, we have demonstrate how to delete concurrent program with executable using API in oracle apps r12 .
Hopefully, it was clear and concise.
Please don’t use this code directly on production environment, instead test on test environment first to make sure that the API is working correctly as per your requirements.
What’s up mates, its wonderful post concerning teachingand
entirely defined, keep it up all the time.