Vous êtes sur la page 1sur 11

Flex Fields Flex Field is nothing but a normal field but it is a ore flexible in the application either to extend

the form functionality or to capture the key information We have 2 types of flex fields in oracle applications 1. Descriptive Flex Fields , 2. Key Flex Fields

1. Descriptive Flex Fields: DFF will be used to capture extra information from the
end user without changing form code and without altering database table a. We will use the attribute column while working with DFF b. We will find all the DFF in Application Developer Responsibility i. N Flex Filed Descriptive Register c. To find DFF in form PO Requisition Form d. Customization of DFF i. Open the form in application (PO, AP) we will find the fields which are enclosed with [ ] it is nothing but a DFF we can enable this DFF by using Application Developer Responsibility ii. Find the DFF title from following navigation 1. Help Menu Diagnostics Examine and enter password as apps and Block name $Descriptive Flex field$ we will find the list of DFFs in the fields select Field: PO_REQ_HDR_DESCRIPTIVE_F4 we will find the DFF in the value fields Value: Requisition Header (Oracle Purchasing) iii. Copy the value go to Application Developer 1. N Flex field Descriptive Segments and enter and press F11 enter the title Ctrl + F11 iv. Un check the checkbox called Freeze Flex field definition select segments button enter the column names select attribute column and value set and save the transactions. v. Check the check box called Freeze Flex Field Definition click on compile button internally system will submit concurrent program (Flex field view Generation) to compile flex field it will generate one flex field view to capture the data. vi. The view name will be database table name _DFV vii. Go to the form where DFF is attached, place the cursor, it will open DFF form enter the data save it go to backend query the records. Select Attribute3 Buyertype, Attribute9 Buyerlocaton, Attribute13 Last Date From PO_REQUISITION_HEADER_ALL Where segment1=15467 viii. Create the value set in system administrator; attach the value set at the time of creating DFF column name in the value set field. ix. We can make the DFF column is optional or mandatory by selecting required check box in the segments form.

x. Context Field: While creation of DFF we can define multiple


structures based on the user selection we can change the DFF structure. While defining the context field we will enter context field values for every context value there will be a structure here we can use the entire attribute column from attribute 1 to 15. 1. NOTE: One we use the attributes in one structure we can use the same attributes in another structure, because user can enter only one structure details at a time. 2. NOTE: Once we enter the value in the context field it will be stored in the Database column called Attribute Category
Inventory Sub Inventory Item Location Stock Location Available Qty Item Details Item Quantity Reserved Qty Purchasable Item Item Attributes Inventory Item Customer Item Production Item

xi. Global Data Elements: While defining the context field we will
enter the context field values based on the value we can change the DFF structure if we want to define any field globally we will select option called Global Data elements, select se4gments enter the details. 1. Once we use the attribute column in Global Data elements it will not be available for the context field values.

2. Key Flex Field : These will be used to capture key information which is in the
code language for every code there will be a specific meaning in the application we will find all the KFF s in the Application Developer Responsibility. Navigation Flex field Key Register and enter we can find the structure in the segments form Navigation Flex Field Key Segments and press enter when we enter the

data in KFF it will be stored in segments columns we will find segments column around 30 based on the requirement. Differences between DFF and KFF DFF 1. DFF will be used to capture EXTRA Information 2. Attribute columns will be used 3. We can register MAX DFF 4. 5. 6. DFF will be accept what ever Data we enter WE have context field DFF data will be stored in Attribute Columns KFF KFF will be used to capture KEY Information Segment columns will be used We have 29 built in KFF we are not suppose to create new KFF KFF we can define rules to capture valid data WE have no Context field KFF codes will be stored in segments KFF description will be stored in FND_FLEX_VALUES tables.

1. 2. 3. 4. 5. 6.

To find a table of DFF go to the segment form of DFF System Last Query Value - Quary will get KFF_List.xls file contains all the important KFF to study Application KFF name Table Name Accounting Flexfield GL GL_CODE_COMBINATIONS Assets KFF FA FA_ASSET_KEYWORDS Category Flexfield FA FA_CATEGORIES_B Location Flexfield FA FA_LOCATIONS Sales Tax Location Flexfield AR AR_LOCATION_COMBINATIONS Territory Flexfield AR RA_TERRITORIES Item Catalogs INV MTL_ITEM_CATALOG_GROUPS Item Categories INV MTL_CATEGORIES_B Stock Locators INV MTL_ITEM_LOCATIONS System Items INV MTL_SYSTEM_ITEMS_B

Staructure Column

CHART_OF_ACCOUNTS_ID No No No

LOCATION_STRUCTURE_ID No no STRUCTURE_ID ORGANIZATION_ID ORGANIZATION_ID

To Capture the Key Information We can query the Information at any level Data entry to the user will be very easy System will accept valid accounting transactions GL_CODE_COMBINATION All Codes GLFV_CHARTS_OF_ACCOUNTS Structure Details

Accounting Key Flex Field: This is one of the built in KFF available in GL application to capture accounting transactions. Accounting KFF is nothing but Chart of accounts in the set of books when ever we assign the profile (GL: Set of Books Name) to the user based on the this profile system will assign Accounting KFF to the User. ******* Set of Books o Currency o Calendar o Chat of Account ******* Select Name, Currency_code Currency Period_set_name Calendar Chat_of_account_id ChartOfA/C From GL_SET_OF_BOOKS ******* 16USER GL:SET OF BOOKS Vision Operation(USA) USD 101(5) 17USER GL:SET OF BOOKS Vision Italy ITL 50173(4) 18USER GL:SET OF BOOKS Vision Belgium BEL 50714(6) ******* Structure Column While defining the KFF we will find structure column field if it is null value then KFF has got only one structure, if there is a structure column that will find multiple structure, open the segments form query the records based on KFF title, we will find structure details For Accounting KFF structure column is CHART_OF_ACCOUNTS_ID And we will get all the structure details from this table GL_CHARTS_OF_ACCOUNTS. All the accounting KFF transaction will be stored in the data based table called GL_CODE_COMBINATIONS Developing the Reports on KFF - Process 1) Call the user exit 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 segment1||'\n'||segment2||'\n'||segment3||'\n'||.......||'\n'||segment30

4) Call another User exit from before report trigger SRW.USER_EXIT ('FND FLEXSQL CODE NUM APPL_SHORT_NAME OUTPUT MODE DISPLAY = "GL#" = ":P_STRUCT_NUM" = "SQLGL" = "P_FLEXDATA" = "SELECT" = "ALL");

5) Define the Query like follows SELECT &P_FLEXDATA FROM KFF Table WHERE KFF Structure Column = :P_STRUCT_NUM; Eg: SELECT &P_FLEXDATA C_FLEXDATA, LAST_UPDATE_DATE LDATE FROM GL_CODE_COMBINATIONS GCC WHERE CHART_OF_ACCOUNTS_ID = :P_STRUCT_NUM; 6) Define Formula Column and CALL another User Exit from formula column SRW.USER_EXIT ('FND FLEXIDVAL CODE = "GL#" NUM = ":P_STRUCT_NUM" APPL_SHORT_NAME = "SQLGL" DATA = "Column Name where the data is available" VALUE = "to get KFF Values we will give formula column Name" MODE = "SELECT" DISPLAY = "ALL"); Flex Fields Reports development P_FLEXDATA: It is one of the lexical parameter having the default value it is a contribution of all the segment columns, we will use this lexical parameter in the select statement to retrieve the data from database P_STRUCT_NUM: This is a bind variable will be used to capture KFF structure number FND FLEX SQL: It is one of the User Exit we will define in the before report trigger to retrieve KFF segments data FND FLEXIDVAL: This is another user exit will called from formula column to display the KFF data in the output 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) Before Report Trigger function BeforeReport return boolean is L_NAME VARCHAR2(100); begin SRW.USER_EXIT( 'FND SRWINIT'); l_name :=fnd_profile.value('GL_SET_OF_BKS_NAME'); select chart_of_accounts_id into :P_STRUCT_NUM FROM gl_sets_of_books where name = l_name; SRW.REFERENCE(:P_STRUCT_NUM); SRW.USER_EXIT('FND FLEXSQL CODE = "GL#" NUM = ":P_STRUCT_NUM" APPL_SHORT_NAME = "SQLGL" OUTPUT = ":P_FLEXDATA" MODE = "SELECT" DISPLAY = "ALL" '); return (TRUE); end; 5) Go to data model select query SELECT FROM WHERE &P_FLEXDATA C_FLEXDATA, GCC.LAST_UPDATE_DATE GL_CODE_COMBINATIONS GCC CHART_OF_ACCOUNTS_ID = :P_STRUCT_NUM;

6) Take the Formula column and place it in query and edit the PL/SQL editor function CF_DATAFormula return Char is begin SRW.REFERENCE(:P_STRUCT_NUM); SRW.REFERENCE(:C_FLEXDATA); SRW.USER_EXIT('FND FLEXIDVAL CODE = "GL#" NUM = ":P_STRUCT_NUM" APPL_SHORT_NAME = "SQLGL" DATA = ":C_FLEXDATA" VALUE = ":CF_DATA" MODE = "SELECT" DISPLAY = "ALL"

IDISPLAY RETURN(:CF_DATA); end;

= "ALL"');

function CF_DESCFormula return Char is begin SRW.REFERENCE(:P_STRUCT_NUM); SRW.REFERENCE(:C_FLEXDATA); SRW.USER_EXIT('FND FLEXIDVAL CODE = "GL#" NUM = ":P_STRUCT_NUM" APPL_SHORT_NAME = "SQLGL" DATA = ":C_FLEXDATA" DESCRIPTION = ":CF_DESC" MODE = "SELECT" DISPLAY = "ALL" IDISPLAY = "ALL"'); RETURN(:CF_DESC); end; 7) Go to layout model design the report and register with Oracle Applications and submit from the user SRS form SRW.REFERENCE( ) : It we are using bind variable in source column the user exit we will refer to get the latest values for variable and source column Changing the structure number dynamically: KFF structure number is nothing but chat of accounts ID, if we know the user set of books name we can find out chart of Accounts ID. Set of books name is one of the user profile by using FND profile API we can get from report triggers Go to before report trigger declare the local variable write the following API o L_name varchar2 (100) o L_name:=fnd_profile.value(GL_SET_OFBKS_NAME); Write the following select statement to get the structure number based on the set of books name Select Chart_of_account_id INTO :P-STRUCT_NUM From GL_SET_OF_BOOKS Where name=L_name; FAQ in Flex Fields 1. What is FLEX FIELD? 2. What is KFF 3. In you experience what are the KFF you have come across? 4. Have u created any KFF? NO 5. Have u created any DF? Yes 6. What is FND FLEX SQL and FND IDVAL? 7. What is SRW REFERENCE? 8. What are parameters we suppose to pass for FND FLEXIDVAL?

9. How to change structure number dynamically? 10. What are the KFF are there in Inventory module? 11. Is there any KFF in PO? NO 12. Where the KFF data will be stored? Segments 13. Where the DFF data will be stored? Attributes 14. What in Attribute_Category?

Descriptive Flex Field Form Development Process

Table should contain attribute column and also it should be registered Go to application developer open the DFF register form navigation Flex Field Descriptive Register and enter Create New DFF by giving database table name. Copy the DFF table go to segments form query based on table, select segments button, enter DFF structure details. Open the template.fmb select all the attribute column at the time of data block creation Define the field in the Canvas change the field property database items as "no"

Define the Package like follows. Package Specification: ---------------------PACKAGE DFF_PKG IS PROCEDURE DFF_PROC(EVENT VARCHAR2); END; Package Body: ------------PACKAGE BODY DFF_PKG IS PROCEDURE DFF_PROC(EVENT VARCHAR2) AS BEGIN IF (EVENT = 'WHEN-NEW-FORM-INSTANCE'
FND_DESCR_FLEX.DEFINE( BLOCK => FIELD APPL_SHORT_NAME DESC_FLEX_NAME END IF; END DFF_PROC; END;

) THEN

'WIP_ITEMS10', => 'DFF_TEXT', => 'WIP', => 'WIPDFF' );

Call this Package from WHEN-NEW-FORM-INSTANCE Trigger o Packagename.Procedure name('WHEN-NEW-FORM-INSTANCE'); o DFF_PKG.DFF_PROC('WHEN-NEW-FORM-INSTANCE'); Call another API from WHEN-NEW-ITEM-ISNATCE Trigger o fnd_flex.event('WHEN-NEW-ITEM-INSTANCE'); o It will Populate the DFF in the Form.

Note: FNDSQF library will support for all the flex field APIS like FND_DESC_FLEX.DEFINE FND_FLEX.EVENT FND_KEY_FLEX

Function Security:

For single form creation of multiple functions at the time of creation function passing the parameter which will change the form functionality. Develop a form register in application developer at the time of creation function pass the parameter called QUERYONLY=YES Attach the functions to menu and menu to responsibility and responsibility to the user. NOTE: At the time of crating function select form tab pass the parameter in the field called parameter

Calling another form from the existing form. Form 6i feature APPS Call_Form, New_form, Open_form FND_FUNCTION.EXECUTE( )

OPEN_FORM built-in Opens the indicated form. Use OPEN_FORM to create multiple-form applications, that is, applications that open more than one form at the same time. NEW_FORM built-in Exits the current form and enters the indicated form. The calling form is terminated as the parent form. If the calling form had been called by a higher form, Form Builder keeps the higher call active and treats it as a call to the new form. Form Builder releases memory (such as database cursors) that the terminated form was using. Form Builder runs the new form with the same Runform options as the parent form. If the parent form was a called form, Form Builder runs the new form with the same options as the parent form. CALL_FORM built-in Runs an indicated form while keeping the parent form active. Form Builder runs the called form with the same Runform preferences as the parent form. When the called form is exited Form Builder processing resumes in the calling form at the point from which you initiated the call to CALL_FORM.

CLASS 37 1) Develop both forms and register in application. 2) Place the Button in first form 3) Write the following code in WHEN-BUTTON-PRESSED Trigger. Fnd_FunCtion.execute ( function_name open_flag OTHER_PARAMS => 'Second from function Name', => 'Y' , => 'P1 = '||:PO_VENDORS.VENDOR_ID);

P1 is Second form parameter 4) Open the Second form and define the Parmaeter called P1 5) Go to PRE-QUERY trigger and write the following code to change the query dynamically. :PO_VENDOR_SITES_ALL.VENDOR_ID := :PARAMETER.P1; --:Blockname .fieldname := :PARAMETER.Parametername 6) Goto the WHEN-NEW-FORM-INSTANCE Trigger at from level. write the following code: GO_BLOCK('PO_VENDOR_SITES_ALL'); EXECUTE_QUERY; Sub Menus Sub menu is nothing but is collection of function and menus we will create the submenus just like menus, then we will attach to main menu by using the field called submenu. Calling the SRS window from Menu

Go to the function form in application developer (N) Application - function Create new function for the user form called Run Reports, copy user function name attach to menu.

Adding Multiple Request Groups to the Responsibility

Create Request Group in System Administrator Copy Request Group name application short name and Request group code. Go to application developer create function for the form called Run Report and pass the following parameters in the parameter field o REQUEST_GORUP_CODE = 20SUPPLIER_CODE o REQUEST_GROUP_APPL_SHORT_NAME=PO o TITLE = 20SUPPLIERS

Hide the menus and function at responsibility level (Menu Exclusions)

At the time of creating responsibility we will attach menu by default all the submenus and functions will be available if we want to hid we will go to Menu Exclusion tab in Responsibility form select type as function or menu and give the function name or menu name in the name field.

Vous aimerez peut-être aussi