Friday 22 February 2013

Rename file in UNIX before Copy File.

The below function is used to rename the existing file before checking in the directory. 
For the first time it will copy and from second time onwords it will rename with SYSDATE.



function COPYFILE
{
    [[ -f "$2/$1" ]] && mv "$2/$1" "$2/$1".$(date '+%d%m%Y')
    cp "$1" "$2"



COPYFILE XYZ.rdf  $AR_TOP/reports/US

How to use Flexfield in XML/BI Publisher reports

There are four types of key flexfield-related lexicals as follows:
  • oracle.apps.fnd.flex.kff.segments_metadata
  • oracle.apps.fnd.flex.kff.select
  • oracle.apps.fnd.flex.kff.where
  • oracle.apps.fnd.flex.kff.order_by

    The attributes for this lexical are listed in the following table:
    AttributeDescription
    application_short_name(Required) The application short name of the key flexfield. For example: SQLGL.
    id_flex_code(Required) the internal code of the key flexfield. For example: GL#
    id_flex_num(Conditionally required) Internal number of the key flexfield structure. For example: 101. Required if MULTIPLE_ID_FLEX_NUM is "N".
    code_combination_table_alias(Optional) Segment column names will be prepended with this alias.
    segments(Optional) Identifies for which segments this data is requested. Default value is "ALL". See the Oracle Applications Developer's Guide for syntax.
    operator(Required) Valid values are:
    =, <, >, <=, >=, !=, <>, ||, BETWEEN, LIKE
    operand1(Required) Values to be used on the right side of the conditional operator.
    operand2(Optional) High value for the BETWEEN operator.
    full_descriptionSegment value's description (full size).
    securityReturns Y if the current combination is secured against the current user, N otherwise.
    This example shows a filter based on the GL Account segment and the GL Balancing Segment:

    SELECT <some columns>
         FROM gl_code_combinations gcc,
              some_other_gl_table sogt
        WHERE gcc.chart_of_accounts_id = :p_id_flex_num
          and sogt.code_combination_id = gcc.code_combination_id
          and &FLEX_WHERE_GL_BALANCING
          and <more conditions on sogt>
    
    
    <lexicals>
         <lexical
          type="oracle.apps.fnd.flex.kff.where"
          name="FLEX_WHERE_GL_BALANCING"
          comment="Comment"
          application_short_name="SQLGL"
          id_flex_code="GL#"
          id_flex_num=":P_ID_FLEX_NUM"
          code_combination_table_alias="gcc"
          segments="GL_BALANCING"
          operator="BETWEEN"
          operand1=":P_GL_BALANCING_LOW"
          operand2=":P_GL_BALANCING_HIGH"/>
    </lexicals>