Write message in Log or Out file

on Thursday, February 26, 2009

PROCEDURE write(p_type IN VARCHAR2, p_message IN VARCHAR2)IS
/************************************************************************
Purpose : Procedure writes to the log file or output file based on type.
O=Output File, L=Log File
*************************************************************************/
BEGIN
IF p_type = 'L' THEN
fnd_file.put_line (fnd_file.log, p_message);
ELSIF p_type = 'O' THEN
fnd_file.put_line (fnd_file.output, p_message);
END IF;
END write;
The above write procedure can be used in other Procedure/Function in the package to write any information in the Log or Out files.
PROCEDURE main(errbuf OUT VARCHAR2, retcode OUT NUMBER, p_par1 IN NUMBER)
IS
v_errbuf VARCHAR2(1000) := NULL;
v_retcode NUMBER := 0;
v_file_name VARCHAR2(100);
BEGIN
v_retcode := 0;
v_file_name := fnd_profile.value('XYZ');
IF v_file_name IS NULL THEN
write('O','Profile XYZ is not defined or the value is not set');
retcode := 2;
RETURN;
END IF;
END;
Note:- In the above Procedure, I am using the write Procedure and returning 2 for the retcode (0 - Complete, 1- Warning and 2 will be for Error).
This is one time process and you will realise, how much helpful it will be when ever you have to right something in log or out file.

Overview of Auto Invoice

on Saturday, February 21, 2009


AutoInvoice is a program which is used to import and validate transaction data
from other financial systems from which one can create


  • INVOICES
  • DEBIT MEMOS
  • CREDIT MEMOS
  • ON-ACCOUNT CREDITS

Features of Auto Invoice Program

Supports Oracle & Non-Oracle Systems
Import Large Amount of Data
Calculate or Import Tax
Group Lines & Invoices
Online Error Correction
Lines Validation
Derive GL Date
Import Flex fields

AutoInvoice is a program set consists of 3 main programs. Each program will have unique nature of work to do and they are called internally except Purge program whose execution is derived on the setup otherwise ready to execute stand alone.

Master (RAXMTR)
Import (RAXTRX)
Purge (RAXDEL)

Auto Invoice Master program RAXMTR

Selects and marks records in the interface tables to be processed based on the parameters the user entered and then calls the AutoInvoice Import program. Auto Invoice Master program has no report output.

• Gathers statistics, it means it gathers the stats on interface tables and set the stats on certain indices on interface tables
• Marks interface records for processing by marking request_id
• Submits multiple workers for Parallel Processing by creating instances for request.

Auto Invoice Import Program

Validates the selected record and creates transaction if it passes validation. Any record that fails validation is left in the interface table with an error code. Depending on the setup, related records may be rejected as well. This program has an output file called Auto Invoice Execution report, which we can view by clicking the View Report button in the Requests window. Working of Auto invoice , Validates data, Inserts records, Deletes interface data Only when system option purge set to ‘Y’

Auto Invoice Purge Program

Deletes records from the interface tables. If you set the Purge Interface Table system option to No in Define System Option window, Auto Invoice does not delete processed records from the interface tables after each run, and we must submit Auto Invoice Purge Program periodically to clean up the interface tables. This program only deletes transaction lines that have been successfully imported. Deletes all rows where interface_status =‘P’

• Ra_interface_lines
• Ra_interface_distributions
• Ra_interface_salescredits

Oracle Receivable’s Auto Invoice program will be used to import and validate Invoices. A custom feeder program is required to transfer data
from the Advantage extract files and populate the Auto Invoice interface tables (RA_INTERFACE_LINES_ALL and RA_INTERFACE_DISTRIBUTIONS_ALL).
If there is need to run populate sales credit into RA_INTERFACE_SALESCREDITS_ALL table. When run, AutoInvoice produces the AutoInvoice Execution Report and the AutoInvoice Validation Report. Any entries which failed validation can be reviewed in Oracle Receivables’ AutoInvoice Interface Exceptions window. Depending on the error, changes may need to be made in Receivables, the feeder program or the imported records in the interface tables.

How Autoinvoice Execution works

Normally, Auto Invoice can be divided into three major phases,

Pre-grouping : here the validates all of the line level data takes place
Grouping : groups lines based on the grouping rules and validates header level data
Transfer : validates information that exists in Receivables tables

What happen when AutoInvoice run?

Once the Auto invoice Program gets called, the following activity takes place is part of execution process. This can be analyzed by debug options. Line, accounting, and sales credit information for each line populates three interface tablesLines are ordered and groupedTax is calculatedGL date is determinedGL accounts are assigned using Auto AccountingTax, freight, commitments, and credit memos are linked to transaction linesAll transactions are batchedValidated lines are used to create the transaction.

Flow of Data

Select, insert and update and delete take place on certain tables once it is logged out.

Selects
– RA_INTERFACE_LINES_ALL
– RA_INTERFACE_DISTRIBUTIONS_ALL
– RA_INTERFACE_SALESCREDITS_ALL

Updates/Insert
– RA_INTERFACE_ERRORS_ALL
– RA_CUSTOMER_TRX_ALL
– RA_CUSTOMER_TRX_LINES_ALL
– AR_PAYMENT_SCHEDULES_ALL
– AR_RECEIVABLE_APPLICATIONS_ALL


Inserts
– RA_INTERFACE_ERRORS_ALL


AutoInvoice Exception Handling

Records that fail validation are called ‘Exceptions’. Exceptions stay in Interface Tables which is RA_INTERFACE_ERRORS_ALL. Errors can be corrected in the Exception Handling window. Once corrections are made, Auto invoice must be resubmitted. Records that pass validation get transferred to Receivables tables

AutoInvoice Exception Handling Windows

-Interface Exception window displays exception messages associated with all invalid records
-Interface Lines window displays records that fail validation, provides an error message and can be used to correct the errors

-The Line Errors windows displays errors associated with a specific line, and can only be opened from Interface Lines window
-Interface Exceptions window displays Interface Id, Exception Type, Error Message and Invalid Value associated to the error
-Data cannot be edited in this window, but error can be viewed and corrected by clicking the Details button
-Error Message and Column name with invalid data are displayed in the Message column, and the invalid value that needs to be corrected is displayed in the Invalid Value column

Compiling JSP Pages in APPS

on Wednesday, February 18, 2009

Step 1 - Copy the jsp file to $COMMON_TOP/webapps/oacore/html
(this location translates to $OA_HTML).

Placing the file under $OA_HTML enables end users to access the file
using the url
http://hostname.domain:port/OA_HTML/[jspfile.jsp]
Step 2 - export PATH=$PATH:$FND_TOP/patch/115/bin
Step 3 - ojspCompile.pl -compile -s ‘[jspfile.jsp]‘

There is no need to bounce apache server after compiling the file to access the new content.

Below is the command line help for ojspCompile.pl command
ojspCompile.jsp command help
syntax: ./ojspCompile.pl COMMAND {ARGS}COMMAND
– compile update dependency, compile delta
– create rebuild entire dependency file
– delta.out update dependency, list delta to file
– dep.out update dependency, output heirarchy to file

ARGS -s matching condition for JSPs filenames
– p number of parallel compilations- log to override logfile from ojspCompile.conf
It is recommended to set the log file location outside of any network file system shared (NFS) area/drive.
– conf to override ojspCompile.conf– retry retry previously failed compilation attempts
– flush forces recompilation of all parent JSPs
– quiet do not provide an actively running progress meter
– fast instantly fail jsps that are *possibly* invalid
example1 : ojspCompile.pl –compile -s ‘jtf%’ -p 20 –retry
example2 : ojspCompile.pl –compile -s ‘jtflogin.jsp,jtfavald.jsp’ –flush
example3 : ojspCompile.pl –compile –fast –quiet