add

About Me

My photo
Oracle Apps - Techno Functional consultant

Tuesday, June 21

KFF (Key fLex Fields)

KFF will be used to Capture the Key Information in code language for every code
there will be specific meaning in the application.

For Ex: we can find some of the fileds like follows

Code Combination 01-001-1540-1234-0000

01-Operations
001-HRMS
1540-Furniture
1234-Sales Account
0000-No Product

Description : Operations-HRMS-Furniture-Sales Account-No Prodcut

like this we can find the meaning in the application for every code.

We will use the Segment Columns to Capture the KFF Data.
We can find the Segment coumns in most of the Tables like
SEGMENT1,SEGMENT2,SEGMENT3,..........SEGMENT30.

Diff Between DFF and KFF

DFF KFF
----- ---
1)DFF Will be used to capture the Extra 1)KFF will be used to Capture the Key
Information. Information

2)ATTRIBUTE Columns will be used 2)SEGMENT columns will be used

3)We can have max DFF in the Application 3)We have 30KFF already defined by Oracle
there is no Limit we can customize existing KFF. We are not
suppose to define the new KFF. We will not
get support from Oracle.

4)In DFF we will Context Field to define 4)In KFF we will define Structure Column
Multiple Strutures to define the Multiple Structures.

=================================================================

P_FLEXDATA: Is a Lexical parameter will be used to store the default
value as concatenation of all the segment columns.
This is required because if client changes the segment structure
from front end again we have to change all the structure.
instead of that we can concatenate all the segments.

lexical parameter means datatype :char width : min 600

p_struct_num:
It will be used to store the kff structure number which is required
if KFF is having the multiple structures.
Ex: 101 default value

FNDFLEXSQL:
----------
This is One of the User exit will be used to retrive the segment
values from database and will be used in the before report trigger
Parameters:
CODE -KFF Code
num -KFF structure Number
appl_short_name -KFF Application ShortName
OutpuT -Lexical parameter Name
Display -Display all the segments
Mode -'SELECT'

FNDFLEXIDVAL:
-----------
This user exit we will define inside of the formuls column to display
the data in the layout.
define the formula column call the user exit with follwoing parameters
Parameters:
CODE -KFF Code
num -KFF structure Number
appl_short_name -KFF Application ShortName
OutpuT -Lexical parameter Name
Display -Display all the segments
Mode -'SELECT'
data -Lexical Parameter Name
Value -Formula Column Name

Note :
To Display the KFF description we will define one more formula column
and we will call again 'FND FLEXIDVAL' user exit with parameter called
'Description' instead of 'Value' Parameter.

=============================================
1)Call the user ext from before report trigger
SRW.USER_EXIT('FND SRWINIT');

2)Call Another User Exit from After Report Trigger
SRW.USER_EXIT('FND SRWEXIT');

3)Define the following parameters 1)P_CONC_REQUEST_ID
2)P_FLEXDATA
3)P_STRUCT_NUM

4)Call another User exit from before report trigger

SRW.USER_EXIT('FND FLEXSQL');

5)Define the Quiery like follows
SELECT
&P_FLEXDATA
FROM
KFF Table
WHERE KFF Structure Column = :P_STRUCT_NUM;

6)Define Formula COlumn and CALL another User Exit from formula column
SRW.USER_EXIT('FND FLEXIDVAL');

1)P_FLEXDATA : It is a Lexical parameter we are suppose to define to hold the default
value combnation of all the segment columns.
we will use this Parameter in the SELECT clause becuase client may change the
structure from the front end any time that time we do not need to chage the report
query every time if we use all the segments concatination.
Datatype : Character
Width : min 600
Default value : (GCC.SEGMENT1||'\n'||GCC.SEGMENT2||'\n'||GCC.SEGMENT3......)

2)P_STRUCT_NUM :
We will capture the KFF structure number here. if KFF is having multiple structures
default : 101

3)Call the User Exit from Before Report trigger called FND FLEXSQL
which will populate the segment columns in the SELECT clause according to that data
will be selected from database.
Syntax:
SRW.REFERENCE(:P_STRUCT_NUM);
SRW.USER_EXIT('FND SRWINIT');
SRW.USER_EXIT('FND FLEXSQL
CODE = "GL#"
APPL_SHORT_NAME = "SQLGL"
NUM = ":P_STRUCT_NUM"
OUTPUT = ":P_FLEXDATA"
MODE = "SELECT"
DISPLAY = "ALL" ');
return (TRUE);


SRW.Reference: This Will be used to refer the Bind variables or Source columns which
we are using in the User Exit.to make sure that we will get the Updated value
from the Variable and source column.

4)Call another User Exit from the Formula Column called FND FLEXIDVAL

SRW.REFERENCE(:P_STRUCT_NUM);
SRW.REFERENCE(:C_FLEXDATA);
SRW.USER_EXIT('FND FLEXIDVAL
CODE = "GL#"
APPL_SHORT_NAME = "SQLGL"
NUM = ":P_STRUCT_NUM"
DATA = ":C_FLEXDATA"
VALUE = ":CF_KFF"
MODE = "SELECT"
DISPLAY = "ALL"
IDISPLAY = "ALL" ');
RETURN(:CF_KFF);

Change the Structure Number Dynamically :
==========================================

1)if we know Whcih set of Book user is using then we can find out the structure
number(CHART_OF_ACCOUNTS_ID)
2)Goto Before Report Trigger define local variable and retrive the SOB name into the
variable by using Profile API.

l_name:=fnd_Profile.Value('GL_SET_OF_BKS_NAME');

3)Write the following SELECT statement to findout the Structure number based on the
SOB name.

SELECT CHART_OF_ACCOUNTS_ID
INTO :P_STRUCT_NUM
FROM GL_SETS_OF_BOOKS
WHERE NAME = l_name;
SRW.REFERENCE(:P_STRUCT_NUM);

==============================================================

No comments: