184:
185: /* Bug 8831247 , As part of this bug we introduced a new out parameter
186: p_online_report_id, Modifying below call accordingly */
187:
188: PO_Document_Control_PVT.control_document
189: (p_api_version => 1.0,
190: p_init_msg_list => FND_API.G_FALSE,
191: p_commit => FND_API.G_FALSE,
192: x_return_status => x_return_status,
460:
461:
462: --Add all the messages to the message list
463: IF l_return_code ='F' AND l_online_report_id IS NOT NULL THEN
464: PO_Document_Control_PVT.add_online_report_msgs(
465: p_api_version => 1.0,
466: p_init_msg_list => FND_API.G_FALSE,
467: x_return_status => x_return_status,
468: p_online_report_id => l_online_report_id);
519: -- Approve the document if p_launch_approvals_flag='Y'
520: IF (p_launch_approvals_flag = 'Y'
521: AND l_old_auth_status ='APPROVED') THEN
522:
523: PO_Document_Control_PVT.do_approve_on_cancel(
524: p_doc_type => p_doc_type,
525: p_doc_subtype => p_doc_subtype,
526: p_doc_id => p_doc_id,
527: p_communication_method_option => x_default_method, --16035142
541: END IF;
542:
543: -- If the Cancel action is successful
544: -- Communicate the same to the supplier
545: PO_Document_Control_PVT.doc_communicate_oncancel(
546: p_doc_type => p_doc_type,
547: p_doc_subtype => p_doc_subtype,
548: p_doc_id => p_doc_id,
549: p_communication_method_option => x_default_method, --16035142
658: END IF;
659:
660: -- Call private level validation. If the agent ID is not NULL, then user
661: -- authority and document access levels will be validated as well.
662: PO_Document_Control_PVT.val_control_action
663: (p_api_version => 1.0,
664: p_init_msg_list => FND_API.G_FALSE,
665: x_return_status => x_return_status,
666: p_doc_type => p_doc_type,
971:
972: -- Find level of control action
973: IF (p_doc_line_loc_id IS NOT NULL) OR (p_doc_shipment_num IS NOT NULL)
974: THEN
975: l_control_level := PO_Document_Control_PVT.g_shipment_level;
976: ELSIF (p_doc_line_id IS NOT NULL) OR (p_doc_line_num IS NOT NULL) THEN
977: l_control_level := PO_Document_Control_PVT.g_line_level;
978: ELSE
979: l_control_level := PO_Document_Control_PVT.g_header_level;
973: IF (p_doc_line_loc_id IS NOT NULL) OR (p_doc_shipment_num IS NOT NULL)
974: THEN
975: l_control_level := PO_Document_Control_PVT.g_shipment_level;
976: ELSIF (p_doc_line_id IS NOT NULL) OR (p_doc_line_num IS NOT NULL) THEN
977: l_control_level := PO_Document_Control_PVT.g_line_level;
978: ELSE
979: l_control_level := PO_Document_Control_PVT.g_header_level;
980: END IF; --
981:
975: l_control_level := PO_Document_Control_PVT.g_shipment_level;
976: ELSIF (p_doc_line_id IS NOT NULL) OR (p_doc_line_num IS NOT NULL) THEN
977: l_control_level := PO_Document_Control_PVT.g_line_level;
978: ELSE
979: l_control_level := PO_Document_Control_PVT.g_header_level;
980: END IF; --
981:
982: -- Derive header
983: IF (p_doc_id IS NULL) THEN
999: '.validated_header', 'ID: ' || NVL(TO_CHAR(x_doc_id),'null'));
1000: END IF;
1001: END IF;
1002:
1003: IF (l_control_level <> PO_Document_Control_PVT.g_header_level) THEN
1004:
1005: IF (p_doc_line_id IS NULL) THEN
1006: SELECT pol.po_line_id
1007: INTO x_doc_line_id
1024: END IF;
1025: END IF;
1026:
1027: -- Derive shipment if at shipment level and doc is PO
1028: IF (l_control_level = PO_Document_Control_PVT.g_shipment_level) THEN
1029:
1030: IF (p_doc_type = 'PO') THEN
1031:
1032: IF (p_doc_line_loc_id IS NULL) THEN
1162:
1163: -- Find level of control action
1164: IF (p_doc_line_loc_id IS NOT NULL) OR (p_doc_shipment_num IS NOT NULL)
1165: THEN
1166: l_control_level := PO_Document_Control_PVT.g_rel_shipment_level;
1167: ELSE
1168: l_control_level := PO_Document_Control_PVT.g_rel_header_level;
1169: END IF; --
1170:
1164: IF (p_doc_line_loc_id IS NOT NULL) OR (p_doc_shipment_num IS NOT NULL)
1165: THEN
1166: l_control_level := PO_Document_Control_PVT.g_rel_shipment_level;
1167: ELSE
1168: l_control_level := PO_Document_Control_PVT.g_rel_header_level;
1169: END IF; --
1170:
1171: -- Derive release header
1172: IF (p_release_id IS NULL) THEN
1217: END IF;
1218: END IF;
1219:
1220: -- Derive release shipment if at shipment level
1221: IF (l_control_level = PO_Document_Control_PVT.g_rel_shipment_level) THEN
1222:
1223: IF (p_doc_line_loc_id IS NULL) THEN
1224: -- SQL What: Query to find the line_location_id
1225: -- SQL Why: Need to derive the missing unique line_location_id