Tuesday, May 6, 2008

KFF and DFF

Steps Involved :
1. Registering A Tables & Columns :
Register the Table & Columns if the KFF/DFF is on User Defined Table. The following is the
example
AD_DD.register_table('AR','RAJ_KFF_TEST','T',8,10,90);
ad_dd.register_column('AR','RAJ_KFF_TEST','Attribute_category',1,'Varchar2',20,'N','N');
ad_dd.register_column('AR','RAJ_KFF_TEST','CCID',2,'NUMBER',10,'N’,'N');
ad_dd.register_column('AR','RAJ_KFF_TEST','attribute1',3,'VARCHAR2',20,'N','N');
For a KFF ....
It is necessary to have a column to store CCID and a column to Store Structure Information In the above example the Attribute_category is used to store Structure Info.
and CCID to store ccid number. These are specified at Registration of the Flexflied.
For A DFF...
It is enough to store only the Structure Info.
Example the Attribute_category may act as an Structure Field.
2. Registering The FlexFiled :
After creating the table and registering it, register the FlexField You You want to Use.
Remember : U have to Use this name when referencing the flexfield.
Also u have to specify the CCID column & Structure Column for KFF here.
Remember : U have to enable the columns of the table here, otherwise u can't define segments for the same.
3. Defining the Segments :
Every Flexfiled must have Segment Qualifiers And FlexField columns these are defined in the AOL
at Segment Definition.
After defining these segments freeze and compile the flexfield segments definition.
These 3 steps complete the process of Registration of table and flexfield & definition of Segments.
Some Finer Points :
1. You have to check the Dynamic Insertion Allowed ( for KFF only) to allow the users to dynamically create
an intelligent combination key.
2. You can check the Protect check box to ensure that users do not change the definition of flexfield by mistake.
Incorporating DFF's / KFF's in the forms :
The whole process essentially requires 4 steps ....
1. Modify 7 triggers
2. Create Hidden Fields corresponding to the segments
3. Define the FlexField in the New-Form-Instance-Trigger
4. Set the Profile Options ( Flex:Open_Descr_Window , Flex:Open-Key_Window ) to YES

Generic Activities to Open A Form In Apps ....
You have to go through some steps to enable a form in Apps.
1. Open your Template.fmb ( this is provided by Oracle-Apps) .
2. Delete the BLOCKNAME ( datablock , canvas , window ) from the Template.fmb
3. Save this form Module with ur custom name.
4. Create A Canvas , subclass it with Profile class Canvas
5. Similary create a Window ( subclass it with Window profile class) , Datablock.
6. Modify the APPS_CUSTOM package body with following code....
if (wnd = '') then
app_window.close_first_window;
Give your name of Window at the Bolded place.
7. Modify The pre-form trigger as follows..
app_window.set_window_position('BLOCKNAME', 'FIRST_WINDOW');
Give Your block name here at the bolded place.
Now modify the required triggers for implementing the DFF's and KFF's .......
1. The Following triggers should be change...
a. When-new-form-instance
b. pre-query
c. post-query
d. WHEN-NEW-ITEM-INSTANCE
e. PRE-UPDATE
f. WHEN-VALIDATE-RECORD
g. WHEN-VALIDATE-ITEM
add FND_FLEX.EVENT('EVENT NAME') where EVENT NAME is the trigger name itself.
eg. FND_FLEX.EVENT('WHEN-VALIDATE-ITEM');
2. Create Hidden Fields ( Set Canvas to null) . These should be as many as the number of segments u defined .
3. Define Your flex-filed at the New-Form-Instance trigger as follows ...
FND_KEY_FLEX.DEFINE(BLOCK=>'FLEX_BLOCK',FIELD=>'KFF_SEGS',APPL_SHORT_NAME=>'AR', DESC_FLEX_NAME=>'DFF_FLEX')
for DFF....
Block - is the block name in the form
Field - Field which is acting as DFF/KFF
Appl_Short_name :- AR/ AP / CS etc.,
Desc_FLEX_NAME :- Name of the Flex Filed U have given at the time of Registration.
For KFF.....
CODE - the number u give at the time of registering ur KFF
NUM - Use the following SQL to get the number . ( default is 101 )
SELECT ID_FLEX_NUM FROM FND_ID_FLEX_STRUCTURES WHERE ID_FLEX_CODE='CODE';
4. Create a TEXT-FIELD to act as DFF or KFF
For DFF subclass it with ....
TEXT_ITEM_DESC_FLEX
For Kff subclass it with ...
TEXT_ITEM itself
5. Save ur work and
attach this form to a function
Function to a menu.
That's all....
Good Luck !! Happy Experimenting...

1 comment:

Unknown said...
This comment has been removed by the author.