Showing posts with label Release 12 Upgrade. Show all posts
Showing posts with label Release 12 Upgrade. Show all posts

Monday, April 11, 2011

List of New Tables and Columns in a given module

This query can provide list new tables and count of new columns in existing tables after upgrade of Oracle application. This query is run from lower version instance and assumes that a db link exist from lower version instance to higher version instance and link name is Rel12.


select table_name, count(*), nvl((select 'N' from dba_tables where table_name = a.table_name),'Y') new_table
from ( select table_name, column_name, data_type, owner
from dba_tab_columns@Rel12 where owner = 'AP'
minus
select table_name, column_name, data_type, owner
from dba_tab_columns where owner = 'AP'
order by 1,2
) a group by table_name
order by 3,2 desc

Wednesday, February 09, 2011

Monday, February 07, 2011

HZ_PERSON_PROFILES: Overlapping Start and End Dates

At our site we noticed that some of the person profile records have overlapping start and end dates. This causes problem in some reports such as adjustment register. The query given below can provide list of all such parties that have overlapping record.


SELECT pp_out.party_id
, (SELECT account_number
FROM ar.hz_cust_accounts ca
WHERE ca.party_id = pp_out.party_id
) acct_num
, ( SELECT pty.party_type || ',' || pty.orig_system_reference
FROM ar.hz_parties pty
WHERE pty.party_id = pp_out.party_id
) party_type
, pp_out.person_profile_id
, pp_out.creation_date
, pp_out.effective_start_date
, pp_out.effective_end_date, pp_out.*
FROM ar.hz_person_profiles pp_out
WHERE pp_out.party_id IN
( SELECT party_id
FROM ar.hz_person_profiles pp
WHERE EXISTS
( SELECT 1
FROM ar.hz_person_profiles pp_in
WHERE pp_in.party_id = pp.party_id
AND pp_in.person_profile_id <> pp.person_profile_id
AND ( pp.effective_start_date
BETWEEN pp_in.effective_start_date
AND NVL(pp_in.effective_end_date,SYSDATE+100) OR
NVL(pp.effective_end_date,SYSDATE)
BETWEEN pp_in.effective_start_date
AND NVL(pp_in.effective_end_date,SYSDATE+100)
)
)
)
ORDER BY pp_out.party_id DESC
, pp_out.creation_date


This problem was noticed in Oracle application version 11.5.9 and it still exists to some extent in Oracle Application Rel 12.

Tuesday, November 16, 2010

Default Output Type for Oracle Applications BIP Reports

The default output for most of the xml publisher/BIP reports is NULL (You can see it by querying any seeded xml report using XML Publisher Administrator responsibility and navigating to Home -> Templates) and out of box the profile option “FND: Default Template Output Type” at site level is set to NULL, so when users run any seeded xml report, it generates RTF output that can not be sent to printer directly. Users have to open the output and then print to the desired printer. In order to print xml publisher report in PDF format, users have to do one of the following

1. Either change the output type while submitting a report
2. Open the report output and then print using file menu


The profile option “FND: Default Template Output Type” can be of help here. This profile option can be set to PDF at site level for direct printing. By doing so, users can print a xml publisher report directly without changing output type while submitting a report.


(This is applicable to Oracle Applications Release 12.)

Monday, November 15, 2010

Customer Interface Does Not Populate Late Charges Fields From Profile Class

At our site, when we import customers using customer interface, we encountered this issue. At present Oracle offers only a work around. The work around is to use TCA APIs to update customer profile of affected customer. The similar issue is applicable to Profile amounts too. So we did the following

1. Find customers that are affected by this bug
2. Use following code to update customer's profile


.......
.......
FOR l_profiles IN c_profiles
LOOP
l_prof_rec.cust_account_profile_id := l_profiles.cust_account_profile_id;
l_prof_rec.profile_class_id := l_profiles.profile_class_id;
l_obj_version := l_profiles.object_version_number;

HZ_CUSTOMER_PROFILE_V2PUB.update_customer_profile
( p_init_msg_list => FND_API.G_TRUE
, p_customer_profile_rec => l_prof_rec
, p_object_version_number => l_obj_version
, x_return_status => l_ret_status
, x_msg_count => l_msg_count
, x_msg_data => l_msg_data
) ;
IF l_ret_status <> FND_API.G_RET_STS_SUCCESS
THEN
l_errors := 1;
IF l_msg_count >= 1
THEN
FOR l_count IN 1..l_msg_count
LOOP
fnd_msg_pub.get(l_count, 'F', l_msg_data, l_msg_index);
write_msg('Error While Updating Profile, cust_account_profile_id = ' ||l_profiles.cust_account_profile_id
|| ', Error: '
|| l_msg_data
) ;
END LOOP;
ELSE
write_msg('Undocumented error from Update customer Profile API is: '
|| l_ret_status
|| ' MSG COUNT IS '
|| l_msg_count
|| ' MESSAGE IS '
|| l_msg_data
);
END IF;
END IF; -- END RETURN NOT SUCCESS
END LOOP;
.......
.......




The procedure HZ_CUSTOMER_PROFILE_V2PUB.update_customer_profile calls do_update_customer_profile and that in turn calls HZ_CUSTOMER_PROFILES_PKG.update_row. This procedure checks if profile_class_id is passed or not. If profile class id is passed and a particular profile attribute in HZ_CUSTOMER_PROFILE_V2PUB.CUSTOMER_PROFILE_REC_TYPE is NULL then it is replaced with the value from HZ_PROFILE_CLASSES.



Similar fix is needed for customer Profile amounts too. Code similar to given below could be used for fixing profile amounts.



.......
.......
FOR l_prof_amts IN c_prof_amts
LOOP
l_prof_amt_rec.cust_acct_profile_amt_id := l_prof_amts.cust_acct_profile_amt_id;
l_prof_amt_rec.min_fc_balance_overdue_type := 'AMOUNT';
l_prof_amt_rec.min_fc_invoice_overdue_type := 'AMOUNT';
l_prof_amt_rec.interest_type := 'FIXED_RATE';
l_prof_amt_rec.interest_rate := l_prof_amts.interest_rate;
l_prof_amt_rec.min_fc_balance_amount := l_prof_amts.min_fc_balance_amount;
l_prof_amt_rec.min_fc_invoice_amount := l_prof_amts.min_fc_invoice_amount;
l_obj_version := l_prof_amts.object_version_number;

HZ_CUSTOMER_PROFILE_V2PUB.update_cust_profile_amt
( p_init_msg_list => FND_API.G_TRUE
, p_cust_profile_amt_rec => l_prof_amt_rec
, p_object_version_number => l_obj_version
, x_return_status => l_ret_status
, x_msg_count => l_msg_count
, x_msg_data => l_msg_data
) ;
IF l_ret_status <> FND_API.G_RET_STS_SUCCESS
THEN
l_errors := 1;
IF l_msg_count >= 1
THEN
FOR l_count IN 1..l_msg_count
LOOP
fnd_msg_pub.get(l_count, 'F', l_msg_data, l_msg_index);
write_msg('Error While Updating Profile, cust_acct_profile_amt_id = ' ||l_prof_amts.cust_acct_profile_amt_id
|| ', Profile class:' || l_prof_amts.name
|| ', Error: '
|| l_msg_data
) ;
END LOOP;
ELSE
write_msg('Undocumented error from Update customer Profile API is: '
|| l_ret_status
|| ' MSG COUNT IS '
|| l_msg_count
|| ' MESSAGE IS '
|| l_msg_data
);
END IF;
END IF; -- END RETURN NOT SUCCESS
END LOOP;
.......
.......




Oracle has created an enhancement bug for this issue. Bug number is 6790949.

Monday, October 04, 2010

set_policy_context

In order to access multi org views using sqlplus, one need to execute following pl/sql block. This is equivalent to 'dbms_application_info.set_client_info('1');' in 11.5.9


begin
mo_global.init('AR');
/* if you need to access AP or other module tables, set it accordingly.
* For AP, module code is SQLAP.
* Moduile being set should exist in table fnd_mo_product_init
*/
mo_global.set_policy_context('S','1');
end;