Thursday, December 4, 2008

KEY FLEX FIELDS(KFF), DESC FLEX FIELDS(DFF)


QUERY TO RETRIEVE KFF'S IN ORACLE E BUSINESS SUITE :

SELECT COUNT(*), FAT.APPLICATION_NAME
FROM FND_ID_FLEXS FIF, FND_APPLICATION_TL FAT
WHERE FAT.APPLICATION_ID = FIF.APPLICATION_ID
AND FAT.LANGUAGE = 'US'GROUP BY FAT.APPLICATION_NAME
ORDER BY FAT.APPLICATION_NAME

SELECT FA.APPLICATION_SHORT_NAME, FAT.APPLICATION_NAME, FIF.ID_FLEX_CODE, FIF.ID_FLEX_NAME
FROM FND_ID_FLEXS FIF, FND_APPLICATION FA, FND_APPLICATION_TL FAT
WHERE FA.APPLICATION_ID = FIF.APPLICATION_ID
AND FAT.APPLICATION_ID = FA.APPLICATION_ID
AND FAT.LANGUAGE = 'US'
ORDER BY FAT.APPLICATION_NAME, FIF.ID_FLEX_NAME



KFF'S & DFF'S


Steps Involved :

1. Registering A Tables & Columns :

Register the Table & Columns if the KFF/DFF is on User Defined Table.

The following is theexample

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 AOLat 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 createan 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 YESGeneric 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 = '') thenapp_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 formField - Field which is acting as DFF/KFFAppl_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 KFFNUM - 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 KFFFor DFF subclass it with ....TEXT_ITEM_DESC_FLEXFor Kff subclass it with ...TEXT_ITEM itself

5. Save ur work andattach this form to a functionFunction to a menu.That's all....Good Luck !! Happy Experimenting...

No comments:

View My Stats