Home › Discussions › Questions & Answers › PL/SQL API: Initializing a Report Run ID
PL/SQL API: Initializing a Report Run ID
Customer · · Questions & Answers · 7 replies
I am preparing a custom PL/SQL procedure to execute a Blitz Report (`AP Suppliers`). What is the first required API call to initialize the environment and identify the specific report instance before setting any parameters?
7 replies
The absolute first step for any programmatic execution is to initialize the application context using `XXEN_REPORT.APPS_INITIALIZE`, passing the User Name, Responsibility Key, and Responsibility Application Short Code , , . Subsequently, you must create a unique instance identifier by calling `XXEN_API.CREATE_RUN_ID_`, passing the report name (e.g., `’AP Suppliers’`) . This function returns the essential `l_run_id`, which links all subsequent parameter and runtime option settings to this specific execution instance .
Once I have the Run ID, how do I set the parameter values, like setting the ‘Operating Unit’ to ‘Vision Operations’?
After obtaining the `l_run_id`, you use the procedure `XXEN_API.SET_PARAMETER_VALUE_` . This procedure is name-based, accepting the `p_parameter_name`, the `p_value` (the value to be passed), and the unique `p_run_id` . For example: `xxen_api.set_parameter_value_(p_parameter_name=>’Operating Unit’, p_value=>’Vision Operations’, p_run_id=>l_run_id)` , .
The documentation mentions that `XXEN_API.CREATE_RUN_ID_` can be called either by ID or by name. When should I use the ID instead of the report name?
Both the `create_run_id_` and `set_parameter_value_` procedures support referencing objects by either their internal ID or their name , . Using the internal ID (e.g., `p_report_id` instead of `p_report_name`) is typically more robust in scenarios where report names might change or if your custom code already derives the internal report ID from a lookup table.
If I am using the `FND_REQUEST.SUBMIT_REQUEST` API, do I still need to initialize the environment with `XXEN_REPORT.APPS_INITIALIZE`?
Yes, even when using the standard `fnd_request.submit_request` API to launch the Blitz Report concurrent program (`XXEN_REPORT`), the environment must be properly initialized . The call to `XXEN_REPORT.APPS_INITIALIZE` ensures the correct user, responsibility, and application context are established before the request is submitted , .
- You must be logged in to reply to this post.
Sign in with LinkedIn or Google to take part.