Tuesday, March 3, 2009

Oracle Report Creation using wizard

Action: Open Report Builder
This is the first screen you will see. Selec the first option "Use the Report Wizard" and click OK.
Action: Click Next
Action: Enter Report Title: erpschools_sample_report and then select "Tabular" option.
As per name "Tabular" our output will be organized in a tabular way(rows and columns).
You can select any option you want based on your requirement/wish.
Then click NEXT>

Action: Select the first option "SQL statement" and click Next
SQL statement: If you select this option you have to write the query directly.
Express Query:If you select this option you have to connect to the databse and then select the tables/columns you want to display in the report. simply this is wizard for building the query.
Action: Enter the below SQL Query and then click Next
SELECT * FROM MTL_SYSTEM_ITEMS_B WHERE SEGMENT1 = :P_SEGMENT1
In the above query :p_segment1 is called as bind parameter/variable.
Note: There are two types of parameters that we use in reports. Lexical Parameter and Bind Parameter
Bind Parameter: This is used to pass the values dynamically at run time.
Examples: 1)If you want to see only one item from your inventory and you want to select that item at the time of running report. 2) If you want select only particular department employes and you want to select that department at runtime.
Lexical Parameter: This parameter is used to build the query dynamically.
Examples: If you have two users A,B will be running the report and If use A want to see only columns 1,2,3 where as User B want to see columns 2,3,4 in that case we build the query dynamically using lexical parameters.
Here you have to enter the username, password of your database. Usually in many development environments username and password will be "apps".
so enter apps/apps@datbase and click Connect
Once you are successfully connected you will see the above messagebox.
Action Click OK to Proceed
Based on your Query above screen will display the Available Fields. In this case we will have all columns from mtl_system_items_b table. Select the columns you want to display in the report and use arrow buttons to move them to Displayed Fields.
Here I have selected the Three columns. You have to select the SEMENT1 column if you have any parameters associated with it, as we have one parameter with it i am selecting that field.
Action: click Next
In the above screen you have option to select any Totals/Sum/Averages if you want. Here i will proceed with out selecting any.
Action: Click Next
In this screen you have the option to change the heading/display column names in the report. Here i have changed the "Description" to "Item Description" and "SEGMENT1" to "Item Number".
Action: click Next
Here you have the option to select any template if you have. I will go with "No Template" option
Action: click Next
Finally click Finish
It will prompt you with the "P Segment1" parameter. Enter some valid value and click green signal button to run the report.
Note: To check valid parameters for this report run the below query and copy the output.
SELECT SEGMEN1 FROM MTL_SYSTEM_ITEMS_B WHERE ROWNUM<2;
Finally this is my report output.
Action: Click File -- Save and enter your report name (sample_report.rdf to use concurrent program registration document for your reference)
Note:
Click Here to see how to register this as a Concurrent Program
Once you save make sure that the report extension is .rdf and not .RDF
Finally move the report file to the reports/US directory of the desired top on your server.

Sunday, March 1, 2009

How to use Descriptive Flex Fields (DFF) in forms

Implementing DFF in Form consist of two steps Process. The first steps consist of designing the table structure and registration and step 2 consist of enabling in the form.
Steps 1:
Define DFF fields in the custom tables
ATTRIBUTE1รข€¦ATTRIBUTE15 and ATTRIBUTE_CATEGORY are the normal fields used for DFF
Register the table with Oracle AOL
Register the DFF with Oracle AOL
For this you have to login into application with :
Application Developer -> Flex Field -> Descriptive -> Register
Then you should specify the name of the DFF (Say BTL_AR_DFF) and specify the associated table.
Step 2:
window.google_render_ad();
Create DFF fields in the custom form
1. Create a form based on the custom table
Copy TEMPLATE form has example descriptive flexfield which we can use
Use the TEXT_ITEM_DESC_FLEX property class
Attach ENABLE_LIST_LAMP_LOV for the field
2. Create a non-base table text item in the block with property class TEXT_ITEM_DESC_FLEX3. Make sure that DFF is mapped to fields (ATTRIBUTE) of the table and is enabled.
Next is to call Flexfield Routines to add DFF built-ins in the form to invoke DFF.
This consist of these steps:
1. Write, a form level trigger WHEN-NEW-FORM-INSTANCE to invoke the DFF as
FND_DESCR_FLEX.DEFINE(Block => ‘Name of the DFF block’,Field => ‘BTL_DFF’,Appl_short_name => ‘AR’,Desc_flex_name => ‘BTL_AR_DFF’,Title => ‘BPL AR More Info’ );
2. Write, block level triggers PRE-QUERY and POST-QUERY as
FND_FLEX.EVENT(’PRE-QUERY’);
FND_FLEX.EVENT(’POST-QUERY’);
FND_FLEX.EVENT(’Pre-Query’);
FND_FLEX.EVENT(’When-Validate-Record’);
FND_FLEX.EVENT(’Post-Query’);
FND_FLEX.EVENT(’When-New-Item-Instance’);
FND_FLEX.EVENT(’Pre-Insert’);
FND_FLEX.EVENT(’When-Validate-Item’);
FND_FLEX.EVENT(’Pre-Update ‘);