DBA Data[Home] [Help]

APPS.CN_SCA_CREDITS_ONLINE_PUB dependencies on CN_SCA_LINES_OUTPUT_GTT

Line 12: -- + cn_sca_lines_output_GTT table. +

8: -- + +
9: -- + Based on the p_batch_id, API will get the data from +
10: -- + cn_sca_headers_interface_GTT and cn_sca_lines_interface_GTT Global +
11: -- + Temporary tables. After processing, this API will keep the data in +
12: -- + cn_sca_lines_output_GTT table. +
13: -- +=========================================================================+
14: PROCEDURE get_sales_credits(
15: p_api_version IN number,
16: p_init_msg_list IN varchar2 := fnd_api.g_false,

Line 84: cn_sca_lines_output_gtt l,

80: MIN(l.sca_lines_output_id) sca_lines_output_id,
81: w.sca_headers_interface_id
82: FROM cn_sca_headers_interface_gtt cshi,
83: cn_sca_winning_rules_gtt w,
84: cn_sca_lines_output_gtt l,
85: cn_sca_alloc_details csad,
86: cn_sca_allocations csa
87: WHERE cshi.sca_headers_interface_id = w.sca_headers_interface_id
88: AND w.sca_headers_interface_id = l.sca_headers_interface_id

Line 104: cn_sca_lines_output_gtt l,

100: MIN(l.sca_lines_output_id) sca_lines_output_id,
101: w.sca_headers_interface_id
102: FROM cn_sca_headers_interface_gtt cshi,
103: cn_sca_winning_rules_gtt w,
104: cn_sca_lines_output_gtt l,
105: cn_sca_alloc_details csad,
106: cn_sca_allocations csa
107: WHERE cshi.sca_headers_interface_id = w.sca_headers_interface_id
108: AND w.sca_headers_interface_id = l.sca_headers_interface_id

Line 192: 'INSERT INTO cn_sca_lines_output_gtt

188: RETURN;
189: END IF;
190:
191: l_stmt :=
192: 'INSERT INTO cn_sca_lines_output_gtt
193: (
194: sca_lines_output_id ,
195: sca_batch_id,
196: sca_headers_interface_id ,

Line 205: SELECT cn_sca_lines_output_gtt_s.nextval,

201: role_id ,
202: revenue_type ,
203: allocation_percentage
204: )
205: SELECT cn_sca_lines_output_gtt_s.nextval,
206: batch_id,
207: interface_id,
208: processed_date,
209: status,

Line 285: UPDATE cn_sca_lines_output_gtt l

281: CLOSE rounding_cur;
282:
283: IF (l_rounding_tbl_rec.interface_id_tbl.COUNT > 0) THEN
284: FORALL indx IN l_rounding_tbl_rec.interface_id_tbl.FIRST .. l_rounding_tbl_rec.interface_id_tbl.LAST
285: UPDATE cn_sca_lines_output_gtt l
286: SET l.allocation_percentage = l.allocation_percentage +
287: l_rounding_tbl_rec.rounding_tbl(indx)
288: WHERE l.sca_headers_interface_id = l_rounding_tbl_rec.interface_id_tbl(indx)
289: AND l.sca_lines_output_id = l_rounding_tbl_rec.lines_output_id_tbl(indx);

Line 305: UPDATE cn_sca_lines_output_gtt l

301: CLOSE rounding1_cur;
302:
303: IF (l_rounding_tbl_rec.interface_id_tbl.COUNT > 0) THEN
304: FORALL indx IN l_rounding_tbl_rec.interface_id_tbl.FIRST .. l_rounding_tbl_rec.interface_id_tbl.LAST
305: UPDATE cn_sca_lines_output_gtt l
306: SET l.allocation_percentage = l.allocation_percentage +
307: l_rounding_tbl_rec.rounding_tbl(indx)
308: WHERE l.sca_headers_interface_id = l_rounding_tbl_rec.interface_id_tbl(indx)
309: AND l.sca_lines_output_id = l_rounding_tbl_rec.lines_output_id_tbl(indx);

Line 315: UPDATE cn_sca_lines_output_gtt set status = 'REV NOT 100'

311:
312:
313: -- update the status to rev not 100 where sum
314: -- of allocated revenues across roles is not 100
315: UPDATE cn_sca_lines_output_gtt set status = 'REV NOT 100'
316: WHERE sca_batch_id =x_batch_id
317: AND revenue_type = 'REVENUE'
318: AND sca_headers_interface_id in
319: (SELECT sca_headers_interface_id

Line 320: FROM cn_sca_lines_output_gtt

316: WHERE sca_batch_id =x_batch_id
317: AND revenue_type = 'REVENUE'
318: AND sca_headers_interface_id in
319: (SELECT sca_headers_interface_id
320: FROM cn_sca_lines_output_gtt
321: WHERE sca_batch_id = x_batch_id
322: AND revenue_type = 'REVENUE'
323: GROUP BY sca_headers_interface_id
324: HAVING SUM(allocation_percentage) <> 100);

Line 335: FROM cn_sca_lines_output_gtt cslog

331:
332: -- copy the status from output to headers table
333: UPDATE cn_sca_headers_interface_gtt cshig set
334: PROCESS_STATUS = (SELECT distinct status
335: FROM cn_sca_lines_output_gtt cslog
336: WHERE cslog.sca_headers_interface_id = cshig.sca_headers_interface_id
337: AND sca_batch_id =x_batch_id
338: AND revenue_type = 'REVENUE'),
339: CREDIT_RULE_ID = (SELECT min( sca_credit_rule_id)

Line 345: -- FROM cn_sca_lines_output_gtt cslog

341: WHERE sca_batch_id = x_batch_id
342: and cswr.sca_headers_interface_id = cshig.sca_headers_interface_id)
343: WHERE sca_batch_id = x_batch_id ;
344: --AND EXISTS (SELECT 'X'
345: -- FROM cn_sca_lines_output_gtt cslog
346: -- WHERE cslog.sca_headers_interface_id = cshig.sca_headers_interface_id
347: -- AND revenue_type = 'REVENUE');
348:
349: -- if no output was created then

Line 355: FROM cn_sca_lines_output_gtt cslog

351: UPDATE cn_sca_headers_interface_gtt cshig set
352: PROCESS_STATUS = 'NOT ALLOCATED'
353: WHERE sca_batch_id = x_batch_id
354: AND NOT EXISTS (SELECT 'X'
355: FROM cn_sca_lines_output_gtt cslog
356: WHERE cslog.sca_headers_interface_id = cshig.sca_headers_interface_id
357: AND revenue_type = 'REVENUE');
358:
359: -- if no output was created then