835: where code_combination_id = l_ccid;
836:
837: cursor c_sp_seq is
838: select psb_service_packages_s.nextval ServicePackageID
839: from dual;
840:
841: cursor c_wal1 is
842: select account_line_id, budget_group_id, request_id, annual_fte, ytd_amount,
843: period1_amount, period2_amount, period3_amount, period4_amount,
2651: and c.code_combination_id = l_ccid;
2652: --
2653: cursor c_seq is
2654: select PSB_WS_ACCOUNT_LINES_S.NEXTVAL seq
2655: from dual;
2656:
2657: -- Bug No 2354918 Start
2658: cursor c_WAL is
2659: select period1_amount, period2_amount, period3_amount, period4_amount,
5591:
5592: l_mapped_ccid NUMBER;
5593: l_ytd_amount NUMBER := 0;
5594:
5595: -- Compute Sum of WS Account Lines for individual CCIDs.
5596: -- This is applicable when the Detailed Flag is Set and is for all Service Packages
5597:
5598: cursor c_Sum is
5599: select sum(nvl(a.ytd_amount,0)) Sum_Acc
5611: and a.budget_year_id = p_budget_year_id
5612: and a.code_combination_id = l_mapped_ccid
5613: and b.worksheet_id = p_worksheet_id;
5614:
5615: -- Compute Sum of WS Account Lines for individual CCIDs.
5616: -- This is applicable when the Detailed Flag is Set and is for all Service Packages
5617: -- that have been selected for submission in Worksheet Operations
5618:
5619: cursor c_SumSP is
5792: WHERE budget_group_type = 'R'
5793: START WITH budget_group_id = c_budgetgroup_id
5794: CONNECT BY prior budget_group_id = parent_budget_group_id;
5795:
5796: -- Find individual accounts assigned to the Constraint
5797: CURSOR l_Accounts_csr
5798: IS
5799: SELECT d.code_combination_id, e.account_position_set_id
5800: FROM psb_budget_accounts d,
5921: END Compute_Sum_Total;
5922:
5923: /* ----------------------------------------------------------------------- */
5924:
5925: -- Process Detailed Constraint for an individual CCID or Summary Constraint
5926: -- for all CCIDs
5927:
5928: PROCEDURE Process_Constraint
5929: ( p_return_status OUT NOCOPY VARCHAR2,
6048:
6049: end;
6050: end if;
6051:
6052: -- Get the individual Segment values for the CCID
6053:
6054: if p_ccid <> 0 then
6055: begin
6056:
6803: END Process_Constraint;
6804:
6805: /* ----------------------------------------------------------------------- */
6806:
6807: -- Process Constraint that has the detailed flag set for individual CCIDs
6808:
6809: PROCEDURE Apply_Detailed_Account
6810: ( p_return_status OUT NOCOPY VARCHAR2,
6811: p_constraint_validation_status OUT NOCOPY VARCHAR2,
7014: -- Check whether Constraints should be applied for specific Service Packages
7015:
7016: cursor c_SP is
7017: select 'x'
7018: from dual
7019: where exists
7020: (select 'Service Package Exists'
7021: from PSB_WS_SUBMIT_SERVICE_PACKAGES
7022: where worksheet_id = p_worksheet_id);
7107: raise FND_API.G_EXC_ERROR;
7108: end if;
7109:
7110: -- Assign a proper validation status for the Constraint Set based on the validation
7111: -- status for the individual Constraints
7112:
7113: if ((l_consset_validation_status = 'S') and
7114: (l_cons_validation_status <> 'S')) then
7115: l_consset_validation_status := l_cons_validation_status;
7125: else
7126: begin
7127:
7128: -- For a Constraint with the detailed flag set, call this procedure which
7129: -- processes constraints for individual CCIDs. This is to avoid static
7130: -- binding
7131:
7132: Apply_Detailed_Account
7133: (p_return_status => l_return_status,
7159: raise FND_API.G_EXC_ERROR;
7160: end if;
7161:
7162: -- Assign a proper validation status for the Constraint Set based on the validation
7163: -- status for the individual Constraints
7164:
7165: if ((l_consset_validation_status = 'S') and
7166: (l_cons_validation_status <> 'S')) then
7167: l_consset_validation_status := l_cons_validation_status;