Tuesday 17 March 2015

Common Utility Procedure for FND_FLIE.LOG and FND_FILE.OUT

PROCEDURE pr_print_debug (p_message IN VARCHAR2, p_write_to IN NUMBER) IS
BEGIN
  -- 1 = LOG, 2 = OUTFILE, 3 = both LOG and OUTFILE
 
  IF p_write_to = 1 THEN
    apps.fnd_file.put_line (apps.fnd_file.log, p_message);
  ELSIF p_write_to = 2 THEN
apps.fnd_file.put_line (apps.fnd_file.output, p_message);
  ELSE
apps.fnd_file.put_line (apps.fnd_file.log, p_message);
apps.fnd_file.put_line (apps.fnd_file.output, p_message);
  END IF;
 
  EXCEPTION
  WHEN OTHERS THEN
    fnd_file.put_line(fnd_file.log, p_Message);
    fnd_file.put_line(fnd_file.log, 'Unable to open/write to the log file with the following error');
    fnd_file.put_line(fnd_file.log,substr(SQLERRM,1,250));
END pr_print_debug;

No comments:

Post a Comment