How to use lexical parameters in Data template (XML document) R12


Lexical parameters can be added in data definition using &variable name

This is flexible variable string where you can execute runtime conditions based on user-inputs

Example

1. Append &gc_journal_filter at the end of sql statement

2. Define beforereport function in package signature

FUNCTION beforereport RETURN BOOLEAN;

3. Define all the report parameters as a package variable in package signature including lexical parameters

4. Implement beforereport function by building your runtime conditions to be added to SQL statements


 FUNCTION beforereport RETURN BOOLEAN IS
 BEGIN
    
    IF p_journal_source IS NULL THEN
      gc_journal_filter := ' AND jh.je_source IN (''AutoCopy'',''Manual'')';
    END IF;
    
    IF p_journal_category IS NULL THEN
      gc_journal_filter := 'AND jh.je_category IN (''Other'') ';
    END IF;
   RETURN TRUE;
 END;

Comments

Popular posts from this blog

Query to get FSG report details with row/column set

Sub Inventory Transfer API.