61: -- Initialize the Error Stack
62: PA_DEBUG.init_err_stack('PA_ADVERTISEMENTS_PVT.Order_Adv_Action_Lines');
63:
64: -- 4537865 : Initiliaze x_return_status
65: x_return_status := FND_API.G_RET_STS_SUCCESS ;
66:
67: --Log Message
68: IF P_DEBUG_MODE = 'Y' THEN /* Added Debug Profile Option Check for bug#2674619 */
69: PA_DEBUG.write_log (x_module => 'pa.plsql.PA_ADVERTISEMENTS_PVT.Order_Adv_Action_Lines.begin'
71: ,x_log_level => 5);
72: END IF;
73:
74: -- Initialize the return status to success
75: l_return_status := FND_API.G_RET_STS_SUCCESS;
76:
77: -- Clear the temporary table
78: DELETE FROM pa_adv_action_lines_order_temp;
79:
270: ,p_condition_date_tbl => l_condition_date_tbl2
271: ,x_return_status => l_return_status
272: );
273:
274: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
275: x_return_status := FND_API.G_RET_STS_ERROR;
276: END IF;
277:
278: PA_ACTION_SETS_PVT.Bulk_Update_Line_Number(
271: ,x_return_status => l_return_status
272: );
273:
274: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
275: x_return_status := FND_API.G_RET_STS_ERROR;
276: END IF;
277:
278: PA_ACTION_SETS_PVT.Bulk_Update_Line_Number(
279: p_action_set_line_id_tbl => l_action_line_id_tbl2
280: ,p_line_number_tbl => l_action_line_number_tbl2
281: ,x_return_status => x_return_status
282: );
283:
284: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
285: x_return_status := FND_API.G_RET_STS_ERROR;
286: END IF;
287:
288: END IF; -- more than 0 line
281: ,x_return_status => x_return_status
282: );
283:
284: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
285: x_return_status := FND_API.G_RET_STS_ERROR;
286: END IF;
287:
288: END IF; -- more than 0 line
289: -- 4537865 : Included Exception Block
288: END IF; -- more than 0 line
289: -- 4537865 : Included Exception Block
290: EXCEPTION
291: WHEN OTHERS THEN
292: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
293: FND_MSG_PUB.add_exc_msg ( p_pkg_name => 'PA_ADVERTISEMENTS_PVT'
294: , p_procedure_name => 'Order_Adv_Action_Lines'
295: , p_error_text => SUBSTRB(SQLERRM,1,240));
296: RAISE ;
331: ,x_log_level => 5);
332: END IF;
333:
334: -- Initialize the return status to success
335: x_return_status := FND_API.G_RET_STS_SUCCESS;
336:
337: --
338: -- Handle PENDING action line only as REVERSE_PENDING and UPDATE_PENDING
339: -- lines can be handled generically by the action set model.
353: END IF;
354: -- 4537865 : Included Exception Block
355: EXCEPTION
356: WHEN OTHERS THEN
357: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
358: FND_MSG_PUB.add_exc_msg ( p_pkg_name => 'PA_ADVERTISEMENTS_PVT'
359: , p_procedure_name => 'Publish_To_All'
360: , p_error_text => SUBSTRB(SQLERRM,1,240));
361: RAISE ;
420: ,x_log_level => 5);
421: END IF;
422:
423: -- Initialize the return status to success
424: x_return_status := FND_API.G_RET_STS_SUCCESS;
425:
426:
427: --
428: -- Handle PENDING action line only as REVERSE_PENDING and UPDATE_PENDING
469: -- and return error status if there is error message in the stack
470: IF FND_MSG_PUB.Count_Msg > 0 THEN
471: IF p_insert_audit_flag = 'T' THEN
472: FND_MSG_PUB.get (
473: p_encoded => FND_API.G_TRUE
474: ,p_msg_index => FND_MSG_PUB.Count_Msg
475: ,p_data => l_encoded_message_text
476: ,p_msg_index_out => l_msg_index_out);
477:
480: l_action_line_audit_rec.encoded_error_message := l_encoded_message_text;
481: l_index := PA_ADVERTISEMENTS_PUB.g_action_line_audit_tbl.COUNT;
482: PA_ADVERTISEMENTS_PUB.g_action_line_audit_tbl(l_index) := l_action_line_audit_rec;
483: END IF;
484: x_return_status := FND_API.G_RET_STS_ERROR;
485: END IF; -- IF FND_MSG_PUB.Count_Msg > 0
486:
487: END IF; -- if status is PENDING
488: -- 4537865 : Included Exception Block
487: END IF; -- if status is PENDING
488: -- 4537865 : Included Exception Block
489: EXCEPTION
490: WHEN OTHERS THEN
491: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
492: FND_MSG_PUB.add_exc_msg ( p_pkg_name => 'PA_ADVERTISEMENTS_PVT'
493: , p_procedure_name => 'Publish_To_Organizations'
494: , p_error_text => SUBSTRB(SQLERRM,1,240));
495: RAISE ;
581: ,x_log_level => 5);
582: END IF;
583:
584: -- Initialize the return status to success
585: x_return_status := FND_API.G_RET_STS_SUCCESS;
586:
587: --
588: -- Handle PENDING action line only as REVERSE_PENDING and UPDATE_PENDING
589: -- lines can be handled generically by the action set model.
640: ,p_action_code => p_action_code
641: ,p_action_attribute1 => to_char(l_org_hierarchy_version_id)
642: ,p_action_attribute2 => to_char(l_new_start_org_id)
643: ,p_condition_tbl => p_action_set_line_cond_tbl
644: ,p_validate_only => FND_API.G_FALSE
645: ,p_commit => FND_API.G_FALSE
646: ,p_init_msg_list => FND_API.G_FALSE
647: ,x_return_status => x_return_status
648: ,x_msg_count => l_msg_count
641: ,p_action_attribute1 => to_char(l_org_hierarchy_version_id)
642: ,p_action_attribute2 => to_char(l_new_start_org_id)
643: ,p_condition_tbl => p_action_set_line_cond_tbl
644: ,p_validate_only => FND_API.G_FALSE
645: ,p_commit => FND_API.G_FALSE
646: ,p_init_msg_list => FND_API.G_FALSE
647: ,x_return_status => x_return_status
648: ,x_msg_count => l_msg_count
649: ,x_msg_data => l_msg_data);
642: ,p_action_attribute2 => to_char(l_new_start_org_id)
643: ,p_condition_tbl => p_action_set_line_cond_tbl
644: ,p_validate_only => FND_API.G_FALSE
645: ,p_commit => FND_API.G_FALSE
646: ,p_init_msg_list => FND_API.G_FALSE
647: ,x_return_status => x_return_status
648: ,x_msg_count => l_msg_count
649: ,x_msg_data => l_msg_data);
650:
683: IF FND_MSG_PUB.Count_Msg > 0 THEN
684:
685: IF p_insert_audit_flag = 'T' THEN
686: FND_MSG_PUB.get (
687: p_encoded => FND_API.G_TRUE
688: ,p_msg_index => FND_MSG_PUB.Count_Msg
689: ,p_data => l_encoded_message_text
690: ,p_msg_index_out => l_msg_index_out);
691:
694: l_action_line_audit_rec.encoded_error_message := l_encoded_message_text;
695: l_index := PA_ADVERTISEMENTS_PUB.g_action_line_audit_tbl.COUNT;
696: PA_ADVERTISEMENTS_PUB.g_action_line_audit_tbl(l_index) := l_action_line_audit_rec;
697: END IF;
698: x_return_status := FND_API.G_RET_STS_ERROR;
699: END IF;
700:
701: END IF; -- if status is PENDING
702: -- 4537865 : Included Exception Block
701: END IF; -- if status is PENDING
702: -- 4537865 : Included Exception Block
703: EXCEPTION
704: WHEN OTHERS THEN
705: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
706: FND_MSG_PUB.add_exc_msg ( p_pkg_name => 'PA_ADVERTISEMENTS_PVT'
707: , p_procedure_name => 'Escalate_To_Next_Level'
708: , p_error_text => SUBSTRB(SQLERRM,1,240));
709: RAISE ;
776: ,x_log_level => 5);
777: END IF;
778:
779: -- Initialize the return status to success
780: x_return_status := FND_API.G_RET_STS_SUCCESS;
781:
782: --
783: -- Handle PENDING action line only as REVERSE_PENDING and UPDATE_PENDING
784: -- lines can be handled generically by the action set model.
820: --
821: IF FND_MSG_PUB.Count_Msg > 0 THEN
822: IF p_insert_audit_flag = 'T' THEN
823: FND_MSG_PUB.get (
824: p_encoded => FND_API.G_TRUE
825: ,p_msg_index => FND_MSG_PUB.Count_Msg
826: ,p_data => l_encoded_message_text
827: ,p_msg_index_out => l_msg_index_out);
828:
831: l_action_line_audit_rec.encoded_error_message := l_encoded_message_text;
832: l_index := PA_ADVERTISEMENTS_PUB.g_action_line_audit_tbl.COUNT;
833: PA_ADVERTISEMENTS_PUB.g_action_line_audit_tbl(l_index) := l_action_line_audit_rec;
834: END IF;
835: x_return_status := FND_API.G_RET_STS_ERROR;
836: END IF;
837:
838: END IF; -- if status is PENDING
839: -- 4537865 : Included Exception Block
838: END IF; -- if status is PENDING
839: -- 4537865 : Included Exception Block
840: EXCEPTION
841: WHEN OTHERS THEN
842: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
843: FND_MSG_PUB.add_exc_msg ( p_pkg_name => 'PA_ADVERTISEMENTS_PVT'
844: , p_procedure_name => 'Publish_To_Staffing_Managers'
845: , p_error_text => SUBSTRB(SQLERRM,1,240));
846: RAISE ;
898: ,x_log_level => 5);
899: END IF;
900:
901: -- Initialize the return status to success
902: x_return_status := FND_API.G_RET_STS_SUCCESS;
903: /* bug 4701745*/
904:
905: IF instr(l_email_address, ',') > 0 THEN
906: l_email_address := l_email_address || ',';
977:
978: -- 4537865 : Included Exception Block
979: EXCEPTION
980: WHEN OTHERS THEN
981: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
982: FND_MSG_PUB.add_exc_msg ( p_pkg_name => 'PA_ADVERTISEMENTS_PVT'
983: , p_procedure_name => 'Send_Email'
984: , p_error_text => SUBSTRB(SQLERRM,1,240));
985: RAISE ;
1000: , p_object_id IN pa_action_sets.object_id%TYPE
1001: , p_action_code IN pa_action_set_lines.action_code%TYPE
1002: , p_action_status_code IN pa_action_set_lines.status_code%TYPE
1003: , p_method IN VARCHAR2
1004: , p_person_id IN pa_resources_denorm.person_id%TYPE := FND_API.G_MISS_NUM
1005: , p_project_role_id IN pa_project_role_types.project_role_id%TYPE := FND_API.G_MISS_NUM
1006: , p_project_id IN pa_project_assignments.project_id%TYPE
1007: , p_insert_audit_flag IN VARCHAR2 := 'T'
1008: , x_return_status OUT NOCOPY VARCHAR2 --File.Sql.39 bug 4440895
1001: , p_action_code IN pa_action_set_lines.action_code%TYPE
1002: , p_action_status_code IN pa_action_set_lines.status_code%TYPE
1003: , p_method IN VARCHAR2
1004: , p_person_id IN pa_resources_denorm.person_id%TYPE := FND_API.G_MISS_NUM
1005: , p_project_role_id IN pa_project_role_types.project_role_id%TYPE := FND_API.G_MISS_NUM
1006: , p_project_id IN pa_project_assignments.project_id%TYPE
1007: , p_insert_audit_flag IN VARCHAR2 := 'T'
1008: , x_return_status OUT NOCOPY VARCHAR2 --File.Sql.39 bug 4440895
1009: --, x_msg_count OUT NUMBER
1076: ,x_log_level => 5);
1077: END IF;
1078:
1079: -- Initialize the return status to success
1080: x_return_status := FND_API.G_RET_STS_SUCCESS;
1081:
1082: -- get the person_id of the notification recipients
1083: IF p_method = 'PROJECT_ROLE' THEN
1084:
1147: IF p_insert_audit_flag = 'T' THEN
1148:
1149: FOR i in 1..FND_MSG_PUB.Count_Msg LOOP
1150: FND_MSG_PUB.get (
1151: p_encoded => FND_API.G_TRUE
1152: ,p_msg_index => i
1153: ,p_data => l_encoded_message_text
1154: ,p_msg_index_out => l_msg_index_out);
1155:
1167: l_index := PA_ADVERTISEMENTS_PUB.g_action_line_audit_tbl.COUNT;
1168: PA_ADVERTISEMENTS_PUB.g_action_line_audit_tbl(l_index) := l_action_line_audit_rec;
1169: END LOOP;
1170: END IF;
1171: x_return_status := FND_API.G_RET_STS_ERROR;
1172: END IF;
1173: -- 4537865 : Included Exception Block
1174: EXCEPTION
1175: WHEN OTHERS THEN
1172: END IF;
1173: -- 4537865 : Included Exception Block
1174: EXCEPTION
1175: WHEN OTHERS THEN
1176: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1177: FND_MSG_PUB.add_exc_msg ( p_pkg_name => 'PA_ADVERTISEMENTS_PVT'
1178: , p_procedure_name => 'Send_Notification'
1179: , p_error_text => SUBSTRB(SQLERRM,1,240));
1180: RAISE ;
1338: ,x_log_level => 5);
1339: END IF;
1340:
1341: -- Initialize the return status to success
1342: x_return_status := FND_API.G_RET_STS_SUCCESS;
1343:
1344: -- Setting thresold value to run the process in background
1345: l_save_threshold := wf_engine.threshold;
1346: wf_engine.threshold := -1;
1430: ,p_token1 => 'PERSON_NAME'
1431: ,p_value1 => p_ntf_recipient_name_tbl(i)
1432: );
1433:
1434: x_return_status := FND_API.G_RET_STS_ERROR;
1435:
1436: ELSE
1437:
1438: --dbms_output.put_line('sending notification to '|| l_ntf_recipient_user_name);
1605: wf_engine.threshold := l_save_threshold;
1606: -- 4537865 : Included Exception Block
1607: EXCEPTION
1608: WHEN OTHERS THEN
1609: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1610: FND_MSG_PUB.add_exc_msg ( p_pkg_name => 'PA_ADVERTISEMENTS_PVT'
1611: , p_procedure_name => 'Start_Adv_Notification_WF'
1612: , p_error_text => SUBSTRB(SQLERRM,1,240));
1613: RAISE ;
1651: ,x_log_level => 5);
1652: END IF;
1653:
1654: -- Initialize the return status to success
1655: x_return_status := FND_API.G_RET_STS_SUCCESS;
1656:
1657: --
1658: -- Handle PENDING action line only as REVERSE_PENDING and UPDATE_PENDING
1659: -- lines can be handled generically by the action set model.
1672: ,p_staffing_priority_code => p_staffing_priority_code
1673: ,x_return_status => x_return_status );
1674:
1675: -- Insert into audit table
1676: IF x_return_status = FND_API.G_RET_STS_SUCCESS AND p_insert_audit_flag = 'T' THEN
1677:
1678: -- insert into into the global audit record
1679: l_action_line_audit_rec.reason_code := 'CONDITION_MET';
1680: l_action_line_audit_rec.action_code := p_action_code;
1690: IF FND_MSG_PUB.Count_Msg > 0 THEN
1691: IF p_insert_audit_flag = 'T' THEN
1692:
1693: FND_MSG_PUB.get (
1694: p_encoded => FND_API.G_TRUE
1695: ,p_msg_index => FND_MSG_PUB.Count_Msg
1696: ,p_data => l_encoded_message_text
1697: ,p_msg_index_out => l_msg_index_out);
1698:
1701: l_action_line_audit_rec.encoded_error_message := l_encoded_message_text;
1702: l_index := PA_ADVERTISEMENTS_PUB.g_action_line_audit_tbl.COUNT;
1703: PA_ADVERTISEMENTS_PUB.g_action_line_audit_tbl(l_index) := l_action_line_audit_rec;
1704: END IF; -- IF p_insert_audit_flag = 'T'
1705: x_return_status := FND_API.G_RET_STS_ERROR;
1706: END IF; -- IF FND_MSG_PUB.Count_Msg > 0
1707:
1708: END IF;
1709:
1736: END IF; -- action status
1737: -- 4537865 : Included Exception Block
1738: EXCEPTION
1739: WHEN OTHERS THEN
1740: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1741: FND_MSG_PUB.add_exc_msg ( p_pkg_name => 'PA_ADVERTISEMENTS_PVT'
1742: , p_procedure_name => 'Update_Staffing_Priority'
1743: , p_error_text => SUBSTRB(SQLERRM,1,240));
1744: RAISE ;
1849: ,x_log_level => 5);
1850: END IF;
1851:
1852: -- Initialize the return status to success
1853: x_return_status := FND_API.G_RET_STS_SUCCESS;
1854:
1855: --
1856: -- CASE 1: the action status code is PENDING
1857: IF p_action_status_code = 'PENDING' THEN
1904: p_action_set_line_id_tbl => l_action_set_line_id_tbl2
1905: ,p_line_status_tbl => l_line_status_tbl2
1906: ,x_return_status => l_return_status
1907: );
1908: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1909: x_return_status := FND_API.G_RET_STS_ERROR;
1910: END IF;
1911:
1912: -- Update the active flag to 'N' in the audit records
1905: ,p_line_status_tbl => l_line_status_tbl2
1906: ,x_return_status => l_return_status
1907: );
1908: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1909: x_return_status := FND_API.G_RET_STS_ERROR;
1910: END IF;
1911:
1912: -- Update the active flag to 'N' in the audit records
1913: FORALL i IN l_action_set_line_id_tbl2.FIRST ..l_action_set_line_id_tbl2.LAST
1976: p_action_set_line_id_tbl => l_action_set_line_id_tbl
1977: ,p_line_status_tbl => l_line_status_tbl
1978: ,x_return_status => l_return_status
1979: );
1980: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1981: x_return_status := FND_API.G_RET_STS_ERROR;
1982: END IF;
1983:
1984: -- set the action status code to PENDING
1977: ,p_line_status_tbl => l_line_status_tbl
1978: ,x_return_status => l_return_status
1979: );
1980: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1981: x_return_status := FND_API.G_RET_STS_ERROR;
1982: END IF;
1983:
1984: -- set the action status code to PENDING
1985: -- to re-execute the child records
2003:
2004: -- handle send notifications, send email and update staffing priority
2005: FOR i IN l_action_set_line_id_tbl.FIRST .. l_action_set_line_id_tbl.LAST LOOP
2006:
2007: l_perform_return_status := FND_API.G_RET_STS_SUCCESS;
2008: l_audit_action_code := NULL;
2009: --dbms_output.put_line('l_action_set_line_id: '||l_action_set_line_id_tbl(i));
2010:
2011: IF l_action_code_tbl(i) = 'ADVERTISEMENT_SEND_EMAIL' OR
2021: , p_insert_audit_flag => 'F'
2022: , x_return_status => l_return_status
2023:
2024: );
2025: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2026: x_return_status := FND_API.G_RET_STS_ERROR;
2027: l_perform_return_status := FND_API.G_RET_STS_ERROR;
2028: END IF;
2029:
2022: , x_return_status => l_return_status
2023:
2024: );
2025: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2026: x_return_status := FND_API.G_RET_STS_ERROR;
2027: l_perform_return_status := FND_API.G_RET_STS_ERROR;
2028: END IF;
2029:
2030: -- Store difference action code in the audit table in cases
2023:
2024: );
2025: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2026: x_return_status := FND_API.G_RET_STS_ERROR;
2027: l_perform_return_status := FND_API.G_RET_STS_ERROR;
2028: END IF;
2029:
2030: -- Store difference action code in the audit table in cases
2031: -- of Cancel Advertisement and Reverse Cancel Advertisement
2050: , p_insert_audit_flag => 'F'
2051: , x_return_status => l_return_status -- Changed from x_return_status to l_return_status : 4537865
2052:
2053: );
2054: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2055: x_return_status := FND_API.G_RET_STS_ERROR;
2056: l_perform_return_status := FND_API.G_RET_STS_ERROR;
2057: END IF;
2058:
2051: , x_return_status => l_return_status -- Changed from x_return_status to l_return_status : 4537865
2052:
2053: );
2054: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2055: x_return_status := FND_API.G_RET_STS_ERROR;
2056: l_perform_return_status := FND_API.G_RET_STS_ERROR;
2057: END IF;
2058:
2059: -- Store difference action code in the audit table in cases
2052:
2053: );
2054: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2055: x_return_status := FND_API.G_RET_STS_ERROR;
2056: l_perform_return_status := FND_API.G_RET_STS_ERROR;
2057: END IF;
2058:
2059: -- Store difference action code in the audit table in cases
2060: -- of Cancel Advertisement and Reverse Cancel Advertisement
2079: , p_insert_audit_flag => 'F'
2080: , x_return_status => l_return_status -- Changed from x_return_status to l_return_status : 4537865
2081:
2082: );
2083: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2084: x_return_status := FND_API.G_RET_STS_ERROR;
2085: l_perform_return_status := FND_API.G_RET_STS_ERROR;
2086: END IF;
2087:
2080: , x_return_status => l_return_status -- Changed from x_return_status to l_return_status : 4537865
2081:
2082: );
2083: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2084: x_return_status := FND_API.G_RET_STS_ERROR;
2085: l_perform_return_status := FND_API.G_RET_STS_ERROR;
2086: END IF;
2087:
2088: -- Store difference action code in the audit table in cases
2081:
2082: );
2083: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2084: x_return_status := FND_API.G_RET_STS_ERROR;
2085: l_perform_return_status := FND_API.G_RET_STS_ERROR;
2086: END IF;
2087:
2088: -- Store difference action code in the audit table in cases
2089: -- of Cancel Advertisement and Reverse Cancel Advertisement
2106: , p_record_version_number => l_record_version_number
2107: , p_insert_audit_flag => 'F'
2108: , x_return_status => l_return_status -- Changed from x_return_status to l_return_status : 4537865
2109: );
2110: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2111: x_return_status := FND_API.G_RET_STS_ERROR;
2112: l_perform_return_status := FND_API.G_RET_STS_ERROR;
2113: END IF;
2114:
2107: , p_insert_audit_flag => 'F'
2108: , x_return_status => l_return_status -- Changed from x_return_status to l_return_status : 4537865
2109: );
2110: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2111: x_return_status := FND_API.G_RET_STS_ERROR;
2112: l_perform_return_status := FND_API.G_RET_STS_ERROR;
2113: END IF;
2114:
2115: -- Store difference action code in the audit table in cases
2108: , x_return_status => l_return_status -- Changed from x_return_status to l_return_status : 4537865
2109: );
2110: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2111: x_return_status := FND_API.G_RET_STS_ERROR;
2112: l_perform_return_status := FND_API.G_RET_STS_ERROR;
2113: END IF;
2114:
2115: -- Store difference action code in the audit table in cases
2116: -- of Cancel Advertisement and Reverse Cancel Advertisement
2184:
2185: END IF; -- if action_code = ..
2186:
2187: -- Insert into into the global audit record
2188: IF p_insert_audit_flag = 'T' AND l_perform_return_status=FND_API.G_RET_STS_SUCCESS THEN
2189:
2190: l_action_line_audit_rec.reason_code := l_audit_reason_code;
2191: l_action_line_audit_rec.action_code := l_audit_action_code;
2192: l_action_line_audit_rec.audit_attribute := l_audit_attribute_tbl(i);
2204:
2205: l_index := PA_ADVERTISEMENTS_PUB.g_action_line_audit_tbl.COUNT;
2206: PA_ADVERTISEMENTS_PUB.g_action_line_audit_tbl(l_index) := l_action_line_audit_rec;
2207:
2208: ELSIF p_insert_audit_flag = 'T' AND l_perform_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2209:
2210: FND_MSG_PUB.get (
2211: p_encoded => FND_API.G_TRUE
2212: ,p_msg_index => FND_MSG_PUB.Count_Msg
2207:
2208: ELSIF p_insert_audit_flag = 'T' AND l_perform_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2209:
2210: FND_MSG_PUB.get (
2211: p_encoded => FND_API.G_TRUE
2212: ,p_msg_index => FND_MSG_PUB.Count_Msg
2213: ,p_data => l_encoded_message_text
2214: ,p_msg_index_out => l_msg_index_out);
2215:
2228:
2229: END IF; -- if l_action_set_line_id_tbl.COUNT > 0
2230:
2231: IF FND_MSG_PUB.Count_Msg > 0 THEN
2232: x_return_status := FND_API.G_RET_STS_ERROR;
2233: END IF;
2234:
2235: -- 4537865 : Included Exception Block
2236: EXCEPTION
2234:
2235: -- 4537865 : Included Exception Block
2236: EXCEPTION
2237: WHEN OTHERS THEN
2238: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2239: FND_MSG_PUB.add_exc_msg ( p_pkg_name => 'PA_ADVERTISEMENTS_PVT'
2240: , p_procedure_name => 'Remove_Advertisement'
2241: , p_error_text => SUBSTRB(SQLERRM,1,240));
2242: RAISE ;