DBA Data[Home] [Help]

APPS.CSC_PARTY_MERGE_PKG dependencies on CSC_CUSTOMERS

Line 8: -- CSC_CUSTOMERS, CSC_CUSTOMERS_AUDIT_HIST,

4: -- Package name : CSC_PARTY_MERGE_PKG
5: -- Purpose : Merges duplicate parties in Customer Care tables. The
6: -- Customer Care table that need to be considered for
7: -- Party Merge are:
8: -- CSC_CUSTOMERS, CSC_CUSTOMERS_AUDIT_HIST,
9: -- CSC_CUSTOMIZED_PLANS, CSC_CUST_PLANS,
10: -- CSC_CUST_PLANS_AUDIT
11: --
12: -- History

Line 17: -- -- Removed logic to stop merge for CSC_CUSTOMERS

13: -- MM-DD-YYYY NAME MODIFICATIONS
14: -- 10-10-2000 dejoseph Created.
15: -- 10-25-2001 dejoseph Made the following corrections:
16: -- -- Replaced calls to arp_message with fnd_file.put_line
17: -- -- Removed logic to stop merge for CSC_CUSTOMERS
18: -- -- Added logic for CSC_CUSTOMERS to handle cases where
19: -- only the From or To party exists in the table.
20: -- -- Does not return an error status for any reason. Instead
21: -- prg. logs an error and returns control so that

Line 18: -- -- Added logic for CSC_CUSTOMERS to handle cases where

14: -- 10-10-2000 dejoseph Created.
15: -- 10-25-2001 dejoseph Made the following corrections:
16: -- -- Replaced calls to arp_message with fnd_file.put_line
17: -- -- Removed logic to stop merge for CSC_CUSTOMERS
18: -- -- Added logic for CSC_CUSTOMERS to handle cases where
19: -- only the From or To party exists in the table.
20: -- -- Does not return an error status for any reason. Instead
21: -- prg. logs an error and returns control so that
22: -- execution can continue for the other products.

Line 56: PROCEDURE CSC_CUSTOMERS_MERGE (

52: G_REQUEST_ID := TO_NUMBER(NULL);
53: G_MERGE_REASON_CODE := NULL;
54: END;
55:
56: PROCEDURE CSC_CUSTOMERS_MERGE (
57: p_entity_name IN VARCHAR2,
58: p_from_id IN NUMBER,
59: x_to_id OUT NOCOPY NUMBER,
60: p_from_fk_id IN NUMBER,

Line 69: from csc_customers

65: x_return_status OUT NOCOPY VARCHAR2)
66: IS
67: cursor c1 is
68: select 1
69: from csc_customers
70: where party_id = p_from_fk_id
71: for update nowait;
72:
73: cursor get_from_pty is

Line 80: from csc_customers

76: rowid from_rowid,
77: cust_account_id from_cust_account_id,
78: overridden_critical_flag from_overridden_critical_flag,
79: override_reason_code from_override_reason_code
80: from csc_customers
81: where party_id = p_from_fk_id;
82:
83: cursor get_to_pty is
84: select override_flag to_override_flag,

Line 86: from csc_customers

82:
83: cursor get_to_pty is
84: select override_flag to_override_flag,
85: overridden_critical_flag to_overridden_critical_flag
86: from csc_customers
87: where party_id = p_to_fk_id;
88:
89: G_PROC_NAME CONSTANT VARCHAR2(30) := 'CSC_PARTY_MERGE_PKG';
90: G_FILE_NAME CONSTANT VARCHAR2(12) := 'cscvmpts.pls';

Line 94: l_api_name VARCHAR2(30) := 'CSC_CUSTOMERS_MERGE';

90: G_FILE_NAME CONSTANT VARCHAR2(12) := 'cscvmpts.pls';
91: G_USER_ID CONSTANT NUMBER(15) := FND_GLOBAL.USER_ID;
92: G_LOGIN_ID CONSTANT NUMBER(15) := FND_GLOBAL.CONC_LOGIN_ID;
93:
94: l_api_name VARCHAR2(30) := 'CSC_CUSTOMERS_MERGE';
95: l_count NUMBER(10) := 0;
96: l_to_override_flag VARCHAR2(3);
97: l_from_override_flag VARCHAR2(3);
98: l_to_critical_flag VARCHAR2(3);

Line 112: g_mesg := 'CSC_PARTY_MERGE_PKG.CSC_CUSTOMERS_MERGE';

108: g_mesg VARCHAR2(1000) := '';
109:
110: BEGIN
111:
112: g_mesg := 'CSC_PARTY_MERGE_PKG.CSC_CUSTOMERS_MERGE';
113: fnd_file.put_line(fnd_file.log, g_mesg);
114:
115: x_return_status := CSC_CORE_UTILS_PVT.G_RET_STS_SUCCESS;
116:

Line 140: -- Please ignore the following comments. Parties in CSC_CUSTOMERS will be

136: fnd_file.put_line(fnd_file.log, g_mesg);
137: return;
138: end if;
139:
140: -- Please ignore the following comments. Parties in CSC_CUSTOMERS will be
141: -- allowed to merge always, ir-respective of the criticality of the From
142: -- or To party.
143: /* ignore comments section
144: -- The following are the scenarios that are to be considered when merging

Line 145: -- parties in the CSC_CUSTOMERS table. If Party A is merging with Party B,

141: -- allowed to merge always, ir-respective of the criticality of the From
142: -- or To party.
143: /* ignore comments section
144: -- The following are the scenarios that are to be considered when merging
145: -- parties in the CSC_CUSTOMERS table. If Party A is merging with Party B,
146: -- then these are the following scenarios and their merge outcomes.
147: -- (OSa => Over-ride state of party A) (values are off column OVERRIDE_FLAG)
148: -- Party A Party B Allow Merge or Not
149: -- ------------------------------------------------------------------------

Line 162: -- If the From party is not found in CSC_CUSTOMERS, then the merge process need not be

158: fetch get_from_pty into l_from_override_flag , l_from_critical_flag,
159: l_from_rowid , l_from_cust_account_id,
160: l_from_overridden_crit_flag , l_from_override_reason_code;
161:
162: -- If the From party is not found in CSC_CUSTOMERS, then the merge process need not be
163: -- performed, coz there is no party to merge.
164:
165: if ( get_from_pty%NOTFOUND ) then
166: close get_from_pty;

Line 167: g_mesg := 'From party not defined in CSC_CUSTOMERS. Merge not required.';

163: -- performed, coz there is no party to merge.
164:
165: if ( get_from_pty%NOTFOUND ) then
166: close get_from_pty;
167: g_mesg := 'From party not defined in CSC_CUSTOMERS. Merge not required.';
168: fnd_file.put_line(fnd_file.log, g_mesg);
169: return;
170: end if;
171:

Line 177: -- if the To party does not exist in CSC_CUSTOMERS, then update the 'from' party_id

173:
174: open get_to_pty;
175: fetch get_to_pty into l_to_override_flag , l_to_critical_flag;
176:
177: -- if the To party does not exist in CSC_CUSTOMERS, then update the 'from' party_id
178: -- of CSC_CUSTOMERS to the 'to' party id and insert a record into the audit table
179: -- recording the operation.
180:
181: if ( get_to_pty%NOTFOUND ) then

Line 178: -- of CSC_CUSTOMERS to the 'to' party id and insert a record into the audit table

174: open get_to_pty;
175: fetch get_to_pty into l_to_override_flag , l_to_critical_flag;
176:
177: -- if the To party does not exist in CSC_CUSTOMERS, then update the 'from' party_id
178: -- of CSC_CUSTOMERS to the 'to' party id and insert a record into the audit table
179: -- recording the operation.
180:
181: if ( get_to_pty%NOTFOUND ) then
182: close get_to_pty;

Line 185: update csc_customers

181: if ( get_to_pty%NOTFOUND ) then
182: close get_to_pty;
183:
184: begin
185: update csc_customers
186: set party_id = p_to_fk_id,
187: last_update_date = trunc(SYSDATE),
188: last_updated_by = G_USER_ID,
189: last_update_login = G_LOGIN_ID,

Line 196: insert into csc_customers_audit_hist (

192: program_id = ARP_STANDARD.PROFILE.PROGRAM_ID,
193: program_update_date = trunc(SYSDATE)
194: where party_id = p_from_fk_id;
195:
196: insert into csc_customers_audit_hist (
197: cust_hist_id, party_id, last_update_date,
198: last_updated_by, last_update_login, creation_date,
199: created_by, changed_date, changed_by,
200: sys_det_critical_flag, override_flag, overridden_critical_flag,

Line 205: csc_customers_audit_hist_s.nextval, p_to_fk_id, sysdate,

201: override_reason_code, request_id,
202: program_application_id,
203: program_id, program_update_date)
204: values (
205: csc_customers_audit_hist_s.nextval, p_to_fk_id, sysdate,
206: g_user_id, g_login_id, sysdate,
207: g_user_id, sysdate, g_user_id,
208: 'N', l_from_override_flag, l_from_overridden_crit_flag,
209: l_from_override_reason_code , G_REQUEST_ID,

Line 225: /**** do not perform any check to stop the merge process. Merge in CSC_CUSTOMERS

221: end if;
222:
223: close get_to_pty;
224:
225: /**** do not perform any check to stop the merge process. Merge in CSC_CUSTOMERS
226: will always happen.
227:
228: IF ( ( ( l_from_override_flag = 'Y' and l_to_override_flag = 'N' )
229: AND ( l_from_critical_flag <> 'N' ) )

Line 242: -- In the case of the table CSC_CUSTOMERS there will not be a situation to

238: -- dependent record to the new parent. Before transferring check if a similar
239: -- dependent record exists on the new parent. If a duplicate exists then do
240: -- not transfer and return the id of the duplicate record as the Merged To Id
241:
242: -- In the case of the table CSC_CUSTOMERS there will not be a situation to
243: -- check for duplicates because, the column party_id, which is going to be
244: -- merged/transferred, itself is the primary key for the table.
245: -- Hence, we cannot update the party_id in this table. Instead, set the
246: -- party_status of the merge from party to 'M' (Merged); this record will

Line 247: -- not be shown in the CSC_CUSTOMERS views.

243: -- check for duplicates because, the column party_id, which is going to be
244: -- merged/transferred, itself is the primary key for the table.
245: -- Hence, we cannot update the party_id in this table. Instead, set the
246: -- party_status of the merge from party to 'M' (Merged); this record will
247: -- not be shown in the CSC_CUSTOMERS views.
248:
249: if p_from_fk_id <> p_to_fk_id then
250: begin
251:

Line 256: csc_customers_pkg.update_row (

252: open c1;
253: close c1;
254:
255:
256: csc_customers_pkg.update_row (
257: x_rowid => l_from_rowid,
258: x_party_id => p_from_fk_id,
259: x_cust_account_id => l_from_cust_account_id,
260: x_last_update_date => SYSDATE,

Line 278: g_mesg := 'Could not obtain lock for records in table CSC_CUSTOMERS. Please '

274:
275: exception
276: when resource_busy then
277: -- x_return_status := CSC_CORE_UTILS_PVT.G_RET_STS_ERROR;
278: g_mesg := 'Could not obtain lock for records in table CSC_CUSTOMERS. Please '
279: || 'retry the Merge operation later.';
280: fnd_file.put_line(fnd_file.log, g_mesg);
281: --arp_message.set_line(g_proc_name || '.' || l_api_name ||
282: --'; Could not obtain lock for records in table ' ||

Line 283: --'CSC_CUSTOMERS for party_id = ' || p_from_fk_id );

279: || 'retry the Merge operation later.';
280: fnd_file.put_line(fnd_file.log, g_mesg);
281: --arp_message.set_line(g_proc_name || '.' || l_api_name ||
282: --'; Could not obtain lock for records in table ' ||
283: --'CSC_CUSTOMERS for party_id = ' || p_from_fk_id );
284: raise;
285:
286: when others then
287: -- x_return_status := CSC_CORE_UTILS_PVT.G_RET_STS_ERROR;

Line 310: END CSC_CUSTOMERS_MERGE;

306: g_mesg := substr(g_proc_name || '.' || l_api_name || ' : ' || sqlerrm,1,1000);
307: fnd_file.put_line(fnd_file.log, g_mesg);
308: raise;
309:
310: END CSC_CUSTOMERS_MERGE;
311:
312:
313: PROCEDURE CSC_CUST_PLANS_MERGE (
314: p_entity_name IN VARCHAR2,