Archive · 13 February 2012
Debugging EBS API calls in APEX
Written 14 years ago. Oracle APEX has moved on a lot since; check the current Oracle APEX posts too.
![]() |
| This picture comes from Dmitry Vostokov site. |
While I was looking into E-Business Suite and especially the API calls, I wondered how I could debug what was going.
I find it important to understand what I’m doing. EBS is big, but the more I get into it, the more I want to know what is going on (because the more I get into having issues ;-)).
Although I don’t have the time right now to really dive into a detailed EBS-APEX debugging post, I quickly want to share my ideas.
In EBS people tend to use the hr_utility package to trace what is going on. You can do something like :
apps.hr_utility.set_trace_options (‘TRACE_DEST:DBMS_OUTPUT’);
Unfortunately if you don’t have SQL Plus or SQL Developer access to the EBS database and you only have APEX, what do you do? It would be nice if the TRACE_DEST parameter would allow HTP as a value, but it doesn’t.
So here is some pseudo-code I thought would help me to debug from within my APEX app (or SQL Workshop):
BEGIN
if APEX_APPLICATION.G_DEBUG
then
– trace_dest possible values: DBMS_PIPE, DBMS_OUTPUT, PAY_LOG
apps.hr_utility.set_trace_options (‘TRACE_DEST:DBMS_PIPE’);
– set trace on
apps.hr_utility.trace_on;
– do EBS API call
/* EBS api call */
– custom message in EBS trace output
apps.hr_utility.trace(‘Custom message in trace’);
– custom message in APEX debug
apex_debug_message.log_message (
p_message => ‘My message’,
p_enabled => TRUE,
p_level => 5
);
– like to work with Tyler Muth’s logger package
– logger.log(‘if the logger package is installed, another way to log a message’);
– run some other code
/* my custom code */
– set trace off
apps.hr_utility.trace_off;
– log the EBS trace data to APEX or custom table
/* insert the data of the EBS HR Utility PIPE into APEX debug messages */
/* query debug output in a report or in APEX debug view */
end if;
EXCEPTION
WHEN OTHERS
THEN
– store your error in some logging/debugging of the above
– dbms_output.put_line(sqlerrm);
apps.hr_utility.trace_off;
END;
I hope by reading the code you understand what I think would be a good way to debug your EBS code in APEX. I didn’t find the time yet to write an entire EBS-APEX debug package, but maybe some of you already did or if you want to complete the above code, feel free to share it in the comments.
Happy debugging :-)
Previous related posts:
- Updating EBS data from APEX using Triggers and APIs (3)
- Creating EBS data from APEX using APIs (2)
- Updating EBS data from APEX using APIs (1)
- Querying EBS data from APEX using Views
- E-Business Suite and APEX integration (overview)
- E-Business Suite and APEX installation
- APEX and E-Business Suite integration (OBUG event)
Originally published on Blogspot.

Comments
No comments yet. Be the first.