Apps To Fusion

.......Our Journey from Apps To Fusion

 
  • Increase font size
  • Default font size
  • Decrease font size



FND Logging - Session/Procedure/Function specific

E-mail
User Rating: / 0
PoorBest 

In some rare circumstances, for example, if you are debugging an issue, you may need to manually initialize the PL/SQL layer logging for the current session. From the SQL*Prompt, you could do this by calling:

FND_GLOBAL.APPS_INITIALIZE(fnd_user_id, fnd_resp_id, fnd_appl_id);
fnd_profile.put('AFLOG_ENABLED', 'Y');
fnd_profile.put('AFLOG_MODULE', '%');
fnd_profile.put('AFLOG_LEVEL','1');
fnd_log_repository.init;


Profile Option Name User Specified Name Sample Value
AFLOG_ENABLED FND: Debug Log Enabled "Y"
AFLOG_MODULE FND: Debug Log Module "%"
AFLOG_LEVEL FND: Debug Log Level "ERROR"
-- Use the following values:
-- 1 - STATEMENT
-- 2 - PROCEDURE
-- 3 - EVENT
-- 4 - EXCEPTION
-- 5 - ERROR
-- 6 - UNEXPECTED

If you want to enable the FND Logging for a given procedure or function. Do the following:

 

1. Set the user profile options for FND:Debug Log enabled to "N". This ensures that apps itself would not do any sort of logging.

2. Go ahead and put the code above in the procedure that you want to log(ideally at the beginning of the procedure).

3. After the procedure call the same code while setting the profile option AFLOG_ENABLED to "N".

 

This way you can get specific log for just one procedure and saves you the effort of going through tons of log messages.

Comments (7)add
...
written by Praveen , April 18, 2008
Hi Arun,

Thanks For the Info.

Can you Please Give me sample Example as soon as Possible as I am trying to Debug a Standard GL API. And unable to do that.

Do we need to use FND_LOG.string in the code.

Regards,
Praveen


report abuse
vote down
vote up
Votes: +1
...
written by Arun Sista , April 20, 2008
Hi Praveen,

Can you please tell me what you have done so far?

Thanks,
Arun.
report abuse
vote down
vote up
Votes: +1
...
written by Praveen , April 21, 2008
Hi Arun,

Thanks for the response.

I am Trying to Dynamically Create a Code Combination. Some of the Combinations were getting Created and some not. So wanted to use
Debugging So that it will be easier at what point of code the Process is failing to create combination.

Please let me know How to Debug standard API's.

Below is the Code Which I have used:

DECLARE
v_user_id NUMBER := &1;
v_responsibility_id NUMBER := &2;
v_application_id NUMBER := &3;
v_concat_segs VARCHAR2(100) := '&4';
v_keyval_status BOOLEAN;
l_coa_id NUMBER;
BEGIN
APPS.FND_GLOBAL.APPS_INITIALIZE(v_user_id, v_responsibility_id, v_application_id);
fnd_profile.put('AFLOG_ENABLED', 'Y');
fnd_profile.put('AFLOG_MODULE', '%');
fnd_profile.put('AFLOG_LEVEL','1');
fnd_log_repository.init;

begin
select chart_of_accounts_id
into l_coa_id
from gl_sets_of_books
where set_of_books_id = fnd_profile.value('GL_SET_OF_BKS_ID');
exception
when OTHERS then
DBMS_OUTPUT.PUT_LINE('Error: Chart of Accounts ID not found' || SUBSTR(SQLERRM,1,200));
end;

BEGIN
v_keyval_status := fnd_flex_keyval.validate_segs(
'CREATE_COMBINATION',
'SQLGL',
'GL#',
l_coa_id,
v_concat_segs, -- Concatenated Segment which has to be created
'V',
sysdate,
'ALL', NULL, NULL, NULL, NULL,
FALSE,FALSE,v_application_id,v_responsibility_id,v_user _id,
NULL,NULL,NULL);
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Error: Unable to Create Code Combination: ' || SUBSTR(SQLERRM,1,200));
END;

EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Main Error: ' || SUBSTR(SQLERRM,1,200));
END;


report abuse
vote down
vote up
Votes: -1
...
written by Arun Sista , April 21, 2008
Ha... i'm not sure if there is a shortcut to it. However what you can try is :

Take the value of selct max(log_sequence) from fnd_log_messages

before running ur code. Make a not of this value call it val1.

Then run your code.

And again take the value of selct max(log_sequence) from fnd_log_messages
after running ur code.

Call this val2.

Now select * from fnd_log_messages where log_sequence between val1 and val2.

If this gives u a hint (provided there is logging in the flexfield api's) you'd figure out.

Or else you might need to take a trace and try to debug using that.

Hope this helps.

Arun.
report abuse
vote down
vote up
Votes: +0
...
written by kishor nagbhire , December 09, 2008
hi SHIVA
i'm a new user of ur site
can u help me on that topic
i want record in GL

'''''' undefined accounting periods in the current accounting calendar '''''''''''

help me
thanks
report abuse
vote down
vote up
Votes: +0
Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
smile
wink
laugh
grin
angry
sad
shocked
cool
tongue
kiss
cry
smaller | bigger

security image
Write the displayed characters


busy
Last Updated ( Wednesday, 09 April 2008 20:12 )  

Search apps2fusion