February 28, 2011

FOR UPDATE cursors

We can use FOR UPDATE cursors in select statement for auditing purpose:

E.g: select * from per_all_people_f for update;

Here in this case..a employee details has been changed and the updation will be done by a scheduled concurrent program. So we can check the colums which are in wait for updation form this query

Check the below link for more info...
http://www.java2s.com/Tutorial/Oracle/0500__Cursor/UsingWHERECURRENTOF.htm

February 21, 2011

Version

To Find out the DB Version Used...

SELECT banner from v$version;  

To find out the Application release used

SELECT product_group_id GroupID, product_group_name GroupName, release_name Release, product_group_type GroupType FROM fnd_product_groups;



February 15, 2011

Copying a Concurrent program


Let us assume that we are going to register a report.

E.g:-

Customizing seeded report:

1.Copy the rdf for the module top.
2.open it in the report bulider ad save it in different name.
3.Do the changes and save it.
4.Create a executable for the same.While creating the concurrent program... Retrive the seeded program and go to optiom copy to,give your concurrent program name and save it.
--So that the parameters defined for the seeded program will be reflected for the customized report.
5.Now change the executable and add it to the responsibilty and submit it.

Changing a seeded report will be more complicated and replacing the same is not recommended,so we can do in this way.

February 10, 2011

OBIEE Installation

It can run on both Windows and Linux

Basic Install is available only on Windows and it is very easy to install
• There are some tools such as BI Administration Tool that are windows based only















OBIEE

• It is a query tool
• It has far more rich features than Discoverer
• It is completely web based design
• It came with Siebel acquisition, Siebel got it from nQuire Software in 2001, it was
designed to be database/Applications vendor independent

Design
• Clients
• Oracle BI Presentation Services
• Oracle BI Server
• Data Sources
• Clients
– Oracle BI Answers to build Requests (Reports)
– BI Dashboards to Display results of the Answers Requests
– BI Administration Tool to build repository
• Oracle BI Presentation Services
– Renders pages
– Extension to Web Server
– Users a catalog folder to store user content
– Acts as an intermediary, receives data from Oracle BI server and provides it to the client.
• Oracle BI Server
– Uses the RPD file (metadata) to form dynamic SQL
– It can connect natively (Oracle OCI) or through ODBC to the RDBMS
– It Structures the results set
• Data Sources
– Relational Database, OLAP databases, Flat Files, Spreadsheets, XML files
Components:
• Oracle BI Scheduler
– Just like Concurrent Manager, it schedules Answers Requests, Scripts,Alerts
• Oracle BI Delivers
– Few Web pages that allows us create alerts based on Answers Requests
– IBOTS (OBIEE provides few web pages that allows us to create alert setups)
– It works with the Scheduled
• BI Administration tool to manage Analytics Metadata RPD files
– (Windows Based only)

Receipt API

A simple Example

Declare

l_cr_id number;
l_return_status varchar2(20000);
l_msg_count number;
l_msg_data varchar2(20000);
p_count number;
begin
dbms_output.put_line('Start');
fnd_global.apps_initialize( 1297,20678,222,0);
arp_standard.enable_debug;
Ar_receipt_api_pub.Create_cash(
p_api_version => 1.0,
p_init_msg_list => FND_API.G_TRUE,
p_validation_level => FND_API.G_VALID_LEVEL_FULL,
p_receipt_number => '431',
p_customer_bank_account_id=>'10024',
p_amount => 10000,
p_currency_code=>'QAR',
p_commit=>FND_API.G_TRUE,
p_receipt_method_id =>3001,
p_customer_id => 3043,
p_called_from => 'BR_FACTORED_WITH_RECOURSE',
p_receipt_date=>to_date('12-11-2007','dd-mm-yyyy'),
p_maturity_date=>to_date('12-11-2007','dd-mm-yyyy'),
p_gl_date=>to_date('30-6-2004','dd-mm-yyyy'),
p_cr_id => l_cr_id,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data);
dbms_output.put_line( l_cr_id

'l');
dbms_output.put_line( l_return_status);
dbms_output.put_line( l_msg_data );
dbms_output.put_line( l_msg_count);
IF l_msg_count = 1 Then
dbms_output.put_line('l_msg_data '

l_msg_data);
ELSIF l_msg_count > 1 Then
LOOP
p_count := p_count+1;
l_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
IF l_msg_data is NULL Then
EXIT;
END IF;
dbms_output.put_line('Message'

p_count

'.'

l_msg_data);
END LOOP;
END IF;
arp_standard.disable_debug;
end;

Conversion in Oracle HRMS using api

Lets test with hr_person_address_api 

DECLARE
x_business_group_id NUMBER;
x_person_id NUMBER;
x_address_id NUMBER;
x_obj_no NUMBER;
x_errm VARCHAR2(100);
CURSOR legacy_address_cursor IS
/*replace the hard-coding with your source data*/
Lets say you wish to migrate a person address record of following data in Oracle HRMS
Address Line 1 : Martket Stree
Address Line 2 : London
Date FROM : SYSDATE - 1
Employee number : 90909090
Person Id : 134593

SELECT '90909090' AS employee_number ,'Woodlands Street' AS addr_line1,'London' AS addr_line2
,'SW1 1DB' AS post_code,'07968875963' AS tel_no,134593 AS person_id
/*as you have already migrated this person*/
,trunc(SYSDATE) - 1 date_from
/*you can make this to be the same as start date of person*/
FROM dual;


BEGIN

 SELECT business_group_id INTO x_business_group_id FROM per_business_groups WHERE NAME = 'Your Buss Group Name here or Setup Business Group';
FOR p_record IN legacy_address_cursor
LOOP
BEGIN
hr_person_address_api.create_gb_person_address(p_validate => FALSE
,p_effective_date => SYSDATE
,p_pradd_ovlapval_override => FALSE
,p_person_id => p_record.person_id
,p_primary_flag => 'Y'
,p_date_from => p_record.date_from
,p_address_line1 => initcap(p_record.addr_line1)
,p_address_line2 => initcap(p_record.addr_line2)
,p_postcode => p_record.post_code
,p_country => 'GB'
,p_telephone_number => p_record.tel_no
 ,p_address_id => x_address_id
 ,p_object_version_number => x_obj_no
 ,p_date_to => NULL
 ,p_address_type => NULL
 ,p_comments => NULL);
 dbms_output.put_line('Address for person_id=>' p_record.person_id ' has been loaded');
--update the legacy source address table to change migration status of record
EXCEPTION
WHEN OTHERS THEN
x_errm := SQLERRM;
dbms_output.put_line('Error when migrating Address for person_id=>' p_record.person_id ' ' x_errm);
/* log_error(p_record.person_id ,x_errm);*/
END;
END LOOP;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
 x_errm := SQLERRM;
 dbms_output.put_line('Fatal Error '  x_errm);
 /* log_error(-1 ,'Fatal Error '  x_errm); */
END;
 staging table is a table where data is held temporarily for transformation, enrichment and validation before it is moved to the final destination. Staging tables are typically used for conversion and interfaces.
  •  Transformation includes activities such as changing formats and data types, e.g. the character string "23-SEP-2006" into the date September 23 2006; mapping one value to another, e.g. from 1 to "M".
  •  Enrichment is adding new data to the records that were not available in the source.
  •   Validation is checking that the values in fields in a record are valid and that the record is internally consistent. --replace this with your actual source table







February 9, 2011

REF CURSOR in PL/SQL

Cursor variable which will be assosiated with runtime queries with a result set value passing to the query.
declare


type emp_cur REF CURSOR;  /* Declare the ref cursor */
c_emp emp_cur ;  /*c_emp is the cursor variable */
v_variabe employees.ename%type;

begin
open c_emp for select ename from employees;
loop
fetch c_emp into en;
exit when c_emp%notfound;
dbms_output.put_line(en);
end loop;
close c_emp;
end

February 8, 2011

Release 12 Oracle E-Business Financials

Oracle receivables:
New Tables

• AR_REC_TRX_LE_DETAILS_ALL
Added detail level table under AR_RECEIVABLES_TRX_ALL to record the relationship between a receivables activity and the sets of asset and liability tax codes by legal entity.
• AR_DEFERRAL_REASONS 
• AR_DEFERRED_LINES_ALL 
• AR_RDR_PARAMETERS_GT 
• AR_REVIEWED_LINES_GT 
Changed Tables

• RA_CUSTOMER_TRX_LINES_ALL Added numerous columns to support E-Business Tax and line-level Ship To, Added Payment extension identifier.
• AR_MEMO_LINES Added tax_product_category to support E-Business Tax uptake.
• AR_TRX_LINES_GT added numerous columns to support E-Business Tax uptake, Added parent_line_id and deferral_exclusion_flag.
• AR_TRX_LINES_TMP_GT added numerous columns to support E-Business Tax uptake, Added parent_line_id and deferral_exclusion_flag.
• RA_BATCH_SOURCES_ALL Obsoleted invalid_tax_rate_rule column.
• HZ_CUST_SITE_USES
• AR_CASH_RECEIPTS_ALL Added Payment extension identifier and obsoleted, approval_code,
address_verification_code, payment_server_order_num,
Renamed column :REMITTANCE_BANK_ACCOUNT_ID to REMIT_BANK_ACCT_USE_ID, Added legal_entity_id column.

• AR_RECEIPT_METHODS Added Payment Channel Code and obsoleted, payment_type_code, merchant_ref, merchant_id, auto_print_program_id
• RA_CUSTOMER_TRX_ALL Added Payment extension identifier and Payment Attributes,obsoleted payment_server_order_num, approval_code, address_verification_code,
Renamed column :REMITTANCE_BANK_ACCOUNT_ID to REMIT_BANK_ACCT_USE_ID, Added legal_entity_id column.
• RA_INTERFACE_LINES_ALL Added Payment extension identifier and Payment Attributes, and obsoleted payment_server_order_num, approval_code, address_verification_code, Added legal_entity_id column, Added parent_line_id and deferral_exclusion_flag.
• AR_TRX_HEADER_GT Added legal_entity_id column
• AR_TRX_HEADER_TMP_GT Added legal_entity_id column
• AR_LINE_CONTS_ALL Added contingency_id as a foreign key to AR_DEFERRAL_REASONS
• AR_TRX_CONTINGENCIES_GT Added contingency_id, expiration_event_date and completed_flag.

Release 12 Oracle E-Business Financials


Oracle Payable:
Supplier has been moved into TCA model.And more important we understood three old PO Vendors tables obsolete, by Views provided for backward compatibility
• AP_SUPPLIER_CONTACTS
• AP_SUPPLIER_INT_REJECTIONS
• AP_SUPPLIERS
• AP_SUPPLIER_SITES_ALL

New Views
The following are the new views added in Release 12 as a part of this initiative.
These are backwards compatible views that join the Suppliers table in Payables and the TCA tables,
so that any teams using the old suppliers tables have no impact.
• PO_VENDORS
• PO_VENDOR_SITES_ALL
• PO_VENDOR_CONTACTS
The following tables are obsolete:
• PO_VENDORS
• PO_VENDOR_SITES_ALL
• PO_VENDOR_CONTACTS










Changed Views
AP_INVOICES_V
AP_INVOICE_DISTRIBUTIONS_V
PO_LINE_LOCATIONS_AP_V
AP_PO_DISTRIBUTIONS_AP2_V
PO_AP_RECEIPT_MATCH_V
AP_APPLY_PREPAYS_V

Obsolete Tables
AP_BANK_BRANCHES replaced by CE_BANK_BRANCHES_V
AP_BANK_ACCOUNTS_ALL Replaced by CE_BANK_USES_OU_V/IBY_EXT_BANK_ACCOUNTS_V
AP_BANK_ACCOUNTS_USES_ALL
AP_CHECK_STOCKS_ALL replaced by CE_PAYMENT_DOCUMENTS.
AP_CHRG_ALLOCATIONS_ALL


February 7, 2011

OA Project Setting


Part 1

Test Cases to practise:-
  • Create an oracle Application (OA) JDeveloper9i workspace and project. 
  • Configure a project to enable Developer Mode testing and diagnostics. 
  • Use the JDeveloper9i OA extension to create a very simple page. 
  • Create a controller and assosiate it with a region. 
  • Handle a Submit button press action (an HTTP POST request). 
  • Run a page in regular and debug modes..
Create New OA WorkSpace:
Select File>New(New Object Gallery)


Choose General>Higlight workspace in navigator and chose NEW OA Workspace,give the name and Check add a new OA project Check Box.






Modify the project filename also like testOAProject.jpr and set default package name ..test is the component here. Oracle.apps.ak.test

e.g:



Check the connection details and run options also.


Create Page now:
Select Web Tier>OA Components And then select Page
now u can check the name and package for the page as oracle.apps.ak.test.webui

i.e oracle.apps...webui

Initial page layout screen is called Region.

1.Set ID property to PageLayoutRN.
2.Verify that the Region Style Property is set to page Layout.
3.verify that the form property is set to true.
4.Verify the Auto Footer Property is set to true.Set Window Title Name.
5.Set title Property to PAge header(appera in blue Screen)
6.Set Am Definition Property to oracle.apps.fnd.framework.server.OAApplicationModule


now create another region to test with our items.
-Replace the ID value with MainRN.
-Set Region style property to messageComponentLayout.

-Now create the first item under second region choosing new>messagetextinput
-Create a container Region for Go button.->create a message layout in messageComponentLayout region->name it as Button Layout
-Create Item for Go button by selecting Message layout region
-set item style property to submit button. and set attribute set property to /oracle/apps/fnd/attributesets/buttons/Go.



 
Save ans Run the xml....







COALESCE-SQL

Coalesce- return the null values from the expression. It works similar to a case statement where if expression 1 is false then goes to expr...