Sunday, 22 May 2011

Descriptive Flex Fields


    Descriptive Flex Fields

Most of the Oracle application screens come with a facility to expand the space to capture custom fields. This facility of adding new custom fields (without any programming) is called DFF or Descriptive Flex Fields. The advantage of DFF is that around 15 new custom fields can be captured on each of the database table based block or form without doing any programming. The availability of facility of DFF on a screen is shown by square bracket [ ] and is shown below in figure 1.


For using a DFF facility on a standard screen, it has to be activated first. The activation is done by system administrator responsibility and it includes deciding number of fields to be used, window title of the fields, valid values of the fields, context etc. Once activated, the DFF field is immediately available for use. It can be used by clicking on the [ ] field which pops up a screen to capture the enabled fields.


DFF Features
DFF is directly mapped to a table and each segment of DFF is mapped to an individual field of the table. These fields are often named as ATTRIBUTE1, ATTRIBUTE2, …, ATTRIBUTE15 (most of the time, we have maximum of 15 attribute fields available in each standard table). In addition to these 15 attribute fields, there is also one field called ATTRIBUTE_CATEGORY. This field is called Context field or Structure Field. How the structure field is used is explained below:

Some time there is a requirement to capture context sensitive information in DFF fields. Suppose in HR form, we want to capture some custom information. If we are entering record for an Employee, we want to capture certain information; on the other hand, if we are entering record for an Applicant, then we want to capture some other custom information. This can be achieved by defining different contexts. In the example, just given, we can define two contexts, Employee and Applicant. Depending upon what context is chosen, we will show the corresponding fields to the users for entry.



Uses
DFF is a very powerful feature of oracle applications which provides lot of extensibility to an implementation. Since Oracle Applications is implemented across diverse businesses and each business may need different kind of information to be captured (in addition to the standard information capturing which oracle provides), DFF comes in very handy to capture the custom information. Fields captured by DFF are stored in the database and are automatically queried whenever corresponding record is queried on the screen.


Examples
  1. A business ABC wants to capture additional supplier attributes like supplier turnover, supplier’s rating etc. These fields are not captured by standard oracle application screen and can be captured by activating DFF on supplier screen.
  2. A leasing company wants to capture maximum mileage allowed and mileage penalty imposed for extra miles for the trucks it leases. These fields are not provided in the standard oracle applications and can be captured by activating DFF on lease authoring screen.


How to enable DFF

Enabling a DFF can be best illustrated by an example. We will take GL Daily Rate Screen (Navigation: GL Super User => Setup => Rates => Daily) for this discussion.  
The screen is shown below. The screen has the DFF facility available but is not active currently.

We want to enable this DFF to capture two more fields:

 Exchange Rate Source
 Exchange Rate Time
  
  1. First step is to find out the corresponding table name for this screen. This can be found by querying the record and then going to Help => Diagnostics => Examine and checking the Last Query field in the System Block. This will provide us with the table name underlying the data.  In this example, our table name is GL_DAILY_RATES.  
  2. Now go to Application Developer Responsibility and Navigate to Flexfield => Descriptive => Register. Now do a query based on this table name (GL_DAILY_RATES).

We note down the Title (which is Daily Rates).

  1. Now, we know the title of the standard DFF available for the Daily Rate screen. This DFF needs to be now enabled. For doing this navigate to FlexField=>Descriptive=>Segments screen and do a query based on the DFF title (Daily Rates).

Global Data Elements context is always pre-populated. If we do not want any context, then we can just click on segments button and define the required segments. However, if we need to define different contexts, then those context can be entered here and the corresponding segments can be entered for each of chosen contexts.

  1. Click on the Segments button, and enter the values as shown below. We can associate value-set for each segment so that users can enter only valid values when entering a record.

  1. Save the changes and come back to the previous screen. Click on Freeze Flexfield definition check-box and save the changes.  

  1. Now, we are done with activating the DFF. Come back to the Daily Rate Screen and see that DFF is enabled and can be used to capture two new fields as shown below:
 

Defining a new DFF

DFF is implemented using the Attribute column fields in a table. For example, let us consider definition of a table GL_DAILY_RATES.

SQL> desc gl_daily_rates
 Name Null? Type
 ------------------------------- -------- ----
 FROM_CURRENCY NOT NULL VARCHAR2(15)
 TO_CURRENCY NOT NULL VARCHAR2(15)
 CONVERSION_DATE NOT NULL DATE
 CONVERSION_TYPE NOT NULL VARCHAR2(30)
CONVERSION_RATE NOT NULL NUMBER
STATUS_CODE NOT NULL VARCHAR2(1)
CREATION_DATE NOT NULL DATE
CREATED_BY NOT NULL NUMBER(15)
LAST_UPDATE_DATE NOT NULL DATE
LAST_UPDATED_BY NOT NULL NUMBER(15)
LAST_UPDATE_LOGIN NOT NULL NUMBER(15)
CONTEXT VARCHAR2(150)
ATTRIBUTE1 VARCHAR2(150)
ATTRIBUTE2 VARCHAR2(150)
ATTRIBUTE3 VARCHAR2(150)
ATTRIBUTE4 VARCHAR2(150)
ATTRIBUTE5 VARCHAR2(150)
ATTRIBUTE6 VARCHAR2(150)
ATTRIBUTE7 VARCHAR2(150)
ATTRIBUTE8 VARCHAR2(150)
ATTRIBUTE9 VARCHAR2(150)
ATTRIBUTE10 VARCHAR2(150)
ATTRIBUTE11 VARCHAR2(150)
ATTRIBUTE12 VARCHAR2(150)
ATTRIBUTE13 VARCHAR2(150)
ATTRIBUTE14 VARCHAR2(150)
ATTRIBUTE15 VARCHAR2(150)
RATE_SOURCE_CODE VARCHAR2(15)

This table contains a field called CONTEXT and 15 Attribute columns. The Context field stores the structure or content of the DFF and attribute columns store the actual values of the custom fields.

When we create a DFF definition (as shown below), we choose a Structure Column (CONTEXT in the below example) and also choose a prompt for the Context.
 
The fields to be used in the DFF design can be associated by clicking on the Columns button and checking the enabled button as shown below:

There is also a button called Reference Fields, which is used for defining the reference fields for DFF as shown below:


Reference fields are useful for automatically prompting user to enter required values. This can be explained by an example:

Suppose a manufacturing firm sells three kinds of items – Computer, Printers and Fax Machines. Depending upon the item type, we would like to capture different kind of custom information from the user. If ‘item type’ is a reference field in the DFF definition, then we can choose ‘item type’ in the reference field during DFF enabling. For each item type, we can define a context field (Computer, Printers, Fax Machines) and the corresponding segments. When user enters item information, depending upon the item type, the corresponding DFF structure appears automatically.

FAQ on DFF

  1. Can we create a custom DFF?
Ans. Yes, we can create a custom DFF. But the table to be used in the DFF should be registered with Oracle Applications.

  1. How do we use a custom DFF?
Ans. Custom DFF can be used only in a custom form. For details on how to use a custom DFF in custom form, please see Oracle Forms section.

  1. What is meant by Global Context?
Ans. When we need to capture same kind of information for all the records, then global context can be used. In this case, for all the records, the same structure appears for data entry.

  1. How do we use different Attribute columns during DFF activation?
Ans. If we are using two different contexts (say Printer and Fax) and not using Global Context, then we can re-use the attribute columns. That means, an attribute column associated with Printer context can also be associated with the Fax context. However, if we are using global context also, then the attributes used in global context cannot be re-used for any other context. For example, if we are using Attribute1 to Attribute3 in the global context, then we can use only Attribute4 to Attribute15 in the other contexts.

  1. What is the Difference between Reference Field and Context?
Ans: When we use multiple contexts, user has to manually select a context when entering values. Based on the context chosen, corresponding fields are shown to the user. However, when we use a reference field, a context is automatically defaulted to the user (which cannot be changed). A reference field is one of the fields from the same table.

  1. How do we use Reference Field?
Ans: Reference field is defined during the DFF definition. Reference field is one of the fields from the same table. Usually, reference field chosen should be quite selective. For example, a field having 500 distinct value is not a good reference field. However, a field having around 10 distinct values or less can be a good reference field. When reference field is used in the DFF activation, we need to define structure for each of the unique value of the reference field. Once defined properly, based on the reference field, a DFF structure is automatically displayed to the user during data entry.

Oracle Apps Standards in Reports Registration:


Oracle Apps Standards in Reports Registration:
==============================================

1)Define the Mandatroy parameter called P_CONC_REQUEST_ID

2)Call the Following User exit from the Before report Triggers

   SRW.USER_EXIT('FND SRWINIT');

3)Call another User Exit from After Report Trigger

   SRW.USR_EXIT('FND SRWEXIT');

User Exit: 
==========
It is one of the Oracle  Reports 6i Built In program which will be used to stop the
report execution and pass the control into some other 3GL and retrieves the data
then complete the remaining report execution Process.

We have 5 User Exits in Oracle Applications:
FND SRWINIT
FND SRWEXIT
FND FLEXSQL
FND FLEXIDVAL
FND FORMATCURRENCY

FND SRWINIT : This User Exit we will initialize user Profile values we will call this
    user exit from Before Report Trigger.

FND SRWEXIT: This User Exit will frees the Memory which is Occupied by the User Profile
             values in the server. we will call this from After Report Trigger.


We have Five types of Report Triggers :

Before Parameter Form
After Parameter Form
Before Report Trigger
Between Pages
After Report Trigger

We are using Before Report trigger before data is retrieving  from data base system 
will capture the user profiles data and as per that data will be retrieved from 
database.
Once Output is generated we do not reuire the Information in the system for that
we are using after Report Trigger call the another User Exit.


P_CONC_REQUEST_ID : This is One of the mandatory parameter we have to define for every
        concurrent Program.when we submit C.P from SRS window which will generate the
        REQUEST_ID that request ID will be passed into this variable.

 


Reports parameter (value sets, defaul types,token
Request group
Reponsibli
user
SRS
user exits.

FND_USER
FND_USER_REPS

Purchasing   = functionality  500
        Imp tables Join 

STEPS TO REGISTER XML REPORT IN APPS


STEPS TO REGISTER XML REPORT IN APPS
1)Develop the .rdf file and .rtf file
2)Register both .rdf and .rtf file

  .rdf File registration :
  =========================
  1)Move the .rdf file into CUS_TOP\11.5.0\Reports\US
  2)Create Execuiteable
           Concurrent Program  Output = XML
           Request Group
           Responsibility
           User
           SRS
  3)Copy the Concurrent Program Short name
  
  .rtf File Regitration:
 =======================

1)Goto the XML Publisher Administrator Responsibility
2)Select Data Definations form
  Enter Data Defination Name = Enter Any Name 
  Code               = Concurrent Program Short Name
  Application              = Any application
  startdate       = Current Date

3)Copy the DataDefination name we have to add this to the Templete
4)Open the Templete Form
  Enter Templete Name : Any Name
  DataDefination      : enter data defination whatever we have created
  Code                : Concurrent Program Short Name
  Type                : rtf
  application         : any Application
  File                : Upload the .rtf file
  Laguage             : English
  Territory           : United States

5)Select Apply button

After register the .rtf file submit concurrent Program from SRS window system will 
automatically pick the .rtf file and generates  the Output.

If we want to customze the .rtf file we have to download by using templete , Customize then
upload the .rtf templete










STEPS FOR XML REPORT


STEPS FOR XML REPORT
1)Develop the Report(.rdf) Only  DataModel
2)Save the report and Compoile and Generate the data in .xml Format
  File=>Generate to File => XML
3)Open the Ms-WOrd document  Design the Layout 
  include the follwing Tool Bar options called Form  and Templete builder

4)Define the Table and Specify the Titles and Labels whatever we would like to print

5)Include 'Text Form Field' Double CLick => Add Help Text button enter the following 
  syntax
  <?for-each:G_USER_ID?>  : Here G_USER_ID is Group name from .rdf Data Model
 Note: It means Indirectley Repeating Frame starting

6)Define the Fields which we would like to display
  
  Include 'Text Form Field' Double CLick => Add Help Text button enter the following 
  syntax  
  <?Column Name>?

Note: Define all the fields like this 

7)We have to close the Repeating Frame (For each Loop)
  Include 'Text Form Field' Double CLick => Add Help Text button enter the following 
  syntax  
<?end for-each?>

8)Save the document in .rtf(Rich Text File format)

9)Load the .xml file data and generate the Output in pdf Format
  Data=>Load XMl Data=>Load the .xml File=>Once Data is Loaded succesfully

10)Generate the Preview as per this Preview=>PDF