1: PACKAGE BODY fun_seq_batch AS
2: /* $Header: funsqbtb.pls 120.43.12010000.4 2010/01/18 12:17:35 degoel ship $ */
3: --
4: -- For debuggin
5: --
2: /* $Header: funsqbtb.pls 120.43.12010000.4 2010/01/18 12:17:35 degoel ship $ */
3: --
4: -- For debuggin
5: --
6: g_module CONSTANT VARCHAR2(30) := 'fun.plsql.fun_seq_batch';
7: -- added global variable for sort by GL Date at posting event
8: g_sort_option_code fun_seq_contexts.sort_option%TYPE;
9: -- PROCEDURE NAME:
10: -- Batch_Init
4: -- For debuggin
5: --
6: g_module CONSTANT VARCHAR2(30) := 'fun.plsql.fun_seq_batch';
7: -- added global variable for sort by GL Date at posting event
8: g_sort_option_code fun_seq_contexts.sort_option%TYPE;
9: -- PROCEDURE NAME:
10: -- Batch_Init
11: -- *** For XLA Accounting Program ***
12: -- DESCRIPTION:
9: -- PROCEDURE NAME:
10: -- Batch_Init
11: -- *** For XLA Accounting Program ***
12: -- DESCRIPTION:
13: -- Populate Sequencing setup data in fun_seq_request
14: -- This procedure is called from Accounting and Reporting Sequencing
15: -- Program.
16: -- INPUT:
17: -- - p_application_id
47: x_status OUT NOCOPY VARCHAR2,
48: x_seq_context_id OUT NOCOPY NUMBER)
49: IS
50: PRAGMA AUTONOMOUS_TRANSACTION;
51: l_seq_context_id fun_seq_contexts.seq_context_id%TYPE;
52: l_control_date_type fun_seq_contexts.date_type%TYPE;
53: l_req_assign_flag fun_seq_contexts.require_assign_flag%TYPE;
54: l_sort_option_code fun_seq_contexts.sort_option%TYPE;
55: l_sequence_type fun_seq_headers.gapless_flag%TYPE;
48: x_seq_context_id OUT NOCOPY NUMBER)
49: IS
50: PRAGMA AUTONOMOUS_TRANSACTION;
51: l_seq_context_id fun_seq_contexts.seq_context_id%TYPE;
52: l_control_date_type fun_seq_contexts.date_type%TYPE;
53: l_req_assign_flag fun_seq_contexts.require_assign_flag%TYPE;
54: l_sort_option_code fun_seq_contexts.sort_option%TYPE;
55: l_sequence_type fun_seq_headers.gapless_flag%TYPE;
56:
49: IS
50: PRAGMA AUTONOMOUS_TRANSACTION;
51: l_seq_context_id fun_seq_contexts.seq_context_id%TYPE;
52: l_control_date_type fun_seq_contexts.date_type%TYPE;
53: l_req_assign_flag fun_seq_contexts.require_assign_flag%TYPE;
54: l_sort_option_code fun_seq_contexts.sort_option%TYPE;
55: l_sequence_type fun_seq_headers.gapless_flag%TYPE;
56:
57: l_seq_context_found BOOLEAN DEFAULT FALSE;
50: PRAGMA AUTONOMOUS_TRANSACTION;
51: l_seq_context_id fun_seq_contexts.seq_context_id%TYPE;
52: l_control_date_type fun_seq_contexts.date_type%TYPE;
53: l_req_assign_flag fun_seq_contexts.require_assign_flag%TYPE;
54: l_sort_option_code fun_seq_contexts.sort_option%TYPE;
55: l_sequence_type fun_seq_headers.gapless_flag%TYPE;
56:
57: l_seq_context_found BOOLEAN DEFAULT FALSE;
58: l_module CONSTANT VARCHAR2(100) DEFAULT
51: l_seq_context_id fun_seq_contexts.seq_context_id%TYPE;
52: l_control_date_type fun_seq_contexts.date_type%TYPE;
53: l_req_assign_flag fun_seq_contexts.require_assign_flag%TYPE;
54: l_sort_option_code fun_seq_contexts.sort_option%TYPE;
55: l_sequence_type fun_seq_headers.gapless_flag%TYPE;
56:
57: l_seq_context_found BOOLEAN DEFAULT FALSE;
58: l_module CONSTANT VARCHAR2(100) DEFAULT
59: g_module || '.' || 'batch_init';
82: -- Retrieve Sequencing Context Information
83: --
84: IF p_context_value_tbl.COUNT > 0 THEN
85: FOR i IN p_context_value_tbl.FIRST .. p_context_value_tbl.LAST LOOP
86: fun_seq.get_assign_context_info(
87: p_context_type => p_context_type,
88: p_context_value => p_context_value_tbl(i),
89: p_application_id => p_application_id,
90: p_table_name => p_table_name,
95: x_req_assign_flag => l_req_assign_flag,
96: x_sort_option_code => l_sort_option_code);
97:
98: --
99: -- Create Sequencing Setup Records in FUN_SEQ_REQUESTS
100: --
101: IF l_seq_context_id IS NOT NULL THEN
102: --
103: -- Make Sequencing Setup pages display only
156:
157: -- PROCEDURE NAME:
158: -- Batch_Init
159: -- DESCRIPTION:
160: -- Populate Sequencing setup data in fun_seq_request
161: -- **** For GL Posting Program ****
162: PROCEDURE Batch_Init(
163: p_request_id IN NUMBER,
164: p_ledgers_tbl IN num15_tbl_type,
165: x_ledgers_locked_tbl OUT NOCOPY num15_tbl_type,
166: x_ledgers_locked_cnt OUT NOCOPY NUMBER) IS
167:
168: PRAGMA AUTONOMOUS_TRANSACTION;
169: l_seq_context_id fun_seq_contexts.seq_context_id%TYPE;
170: l_date_type fun_seq_contexts.date_type%TYPE;
171: l_req_assign_flag fun_seq_contexts.require_assign_flag%TYPE;
172: l_sort_option_code fun_seq_contexts.sort_option%TYPE;
173: l_assign_id_tbl assign_id_tbl_type;
166: x_ledgers_locked_cnt OUT NOCOPY NUMBER) IS
167:
168: PRAGMA AUTONOMOUS_TRANSACTION;
169: l_seq_context_id fun_seq_contexts.seq_context_id%TYPE;
170: l_date_type fun_seq_contexts.date_type%TYPE;
171: l_req_assign_flag fun_seq_contexts.require_assign_flag%TYPE;
172: l_sort_option_code fun_seq_contexts.sort_option%TYPE;
173: l_assign_id_tbl assign_id_tbl_type;
174: l_seq_type_tbl seq_type_tbl_type;
167:
168: PRAGMA AUTONOMOUS_TRANSACTION;
169: l_seq_context_id fun_seq_contexts.seq_context_id%TYPE;
170: l_date_type fun_seq_contexts.date_type%TYPE;
171: l_req_assign_flag fun_seq_contexts.require_assign_flag%TYPE;
172: l_sort_option_code fun_seq_contexts.sort_option%TYPE;
173: l_assign_id_tbl assign_id_tbl_type;
174: l_seq_type_tbl seq_type_tbl_type;
175: l_seq_head_id_tbl seq_head_id_tbl_type;
168: PRAGMA AUTONOMOUS_TRANSACTION;
169: l_seq_context_id fun_seq_contexts.seq_context_id%TYPE;
170: l_date_type fun_seq_contexts.date_type%TYPE;
171: l_req_assign_flag fun_seq_contexts.require_assign_flag%TYPE;
172: l_sort_option_code fun_seq_contexts.sort_option%TYPE;
173: l_assign_id_tbl assign_id_tbl_type;
174: l_seq_type_tbl seq_type_tbl_type;
175: l_seq_head_id_tbl seq_head_id_tbl_type;
176:
198: FOR i IN p_ledgers_tbl.FIRST .. p_ledgers_tbl.LAST LOOP
199: --
200: -- Retrieve Sequencing Context Information
201: --
202: fun_seq.get_assign_context_info(
203: p_context_type => 'LEDGER_AND_CURRENCY',
204: p_context_value => p_ledgers_tbl(i),
205: p_application_id => 101,
206: p_table_name => 'GL_JE_HEADERS',
212: x_sort_option_code => l_sort_option_code);
213:
214: --
215: -- If a valid sequencing context is found,
216: -- insert a record into fun_seq_requests.
217: --
218: IF l_seq_context_id IS NOT NULL THEN
219: populate_seq_requests (
220: p_request_id => p_request_id,
267:
268: --
269: -- Procedure Name: Batch_Exit
270: -- Description:
271: -- Unlocks setup data by deleting records from fun_seq_requests
272: -- The exception in this program is not considered critical.
273: -- So, even if the caller receives 'FAILURE', they should not
274: -- raise an exception.
275: -- INPUT
370:
371: l_seq_ver_id_tbl seq_ver_id_tbl_type;
372: l_assign_id_tbl assign_id_tbl_type;
373:
374: l_current_value fun_seq_versions.current_value%TYPE;
375: l_sequenced_date DATE;
376: l_error_code VARCHAR2(30);
377:
378: l_module CONSTANT VARCHAR2(100) DEFAULT
384: --
385: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
386: FND_LOG.STRING(
387: FND_LOG.LEVEL_PROCEDURE,
388: 'fun.plsql.fun_seq_batch.generate_bulk_numbers.begin',
389: 'Beginning of generate_bulk_numbers');
390: END IF;
391: --
392: -- Hold parameters in local variables
410: IF (ind_prior IS NULL) OR
411: (l_assign_id_tbl(ind_prior) <> l_assign_id_tbl(i) OR
412: l_seq_ver_id_tbl(ind_prior) <> l_seq_ver_id_tbl(i))
413: THEN
414: fun_seq.generate_sequence_number(
415: p_assignment_id => l_assign_id_tbl(i),
416: p_seq_version_id => l_seq_ver_id_tbl(i),
417: p_sequence_type => 'G',
418: p_request_id => NVL(p_request_id,-99),
443: THEN
444: --
445: -- Update the current_value
446: --
447: UPDATE fun_seq_versions
448: SET current_value = l_current_value
449: WHERE seq_version_id = l_seq_ver_id_tbl(i);
450: END IF; -- Update the Last Used Number or Not
451: END IF; -- Call Generate Sequence Number or Not
456: --
457: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
458: FND_LOG.STRING(
459: FND_LOG.LEVEL_PROCEDURE,
460: 'fun.plsql.fun_seq_batch.generate_bulk_numbers.end',
461: 'Generate_bulk_numbers completes successfully.');
462: END IF;
463: EXCEPTION
464: WHEN OTHERS THEN
495: --
496: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
497: FND_LOG.STRING(
498: FND_LOG.LEVEL_PROCEDURE,
499: 'fun.plsql.fun_seq_batch.populate_acct_seq_info.begin',
500: 'Calling fun_seq_batch.populate_acct_seq_info:'||
501: 'p_calling_program => ' || p_calling_program ||', ' ||
502: 'p_request_id => ' || p_request_id );
503: END IF;
496: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
497: FND_LOG.STRING(
498: FND_LOG.LEVEL_PROCEDURE,
499: 'fun.plsql.fun_seq_batch.populate_acct_seq_info.begin',
500: 'Calling fun_seq_batch.populate_acct_seq_info:'||
501: 'p_calling_program => ' || p_calling_program ||', ' ||
502: 'p_request_id => ' || p_request_id );
503: END IF;
504:
517: --
518: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
519: FND_LOG.STRING(
520: FND_LOG.LEVEL_PROCEDURE,
521: 'fun.plsql.fun_seq_batch.populate_acct_seq_info.end',
522: 'Calling fun_seq_batch.populate_acct_seq_info:'||
523: 'p_calling_program => ' || p_calling_program ||', ' ||
524: 'p_request_id => ' || p_request_id );
525: END IF;
518: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
519: FND_LOG.STRING(
520: FND_LOG.LEVEL_PROCEDURE,
521: 'fun.plsql.fun_seq_batch.populate_acct_seq_info.end',
522: 'Calling fun_seq_batch.populate_acct_seq_info:'||
523: 'p_calling_program => ' || p_calling_program ||', ' ||
524: 'p_request_id => ' || p_request_id );
525: END IF;
526: EXCEPTION
531: IF fnd_log.level_error >= fnd_log.g_current_runtime_level THEN
532: fnd_log.string(
533: log_level => fnd_log.level_error,
534: module
535: => 'fun.plsql.fun_seq_batch.populate_acct_seq_info.error',
536: message => 'p_request_id: ' || p_request_id ||', ' ||
537: 'SQLERRM: ' || SQLERRM);
538: END IF;
539: --
538: END IF;
539: --
540: -- Raise Exception
541: --
542: fnd_message.set_name ('FUN','FUN_SEQ_NO_ACTIVE_ASSGN_FOUND');
543: fnd_message.set_token ('SEQ_CONTEXT_NAME',
544: fun_seq.get_seq_context_name(null));
545: app_exception.raise_exception;
546: WHEN OTHERS THEN
540: -- Raise Exception
541: --
542: fnd_message.set_name ('FUN','FUN_SEQ_NO_ACTIVE_ASSGN_FOUND');
543: fnd_message.set_token ('SEQ_CONTEXT_NAME',
544: fun_seq.get_seq_context_name(null));
545: app_exception.raise_exception;
546: WHEN OTHERS THEN
547: --
548: -- Logging
550: IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
551: fnd_log.string(
552: log_level => fnd_log.level_exception,
553: module
554: => 'fun.plsql.fun_seq_batch.populate_acct_seq_info.exception',
555: message => 'p_request_id: ' || p_request_id ||', ' ||
556: 'SQLERRM: ' || SQLERRM);
557: END IF;
558: --
573: l_je_source_tbl je_source_tbl_type;
574: l_je_category_tbl je_category_tbl_type;
575: l_gl_date_tbl date_tbl_type;
576:
577: l_ctrl_attr_rec fun_seq.control_attribute_rec_type;
578: l_ctrl_date_tbl fun_seq.control_date_tbl_type
579: := fun_seq.control_date_tbl_type();
580:
581: l_seq_ver_id_tbl seq_ver_id_tbl_type;
574: l_je_category_tbl je_category_tbl_type;
575: l_gl_date_tbl date_tbl_type;
576:
577: l_ctrl_attr_rec fun_seq.control_attribute_rec_type;
578: l_ctrl_date_tbl fun_seq.control_date_tbl_type
579: := fun_seq.control_date_tbl_type();
580:
581: l_seq_ver_id_tbl seq_ver_id_tbl_type;
582: l_assign_id_tbl assign_id_tbl_type;
575: l_gl_date_tbl date_tbl_type;
576:
577: l_ctrl_attr_rec fun_seq.control_attribute_rec_type;
578: l_ctrl_date_tbl fun_seq.control_date_tbl_type
579: := fun_seq.control_date_tbl_type();
580:
581: l_seq_ver_id_tbl seq_ver_id_tbl_type;
582: l_assign_id_tbl assign_id_tbl_type;
583: l_out_ctrl_dt_tbl date_tbl_type;
584: l_req_assign_flag_tbl req_assign_flag_tbl_type;
585: l_error_code_tbl error_code_tbl_type;
586: l_dummy_tbl vc30_tbl_type; -- For Sort Option
587:
588: l_dummy fun_seq_headers.gapless_flag%TYPE;
589: no_assigned_seq_info EXCEPTION;
590:
591: l_debug_je_header_id NUMBER;
592: BEGIN
595: --
596: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
597: FND_LOG.STRING(
598: FND_LOG.LEVEL_PROCEDURE,
599: 'fun.plsql.fun_seq_batch.populate_seq_info.begin',
600: 'Beginning of Populate_Seq_Info');
601: END IF;
602: --
603: -- GL date is the only Sequence Control Date Type
607: l_ctrl_date_tbl(1).date_type := 'GL_DATE';
608: -- gl date is populated within the loop
609:
610: --
611: -- Bulk Collect Journal Entry Information from fun_seq_batch_gt
612: --
613: SELECT jh.ledger_id,
614: bg.source_id,
615: jh.actual_flag,
622: l_actual_flag_tbl,
623: l_je_source_tbl,
624: l_je_category_tbl,
625: l_gl_date_tbl
626: FROM fun_seq_batch_gt bg,
627: gl_je_headers jh
628: WHERE bg.source_id = jh.je_header_id;
629: --
630: -- Loop for journal entries in fun_seq_batch_gt
626: FROM fun_seq_batch_gt bg,
627: gl_je_headers jh
628: WHERE bg.source_id = jh.je_header_id;
629: --
630: -- Loop for journal entries in fun_seq_batch_gt
631: --
632: FOR i IN l_je_header_id_tbl.FIRST .. l_je_header_id_tbl.LAST LOOP
633: l_debug_je_header_id := l_je_header_id_tbl(i);
634: --
643: --
644: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
645: FND_LOG.STRING(
646: FND_LOG.LEVEL_PROCEDURE,
647: 'fun.plsql.fun_seq_batch.populate_seq_info.config',
648: 'Calling fun_seq.get_assigned_sequence_info... '
649: ||', '||
650: 'l_debug_je_header_id: '
651: || l_debug_je_header_id ||', '||
644: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
645: FND_LOG.STRING(
646: FND_LOG.LEVEL_PROCEDURE,
647: 'fun.plsql.fun_seq_batch.populate_seq_info.config',
648: 'Calling fun_seq.get_assigned_sequence_info... '
649: ||', '||
650: 'l_debug_je_header_id: '
651: || l_debug_je_header_id ||', '||
652: 'l_ctrl_date_tbl(1).date_value (GL_DATE): '
661: END IF;
662: --
663: -- Get Sequencing Context and Assignment Information
664: --
665: fun_seq.get_assigned_sequence_info(
666: p_context_type => 'LEDGER_AND_CURRENCY',
667: p_context_value => l_ledger_id_tbl(i),
668: p_application_Id => 101,
669: p_table_name => 'GL_JE_HEADERS',
685: --
686: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
687: FND_LOG.STRING(
688: FND_LOG.LEVEL_PROCEDURE,
689: 'fun.plsql.fun_seq_batch.populate_seq_info.config',
690: 'Returning from fun_seq.get_assigned_sequence_info... '
691: ||', '||
692: 'l_seq_ver_id_tbl(i): ' || l_seq_ver_id_tbl(i) ||', '||
693: 'l_assign_id_tbl(i): ' || l_assign_id_tbl(i) ||', '||
686: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
687: FND_LOG.STRING(
688: FND_LOG.LEVEL_PROCEDURE,
689: 'fun.plsql.fun_seq_batch.populate_seq_info.config',
690: 'Returning from fun_seq.get_assigned_sequence_info... '
691: ||', '||
692: 'l_seq_ver_id_tbl(i): ' || l_seq_ver_id_tbl(i) ||', '||
693: 'l_assign_id_tbl(i): ' || l_assign_id_tbl(i) ||', '||
694: 'l_out_ctrl_dt_tbl(i): '|| l_out_ctrl_dt_tbl(i)||', '||
702: -- Meaning of each Status
703: -- [No action is required]
704: -- NO_ASSIGN_CONTEXT
705: -- NO_ASSIGNMENT
706: -- [Update GL_JE_HEADERS with the information in FUN_SEQ_BATCH_GT
707: -- DO_NOT_SEQUENCE
708: -- SEQ_VER_FOUND
709: -- [Critical Error]
710: -- ENFORCE_NO_ASSIGNMENT
713: RAISE no_assigned_seq_info;
714: END IF;
715: END LOOP;
716: --
717: -- Bulk Update fun_seq_batch_gt
718: --
719: IF l_assign_id_tbl.COUNT > 0 THEN
720: FORALL i IN l_assign_id_tbl.FIRST .. l_assign_id_tbl.LAST
721: UPDATE fun_seq_batch_gt
717: -- Bulk Update fun_seq_batch_gt
718: --
719: IF l_assign_id_tbl.COUNT > 0 THEN
720: FORALL i IN l_assign_id_tbl.FIRST .. l_assign_id_tbl.LAST
721: UPDATE fun_seq_batch_gt
722: SET assignment_id = l_assign_id_tbl(i),
723: seq_version_id = l_seq_ver_id_tbl(i),
724: status_code = l_error_code_tbl(i)
725: WHERE source_id = l_je_header_id_tbl(i);
729: --
730: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
731: FND_LOG.STRING(
732: FND_LOG.LEVEL_PROCEDURE,
733: 'fun.plsql.fun_seq_batch.populate_seq_info.end',
734: 'Populate_Seq_Info completes successfully.');
735: END IF;
736: EXCEPTION
737: WHEN no_assigned_seq_info THEN
738: --
739: -- Logging
740: --
741: IF fnd_log.level_error >= fnd_log.g_current_runtime_level THEN
742: -- Retrieve FUN_SEQ_NO_ACTIVE_ASSGN_FOUND from the message stack
743: -- and clear the message from the message stack.
744: -- See fun_seq.get_assigned_seq_info.
745: -- This is necessary to use the shorter version of the message
746: -- for concurrent program logs of posting program. Message text
740: --
741: IF fnd_log.level_error >= fnd_log.g_current_runtime_level THEN
742: -- Retrieve FUN_SEQ_NO_ACTIVE_ASSGN_FOUND from the message stack
743: -- and clear the message from the message stack.
744: -- See fun_seq.get_assigned_seq_info.
745: -- This is necessary to use the shorter version of the message
746: -- for concurrent program logs of posting program. Message text
747: -- longer than 70 chars is not allowed in Pro*C code.
748: -- The longer version is stored in the database via FND logging.
748: -- The longer version is stored in the database via FND logging.
749: fnd_log.string (
750: log_level => fnd_log.level_error,
751: module
752: => 'fun.plsql.fun_seq_batch.populate_seq_info.exception',
753: message
754: => 'EXCEPTION: no_assigned_seq_info' || ', ' ||
755: fnd_message.get); -- Retrive mesg from the stack
756: END IF;
756: END IF;
757: --
758: -- Set the shorter version of the error message on the stack
759: --
760: fnd_message.set_name ('FUN','FUN_SEQ_NO_ACTIVE_ASSGN_SHORT');
761: --
762: -- Raise Exception
763: --
764: app_exception.raise_exception;
768: --
769: IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
770: fnd_log.string(
771: log_level => fnd_log.level_exception,
772: module => 'fun.plsql.fun_seq_batch.populate_seq_info',
773: message => 'SQLERRM: ' || SQLERRM);
774: END IF;
775: --
776: -- Raise Exception
799: --
800: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
801: FND_LOG.STRING(
802: FND_LOG.LEVEL_PROCEDURE,
803: 'fun.plsql.fun_seq_batch.populate_numbers.begin',
804: 'Beginning of populate_numbers');
805: END IF;
806: --
807: -- Bulk Collect Sequence Info. for GL Journal Entries
816: BULK COLLECT
817: INTO l_source_id_tbl,
818: l_seq_ver_id_tbl,
819: l_assign_id_tbl
820: FROM fun_seq_batch_gt bg,
821: gl_je_headers jh
822: WHERE jh.je_header_id =bg.source_id and
823: bg.status_code = 'SEQ_VER_FOUND'
824: ORDER BY bg.seq_version_id,
831: BULK COLLECT
832: INTO l_source_id_tbl,
833: l_seq_ver_id_tbl,
834: l_assign_id_tbl
835: FROM fun_seq_batch_gt
836: WHERE status_code = 'SEQ_VER_FOUND'
837: ORDER BY seq_version_id,
838: assignment_id;
839: END IF;
847: p_assign_id_tbl => l_assign_id_tbl,
848: x_seq_value_tbl => l_seq_value_tbl,
849: x_seq_date_tbl => l_seq_date_tbl); -- Not used here
850: --
851: -- Bulk Update fun_seq_batch_gt
852: --
853: IF l_source_id_tbl.COUNT > 0 THEN
854: FORALL i IN l_source_id_tbl.FIRST..l_source_id_tbl.LAST
855: UPDATE fun_seq_batch_gt gt
851: -- Bulk Update fun_seq_batch_gt
852: --
853: IF l_source_id_tbl.COUNT > 0 THEN
854: FORALL i IN l_source_id_tbl.FIRST..l_source_id_tbl.LAST
855: UPDATE fun_seq_batch_gt gt
856: SET gt.seq_version_id = l_seq_ver_id_tbl(i),
857: gt.assignment_id = l_assign_id_tbl(i),
858: gt.seq_value = l_seq_value_tbl(i)
859: WHERE gt.source_id = l_source_id_tbl(i);
863: --
864: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
865: FND_LOG.STRING(
866: FND_LOG.LEVEL_PROCEDURE,
867: 'fun.plsql.fun_seq_batch.populate_numbers.end',
868: 'Populate_numbers completes successfully.');
869: END IF;
870: --
871: -- Return posting date
878: --
879: IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
880: fnd_log.string (
881: log_level => fnd_log.level_exception,
882: module => 'fun.plsql.fun_seq_batch.populate_numbers.exception',
883: message => 'SQLERRM: ' || SQLERRM);
884: END IF;
885: --
886: -- Raise Exception
909: --
910: fnd_file.put_line(fnd_file.log, 'Starting Release_Lock... ');
911: --
912: -- If p_request_id is null, delete all complete requests from
913: -- fun_seq_requests
914: --
915: delete_seq_requests(p_request_id => p_request_id);
916: --
917: -- Populate Return Values 'SUCCESS'
949: l_module CONSTANT VARCHAR2(100) DEFAULT
950: g_module || '.' || 'populate_seq_requests';
951: BEGIN
952: --
953: -- Populate Sequencing Context in Fun_Seq_Requests
954: --
955: Populate_Seq_Context (
956: p_request_id => p_request_id,
957: p_seq_context_id => p_seq_context_id);
956: p_request_id => p_request_id,
957: p_seq_context_id => p_seq_context_id);
958:
959: --
960: -- Populate Sequence Headers in Fun_Seq_Requests
961: --
962: Populate_Seq_Headers (
963: p_request_id => p_request_id,
964: p_Seq_Context_Id => p_seq_context_id);
993: BEGIN
994: l_user_id := fnd_global.user_id;
995: l_login_id := fnd_global.login_id;
996:
997: INSERT INTO fun_seq_requests (
998: request_id,
999: source_type,
1000: source_id,
1001: last_update_date,
1048:
1049: SELECT sa.seq_header_id
1050: BULK COLLECT
1051: INTO l_seq_headers
1052: FROM fun_seq_assignments sa
1053: WHERE sa.seq_context_id = p_seq_context_id
1054: AND sa.use_status_code IN ('NEW','USED');
1055:
1056: IF l_seq_headers.COUNT > 0 THEN
1054: AND sa.use_status_code IN ('NEW','USED');
1055:
1056: IF l_seq_headers.COUNT > 0 THEN
1057: FORALL i IN l_seq_headers.FIRST .. l_seq_headers.LAST
1058: INSERT INTO fun_seq_requests(
1059: request_id,
1060: source_type,
1061: source_id,
1062: last_update_date,
1114: pragma exception_init(more_rows, -1422);
1115:
1116: BEGIN
1117: --
1118: -- Bulk collect request ids in fun_seq_requests
1119: --
1120: IF p_request_id IS NULL THEN
1121: SELECT request_id
1122: BULK COLLECT
1120: IF p_request_id IS NULL THEN
1121: SELECT request_id
1122: BULK COLLECT
1123: INTO l_req_id_tbl
1124: FROM fun_seq_requests;
1125:
1126: ELSE
1127:
1128: begin
1132: select distinct phase_code into l_phase_code from fnd_concurrent_requests
1133: where parent_request_id= p_request_id;
1134: -- all childs completed
1135: if l_phase_code ='C' then
1136: delete from fun_seq_requests where request_id=p_request_id;
1137: -- childs may be pending or paused ..
1138: else
1139: null; -- do not release the lock
1140: end if;
1140: end if;
1141: EXCEPTION
1142: -- this is not a parent request
1143: WHEN NO_DATA_FOUND THEN
1144: delete from fun_seq_requests where request_id=p_request_id;
1145: -- all child are not completed yet
1146: WHEN more_rows THEN
1147: null;
1148: end;
1176: --
1177: IF l_comp_req_id_tbl.COUNT > 0 THEN
1178: FORALL i IN INDICES OF l_comp_req_id_tbl
1179: DELETE
1180: FROM fun_seq_requests
1181: WHERE request_id = l_comp_req_id_tbl(i);
1182: END IF;
1183: END IF;
1184:
1220: l_out_ctrl_dt_tbl date_tbl_type;
1221: l_req_assign_flag_tbl req_assign_flag_tbl_type;
1222: l_error_code_tbl error_code_tbl_type;
1223:
1224: l_ctrl_attr_rec fun_seq.control_attribute_rec_type;
1225: l_ctrl_date_tbl fun_seq.control_date_tbl_type
1226: := fun_seq.control_date_tbl_type();
1227:
1228: --
1221: l_req_assign_flag_tbl req_assign_flag_tbl_type;
1222: l_error_code_tbl error_code_tbl_type;
1223:
1224: l_ctrl_attr_rec fun_seq.control_attribute_rec_type;
1225: l_ctrl_date_tbl fun_seq.control_date_tbl_type
1226: := fun_seq.control_date_tbl_type();
1227:
1228: --
1229: -- Values to be stored in XLA View
1222: l_error_code_tbl error_code_tbl_type;
1223:
1224: l_ctrl_attr_rec fun_seq.control_attribute_rec_type;
1225: l_ctrl_date_tbl fun_seq.control_date_tbl_type
1226: := fun_seq.control_date_tbl_type();
1227:
1228: --
1229: -- Values to be stored in XLA View
1230: --
1241: l_sorted_seq_value_tbl seq_value_tbl_type;
1242:
1243: l_sorted_seq_date_tbl date_tbl_type;
1244:
1245: l_dummy fun_seq_headers.gapless_flag%TYPE;
1246: l_sort_option_code fun_seq_contexts.sort_option%TYPE;
1247: l_date_dummy_tbl date_tbl_type; -- For Sorting Key
1248:
1249: no_assigned_seq_info EXCEPTION;
1242:
1243: l_sorted_seq_date_tbl date_tbl_type;
1244:
1245: l_dummy fun_seq_headers.gapless_flag%TYPE;
1246: l_sort_option_code fun_seq_contexts.sort_option%TYPE;
1247: l_date_dummy_tbl date_tbl_type; -- For Sorting Key
1248:
1249: no_assigned_seq_info EXCEPTION;
1250: j BINARY_INTEGER DEFAULT 1;
1256: --
1257: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1258: FND_LOG.STRING(
1259: FND_LOG.LEVEL_PROCEDURE,
1260: 'fun.plsql.fun_seq_batch.populate_acct_seq_prog_view.begin',
1261: 'p_request_id => ' || p_request_id );
1262: END IF;
1263:
1264: --
1320: --
1321: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1322: FND_LOG.STRING(
1323: FND_LOG.LEVEL_PROCEDURE,
1324: 'fun.plsql.fun_seq_batch.populate_acct_seq_prog_view.config',
1325: 'Before calling fun_seq.get_assigned_sequence_info... '
1326: ||', '||
1327: 'l_debug_ae_header_id: '
1328: || l_debug_ae_header_id ||', '||
1321: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1322: FND_LOG.STRING(
1323: FND_LOG.LEVEL_PROCEDURE,
1324: 'fun.plsql.fun_seq_batch.populate_acct_seq_prog_view.config',
1325: 'Before calling fun_seq.get_assigned_sequence_info... '
1326: ||', '||
1327: 'l_debug_ae_header_id: '
1328: || l_debug_ae_header_id ||', '||
1329: 'l_ctrl_date_tbl(1).date_value: '
1344: END IF;
1345: --
1346: -- Get Assignment and Version
1347: --
1348: fun_seq.get_assigned_sequence_info(
1349: p_context_type => 'LEDGER_AND_CURRENCY',
1350: p_context_value => l_ledger_id_tbl(i),
1351: p_application_Id => 602,
1352: p_table_name => 'XLA_AE_HEADERS',
1367: --
1368: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1369: FND_LOG.STRING(
1370: FND_LOG.LEVEL_PROCEDURE,
1371: 'fun.plsql.fun_seq_batch.populate_acct_seq_prog_view.config',
1372: 'After calling fun_seq.get_assigned_sequence_info... '
1373: ||', '||
1374: 'l_seq_ver_id_tbl(i): ' || l_seq_ver_id_tbl(i) ||', '||
1375: 'l_assign_id_tbl(i): ' || l_assign_id_tbl(i) ||', '||
1368: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1369: FND_LOG.STRING(
1370: FND_LOG.LEVEL_PROCEDURE,
1371: 'fun.plsql.fun_seq_batch.populate_acct_seq_prog_view.config',
1372: 'After calling fun_seq.get_assigned_sequence_info... '
1373: ||', '||
1374: 'l_seq_ver_id_tbl(i): ' || l_seq_ver_id_tbl(i) ||', '||
1375: 'l_assign_id_tbl(i): ' || l_assign_id_tbl(i) ||', '||
1376: 'l_out_ctrl_dt_tbl(i): '|| l_out_ctrl_dt_tbl(i)||', '||
1458: --
1459: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1460: FND_LOG.STRING(
1461: FND_LOG.LEVEL_PROCEDURE,
1462: 'fun.plsql.fun_seq_batchpopulate_acct_seq_prog_view.end',
1463: 'p_request_id: ' || p_request_id );
1464: END IF;
1465:
1466: EXCEPTION
1470: --
1471: IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
1472: fnd_log.string(
1473: fnd_log.level_exception,
1474: 'fun.plsql.fun_seq_batch.populate_acct_seq_prog_view',
1475: 'p_request_id: ' || p_request_id ||', ' ||
1476: 'ae_header_id: ' || l_debug_ae_header_id|| ', ' ||
1477: 'SQLERRM: ' || SQLERRM);
1478: END IF;
1478: END IF;
1479: --
1480: -- Raise Exception
1481: --
1482: fnd_message.set_name ('FUN','FUN_SEQ_NO_ACTIVE_ASSGN_FOUND');
1483: fnd_message.set_token ('SEQ_CONTEXT_NAME',
1484: fun_seq.get_seq_context_name(null));
1485: app_exception.raise_exception;
1486: WHEN OTHERS THEN
1480: -- Raise Exception
1481: --
1482: fnd_message.set_name ('FUN','FUN_SEQ_NO_ACTIVE_ASSGN_FOUND');
1483: fnd_message.set_token ('SEQ_CONTEXT_NAME',
1484: fun_seq.get_seq_context_name(null));
1485: app_exception.raise_exception;
1486: WHEN OTHERS THEN
1487: --
1488: -- Logging
1489: --
1490: IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
1491: fnd_log.string(
1492: fnd_log.level_exception,
1493: 'fun.plsql.fun_seq_batch.populate_acct_seq_prog_view',
1494: 'Unexpected exception in Populate_Acct_Seq_Prog_View' || ', ' ||
1495: 'p_request_id: ' || p_request_id ||', ' ||
1496: 'ae_header_id: ' || l_debug_ae_header_id|| ', ' ||
1497: 'SQLERRM: ' || SQLERRM);
1516: l_gl_date_tbl date_tbl_type;
1517: l_reference_date_tbl date_tbl_type;
1518: l_completion_date_tbl date_tbl_type; -- Completion /Posted Date
1519:
1520: l_ctrl_attr_rec fun_seq.control_attribute_rec_type;
1521: l_ctrl_date_tbl fun_seq.control_date_tbl_type
1522: := fun_seq.control_date_tbl_type();
1523:
1524: --
1517: l_reference_date_tbl date_tbl_type;
1518: l_completion_date_tbl date_tbl_type; -- Completion /Posted Date
1519:
1520: l_ctrl_attr_rec fun_seq.control_attribute_rec_type;
1521: l_ctrl_date_tbl fun_seq.control_date_tbl_type
1522: := fun_seq.control_date_tbl_type();
1523:
1524: --
1525: -- Values to be stored in the XLA Temporary Table
1518: l_completion_date_tbl date_tbl_type; -- Completion /Posted Date
1519:
1520: l_ctrl_attr_rec fun_seq.control_attribute_rec_type;
1521: l_ctrl_date_tbl fun_seq.control_date_tbl_type
1522: := fun_seq.control_date_tbl_type();
1523:
1524: --
1525: -- Values to be stored in the XLA Temporary Table
1526: --
1539: l_req_assign_flag_tbl req_assign_flag_tbl_type;
1540: l_sorting_key_tbl date_tbl_type;
1541: l_error_code_tbl error_code_tbl_type;
1542:
1543: l_sort_option_code fun_seq_contexts.sort_option%TYPE;
1544: l_dummy fun_seq_headers.gapless_flag%TYPE;
1545:
1546: l_sorted_application_id_tbl num_tbl_type;
1547: l_sorted_ae_header_id_tbl ae_header_id_tbl_type;
1540: l_sorting_key_tbl date_tbl_type;
1541: l_error_code_tbl error_code_tbl_type;
1542:
1543: l_sort_option_code fun_seq_contexts.sort_option%TYPE;
1544: l_dummy fun_seq_headers.gapless_flag%TYPE;
1545:
1546: l_sorted_application_id_tbl num_tbl_type;
1547: l_sorted_ae_header_id_tbl ae_header_id_tbl_type;
1548: l_sorted_seq_ver_id_tbl seq_ver_id_tbl_type;
1569: --
1570: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1571: FND_LOG.STRING(
1572: FND_LOG.LEVEL_PROCEDURE,
1573: 'fun.plsql.fun_seq_batch.populate_rep_seq_prog_gt.begin',
1574: 'p_request_id => ' || p_request_id );
1575: END IF;
1576:
1577: --
1641: --
1642: IF (FND_LOG.LEVEL_EVENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1643: FND_LOG.STRING(
1644: FND_LOG.LEVEL_EVENT,
1645: 'fun.plsql.fun_seq_batch.populate_rep_seq_prog_gt.config',
1646: 'Before calling fun_seq.get_assigned_sequence_info... '
1647: ||', '||
1648: 'l_debug_ae_header_id: '
1649: || l_debug_ae_header_id ||', '||
1642: IF (FND_LOG.LEVEL_EVENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1643: FND_LOG.STRING(
1644: FND_LOG.LEVEL_EVENT,
1645: 'fun.plsql.fun_seq_batch.populate_rep_seq_prog_gt.config',
1646: 'Before calling fun_seq.get_assigned_sequence_info... '
1647: ||', '||
1648: 'l_debug_ae_header_id: '
1649: || l_debug_ae_header_id ||', '||
1650: 'l_ctrl_date_tbl(1).date_value: '
1661: --
1662: -- Sorting options of sequencing contexts are identical
1663: -- within the temporary table.
1664: --
1665: fun_seq.get_assigned_sequence_info(
1666: p_context_type => 'LEDGER_AND_CURRENCY',
1667: p_context_value => l_ledger_id_tbl(i),
1668: p_application_id => l_application_id_tbl(i),
1669: p_table_name => l_table_name_tbl(i),
1685: --
1686: IF (FND_LOG.LEVEL_EVENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1687: FND_LOG.STRING(
1688: FND_LOG.LEVEL_EVENT,
1689: 'fun.plsql.fun_seq_batch.populate_rep_seq_prog_gt.config',
1690: 'After calling fun_seq.get_assigned_sequence_info... '
1691: ||', '||
1692: 'l_seq_ver_id_tbl(i): ' || l_seq_ver_id_tbl(i) ||', '||
1693: 'l_assign_id_tbl(i): ' || l_assign_id_tbl(i) ||', '||
1686: IF (FND_LOG.LEVEL_EVENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1687: FND_LOG.STRING(
1688: FND_LOG.LEVEL_EVENT,
1689: 'fun.plsql.fun_seq_batch.populate_rep_seq_prog_gt.config',
1690: 'After calling fun_seq.get_assigned_sequence_info... '
1691: ||', '||
1692: 'l_seq_ver_id_tbl(i): ' || l_seq_ver_id_tbl(i) ||', '||
1693: 'l_assign_id_tbl(i): ' || l_assign_id_tbl(i) ||', '||
1694: 'l_out_ctrl_dt_tbl(i): '|| l_out_ctrl_dt_tbl(i)||', '||
1737: --
1738: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1739: FND_LOG.STRING(
1740: FND_LOG.LEVEL_STATEMENT,
1741: 'fun.plsql.fun_seq_batch.populate_rep_seq_prog_gt.config',
1742: 'Before calling Sort_Acct_Entires: Sort Option - ' ||
1743: l_sort_option_code);
1744: END IF;
1745:
1773: --
1774: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1775: FND_LOG.STRING(
1776: FND_LOG.LEVEL_STATEMENT,
1777: 'fun.plsql.fun_seq_batch.populate_rep_seq_prog_gt.config',
1778: 'After calling Sort_Acct_Entires');
1779: END IF;
1780:
1781: --
1808: --
1809: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1810: FND_LOG.STRING(
1811: FND_LOG.LEVEL_PROCEDURE,
1812: 'fun.plsql.fun_seq_batch.populate_rep_seq_prog_gt.end',
1813: 'p_request_id: ' || p_request_id );
1814: END IF;
1815: EXCEPTION
1816: WHEN no_assigned_seq_info THEN
1819: --
1820: IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
1821: fnd_log.string(
1822: fnd_log.level_exception,
1823: 'fun.plsql.fun_seq_batch.populate_rep_seq_prog_gt',
1824: 'p_request_id: ' || p_request_id ||', ' ||
1825: 'ae_header_id: ' || l_debug_ae_header_id|| ', ' ||
1826: 'SQLERRM: ' || SQLERRM);
1827: END IF;
1827: END IF;
1828:
1829: SELECT name
1830: INTO l_context_name
1831: FROM fun_seq_contexts WHERE
1832: context_type=l_context_type AND
1833: context_value=l_context_value AND
1834: application_id=l_application_id AND
1835: table_name=l_table_name AND
1837:
1838: --
1839: -- Raise Exception
1840: --
1841: fnd_message.set_name ('FUN','FUN_SEQ_NO_ACTIVE_ASSGN_FOUND');
1842: fnd_message.set_token ('SEQ_CONTEXT_NAME',l_context_name);
1843:
1844: app_exception.raise_exception;
1845:
1849: --
1850: IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
1851: fnd_log.string(
1852: fnd_log.level_exception,
1853: 'fun.plsql.fun_seq_batch.populate_rep_seq_prog_gt',
1854: 'p_request_id: ' || p_request_id || ', ' ||
1855: 'ae_header_id: ' || l_debug_ae_header_id|| ', ' ||
1856: 'sort_option_code: ' || l_sort_option_code || ', ' ||
1857: 'SQLERRM: ' || SQLERRM);
1867: --
1868: IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
1869: fnd_log.string(
1870: fnd_log.level_exception,
1871: 'fun.plsql.fun_seq_batch.populate_rep_seq_prog_gt',
1872: 'Unexpected exception in populate_rep_seq_prog_gt' || ', ' ||
1873: 'p_request_id: ' || p_request_id ||', ' ||
1874: 'ae_header_id: ' || l_debug_ae_header_id|| ', ' ||
1875: 'SQLERRM: ' || SQLERRM);
1890: x_ae_header_id_tbl OUT NOCOPY ae_header_id_tbl_type,
1891: x_assign_id_tbl OUT NOCOPY assign_id_tbl_type,
1892: x_seq_ver_id_tbl OUT NOCOPY seq_ver_id_tbl_type) IS
1893:
1894: l_temp_tab fun_seq_bt_tbl_type;
1895:
1896: BEGIN
1897: l_temp_tab := fun_seq_bt_tbl_type();
1898: --
1893:
1894: l_temp_tab fun_seq_bt_tbl_type;
1895:
1896: BEGIN
1897: l_temp_tab := fun_seq_bt_tbl_type();
1898: --
1899: -- Debug Information
1900: --
1901: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1900: --
1901: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1902: FND_LOG.STRING(
1903: FND_LOG.LEVEL_PROCEDURE,
1904: 'fun.plsql.fun_seq_batch.Sort_Acct_Entries.begin',
1905: 'p_ae_header_id_tbl.count => ' || p_ae_header_id_tbl.COUNT);
1906: END IF;
1907: --
1908: -- Populate Sequence Info in Table Type
1919: -- bug# 5373090 - Italian requirement
1920: FOR i IN p_ae_header_id_tbl.FIRST .. p_ae_header_id_tbl.LAST LOOP
1921: l_temp_tab.EXTEND;
1922: l_temp_tab(i) :=
1923: fun_seq_bt_obj_type(
1924: NULL, -- Application Id for Reporting Sequencing
1925: p_ae_header_id_tbl(i),
1926: p_assign_id_tbl(i),
1927: p_seq_ver_id_tbl(i),
1930: ELSE
1931: FOR i IN p_ae_header_id_tbl.FIRST .. p_ae_header_id_tbl.LAST LOOP
1932: l_temp_tab.EXTEND;
1933: l_temp_tab(i) :=
1934: fun_seq_bt_obj_type(
1935: NULL, -- Application Id for Reporting Sequencing
1936: p_ae_header_id_tbl(i),
1937: p_assign_id_tbl(i),
1938: p_seq_ver_id_tbl(i),
1945: --
1946: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1947: FND_LOG.STRING(
1948: FND_LOG.LEVEL_STATEMENT,
1949: 'fun.plsql.fun_seq_batch.Sort_Acct_Entries.config',
1950: 'Local temp table has been populated: ' || p_calling_program);
1951: END IF;
1952:
1953: --
1960: BULK COLLECT
1961: INTO x_ae_header_id_tbl,
1962: x_assign_id_tbl,
1963: x_seq_ver_id_tbl
1964: FROM THE (SELECT CAST( l_temp_tab as fun_seq_bt_tbl_type)
1965: FROM dual ) sqtmp
1966: ORDER BY
1967: sqtmp.seq_version_id,
1968: sqtmp.sorting_key;
1973: --
1974: FOR i IN p_ae_header_id_tbl.FIRST .. p_ae_header_id_tbl.LAST LOOP
1975: l_temp_tab.EXTEND;
1976: l_temp_tab(i) :=
1977: fun_seq_bt_obj_type(
1978: p_application_id_tbl(i),
1979: p_ae_header_id_tbl(i),
1980: p_assign_id_tbl(i),
1981: p_seq_ver_id_tbl(i),
1987: --
1988: IF (FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
1989: FND_LOG.STRING(
1990: FND_LOG.LEVEL_STATEMENT,
1991: 'fun.plsql.fun_seq_batch.Sort_Acct_Entries.config',
1992: 'Local temp table has been populated: ' || p_calling_program);
1993: END IF;
1994:
1995: --
2013: sqtmp.assignment_id assignment_id,
2014: sqtmp.seq_version_id seq_version_id,
2015: ps.period_num period_num,
2016: sqtmp.sorting_key sorting_key
2017: FROM THE (SELECT CAST( l_temp_tab as fun_seq_bt_tbl_type)
2018: FROM dual ) sqtmp, gl_period_statuses ps, gl_je_headers h
2019: WHERE
2020: ps.period_name = h.period_name
2021: AND ps.ledger_id = h.ledger_id
2028: sqtmp.assignment_id assignment_id,
2029: sqtmp.seq_version_id seq_version_id,
2030: ps.period_num period_num,
2031: sqtmp.sorting_key sorting_key
2032: FROM THE (SELECT CAST( l_temp_tab as fun_seq_bt_tbl_type)
2033: FROM dual ) sqtmp, gl_period_statuses ps, xla_ae_headers ah
2034: WHERE
2035: ps.period_name = ah.period_name
2036: AND ps.ledger_id = ah.ledger_id
2051: --
2052: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
2053: FND_LOG.STRING(
2054: FND_LOG.LEVEL_PROCEDURE,
2055: 'fun.plsql.fun_seq_batch.Sort_Acct_Entries.end',
2056: 'p_ae_header_id_tbl.count => ' || p_ae_header_id_tbl.COUNT);
2057: END IF;
2058: EXCEPTION
2059: WHEN OTHERS THEN
2062: --
2063: IF fnd_log.level_exception >= fnd_log.g_current_runtime_level THEN
2064: fnd_log.string(
2065: log_level => fnd_log.level_exception,
2066: module => 'fun.plsql.fun_seq_batch.Sort_Acct_Entries.Exception',
2067: message => 'SQLERRM: ' || SQLERRM);
2068: END IF;
2069: app_exception.raise_exception;
2070: END Sort_Acct_Entries;
2067: message => 'SQLERRM: ' || SQLERRM);
2068: END IF;
2069: app_exception.raise_exception;
2070: END Sort_Acct_Entries;
2071: END fun_seq_batch;