176:
177: l_batch_context := l_log_context;
178:
179: -- Start the Log Process
180: pqh_process_batch_log.start_log
181: (
182: p_batch_id => l_batch_id,
183: p_module_cd => 'APPROVE_WORKSHEET',
184: p_log_context => l_batch_context
197: p_log_context => l_log_context
198: );
199:
200: -- set the context before inserting error
201: pqh_process_batch_log.set_context_level
202: (
203: p_txn_id => p_worksheet_detail_id,
204: p_txn_table_route_id => g_table_route_id_wdt,
205: p_level => 1,
217: l_message_text := l_message_text_out;
218:
219: /*
220: -- insert error message
221: pqh_process_batch_log.insert_log
222: (
223: p_message_type_cd => 'ERROR',
224: p_message_text => l_message_text
225: );
266: p_log_context => l_log_context
267: );
268:
269: -- set the context
270: pqh_process_batch_log.set_context_level
271: (
272: p_txn_id => l_pqh_worksheet_details_c_rec.worksheet_detail_id,
273: p_txn_table_route_id => g_table_route_id_wdt,
274: p_level => g_curr_wks_dtl_level,
323: p_log_context => l_log_context
324: );
325:
326: -- set the context
327: pqh_process_batch_log.set_context_level
328: (
329: p_txn_id => l_pqh_worksheet_periods_rec.worksheet_period_id,
330: p_txn_table_route_id => g_table_route_id_wpr,
331: p_level => g_curr_wks_dtl_level + 1,
353: p_log_context => l_log_context
354: );
355:
356: -- set the context
357: pqh_process_batch_log.set_context_level
358: (
359: p_txn_id => l_pqh_worksheet_budget_set_rec.worksheet_budget_set_id,
360: p_txn_table_route_id => g_table_route_id_wst,
361: p_level => g_curr_wks_dtl_level + 2,
383: p_log_context => l_log_context
384: );
385:
386: -- set the context
387: pqh_process_batch_log.set_context_level
388: (
389: p_txn_id => l_pqh_worksheet_bdgt_elmnt_rec.worksheet_bdgt_elmnt_id,
390: p_txn_table_route_id => g_table_route_id_wel,
391: p_level => g_curr_wks_dtl_level + 3,
414: );
415:
416:
417: -- set the context
418: pqh_process_batch_log.set_context_level
419: (
420: p_txn_id => l_pqh_worksheet_fund_srcs_rec.worksheet_fund_src_id,
421: p_txn_table_route_id => g_table_route_id_wfs,
422: p_level => g_curr_wks_dtl_level + 4,
462: WHEN g_error_exception THEN
463: -- update the out varchar
464: p_status := 'ERROR';
465: -- call the end log and stop
466: -- pqh_process_batch_log.end_log;
467: -- now we don't call the end log as there is no batch here
468: updt_batch
469: (
470: p_message_text => l_message_text
474: -- message_text = l_message_text,
475: -- txn_table_route_id = g_table_route_id_wdt,
476: -- batch_status = 'ERROR',
477: -- batch_end_date = sysdate
478: -- WHERE process_log_id = pqh_process_batch_log.g_master_process_log_id;
479: -- commit;
480: WHEN others THEN
481: p_status := 'ERROR';
482: raise;
713: p_log_context => l_log_context
714: );
715:
716: -- set the context before inserting error
717: pqh_process_batch_log.set_context_level
718: (
719: p_txn_id => l_worksheet_details_rec.worksheet_detail_id,
720: p_txn_table_route_id => g_table_route_id_wdt,
721: p_level => 2,
824:
825: /*
826: -- insert error message if l_error_flag is Y
827: IF l_error_flag = 'Y' THEN
828: pqh_process_batch_log.insert_log
829: (
830: p_message_type_cd => 'ERROR',
831: p_message_text => l_message_text
832: );
1190: hr_utility.set_location('Error Flag : '||l_error_flag,10);
1191:
1192: -- insert error message if l_error_flag is Y
1193: IF l_error_flag = 'Y' THEN
1194: pqh_process_batch_log.insert_log
1195: (
1196: p_message_type_cd => 'ERROR',
1197: p_message_text => l_message_text
1198: );
1343: );
1344: -- assign warning message
1345: l_message_text := l_message_text_out;
1346: -- insert warning into process log
1347: pqh_process_batch_log.insert_log
1348: (
1349: p_message_type_cd => 'WARNING',
1350: p_message_text => l_message_text
1351: );
1380:
1381:
1382: -- insert error message if l_error_flag is Y
1383: IF l_error_flag = 'Y' THEN
1384: pqh_process_batch_log.insert_log
1385: (
1386: p_message_type_cd => 'ERROR',
1387: p_message_text => l_message_text
1388: );
1486:
1487: IF nvl(l_message_type,'E') = 'E' THEN
1488: -- this is a error
1489: -- insert error message
1490: pqh_process_batch_log.insert_log
1491: (
1492: p_message_type_cd => 'ERROR',
1493: p_message_text => l_message_text
1494: );
1500: (
1501: p_warnings_rec => l_warnings_rec
1502: );
1503: -- insert warning into process log
1504: pqh_process_batch_log.insert_log
1505: (
1506: p_message_type_cd => 'WARNING',
1507: p_message_text => l_message_text
1508: );
1522:
1523: l_message_text := l_message_text_out;
1524:
1525: -- insert error message
1526: pqh_process_batch_log.insert_log
1527: (
1528: p_message_type_cd => 'ERROR',
1529: p_message_text => l_message_text
1530: );
1546:
1547: IF nvl(l_message_type,'E') = 'E' THEN
1548: -- this is a error
1549: -- insert error message
1550: pqh_process_batch_log.insert_log
1551: (
1552: p_message_type_cd => 'ERROR',
1553: p_message_text => l_message_text
1554: );
1560: (
1561: p_warnings_rec => l_warnings_rec
1562: );
1563: -- insert warning into process log
1564: pqh_process_batch_log.insert_log
1565: (
1566: p_message_type_cd => 'WARNING',
1567: p_message_text => l_message_text
1568: );
1583:
1584: l_message_text := l_message_text_out;
1585:
1586: -- insert error message
1587: pqh_process_batch_log.insert_log
1588: (
1589: p_message_type_cd => 'ERROR',
1590: p_message_text => l_message_text
1591: );
1608:
1609: IF nvl(l_message_type,'E') = 'E' THEN
1610: -- this is a error
1611: -- insert error message
1612: pqh_process_batch_log.insert_log
1613: (
1614: p_message_type_cd => 'ERROR',
1615: p_message_text => l_message_text
1616: );
1622: (
1623: p_warnings_rec => l_warnings_rec
1624: );
1625: -- insert warning into process log
1626: pqh_process_batch_log.insert_log
1627: (
1628: p_message_type_cd => 'WARNING',
1629: p_message_text => l_message_text
1630: );
1644:
1645: l_message_text := l_message_text_out;
1646:
1647: -- insert error message
1648: pqh_process_batch_log.insert_log
1649: (
1650: p_message_type_cd => 'ERROR',
1651: p_message_text => l_message_text
1652: );
1752: (
1753: p_warnings_rec => l_warnings_rec
1754: );
1755: -- insert warning into process log
1756: pqh_process_batch_log.insert_log
1757: (
1758: p_message_type_cd => 'WARNING',
1759: p_message_text => l_message_text
1760: );
1799: (
1800: p_warnings_rec => l_warnings_rec
1801: );
1802: -- insert warning into process log
1803: pqh_process_batch_log.insert_log
1804: (
1805: p_message_type_cd => 'WARNING',
1806: p_message_text => l_message_text
1807: );
1868:
1869:
1870: -- insert error message if l_error_flag is Y
1871: IF l_error_flag = 'Y' THEN
1872: pqh_process_batch_log.insert_log
1873: (
1874: p_message_type_cd => 'ERROR',
1875: p_message_text => l_message_text
1876: );
1964: (
1965: p_warnings_rec => l_warnings_rec
1966: );
1967: -- insert warning into process log
1968: pqh_process_batch_log.insert_log
1969: (
1970: p_message_type_cd => 'WARNING',
1971: p_message_text => l_message_text
1972: );
1997: (
1998: p_warnings_rec => l_warnings_rec
1999: );
2000: -- insert warning into process log
2001: pqh_process_batch_log.insert_log
2002: (
2003: p_message_type_cd => 'WARNING',
2004: p_message_text => l_message_text
2005: );
2069: */
2070:
2071: -- insert error message if l_error_flag is Y
2072: IF l_error_flag = 'Y' THEN
2073: pqh_process_batch_log.insert_log
2074: (
2075: p_message_type_cd => 'ERROR',
2076: p_message_text => l_message_text
2077: );
2713: -- message_text = l_message_text,
2714: -- txn_table_route_id = g_table_route_id_wdt,
2715: -- batch_status = 'ERROR',
2716: -- batch_end_date = sysdate
2717: -- WHERE process_log_id = pqh_process_batch_log.g_master_process_log_id;
2718:
2719: -- set the batch status to error
2720: g_batch_status := 'ERROR';
2721:
2755: CURSOR csr_status (p_message_type_cd IN VARCHAR2 ) IS
2756: SELECT COUNT(*)
2757: FROM pqh_process_log
2758: WHERE message_type_cd = p_message_type_cd
2759: START WITH process_log_id = pqh_process_batch_log.g_master_process_log_id
2760: CONNECT BY PRIOR process_log_id = master_process_log_id;
2761:
2762: CURSOR csr_batch_rec IS
2763: SELECT *
2761:
2762: CURSOR csr_batch_rec IS
2763: SELECT *
2764: FROM pqh_process_log
2765: WHERE process_log_id = pqh_process_batch_log.g_master_process_log_id;
2766:
2767: PRAGMA AUTONOMOUS_TRANSACTION;
2768:
2769:
2825: message_text = fnd_message.get_string('PQH','PQH_PROCESS_COMPLETED'),
2826: txn_table_route_id = g_table_route_id_wdt,
2827: batch_status = l_status,
2828: batch_end_date = sysdate
2829: WHERE process_log_id = pqh_process_batch_log.g_master_process_log_id;
2830: ELSE
2831: -- there were errors in the batch header record i.w the root node
2832: -- so only update the batch status and end date
2833: UPDATE pqh_process_log
2833: UPDATE pqh_process_log
2834: SET batch_status = l_status,
2835: batch_end_date = sysdate,
2836: txn_table_route_id = g_table_route_id_wdt
2837: WHERE process_log_id = pqh_process_batch_log.g_master_process_log_id;
2838: END IF;
2839:
2840:
2841: hr_utility.set_location('Leaving:'||l_proc, 1000);
2885: message_text = p_message_text,
2886: txn_table_route_id = g_table_route_id_wdt,
2887: batch_status = 'ERROR',
2888: batch_end_date = sysdate
2889: WHERE process_log_id = pqh_process_batch_log.g_master_process_log_id;
2890:
2891: /*
2892: Commit the autonomous txn
2893: */