DBA Data[Home] [Help]

APPS.PA_FP_ROLLUP_PKG dependencies on PA_FP_RA_MAP_TMP

Line 189: INSERT_PARENT_REC_TMP: This is a common api which is used to insert records into pa_fp_ra_map_tmp

185: END POPULATE_LOCAL_VARS;
186:
187:
188: /*=================================================================================================
189: INSERT_PARENT_REC_TMP: This is a common api which is used to insert records into pa_fp_ra_map_tmp
190: based on the Level of the records being inserted (i.e Resource Group level, Task level and Parent
191: Task level) for rollup of amounts into the Denorm table. This procedure is called from
192: Refresh_Period_Denorm and Insert_Parent_Rec_Tmp.
193: =================================================================================================*/

Line 236: DELETE from pa_fp_ra_map_tmp;

232: g_first_ra_id := 0;
233: END IF;
234:
235: /* delete older records not to be used in this table. */
236: DELETE from pa_fp_ra_map_tmp;
237:
238: pa_debug.g_err_stage := 'deleted ' || sql%rowcount || ' records';
239: IF P_PA_DEBUG_MODE = 'Y' THEN
240: pa_debug.write('INSERT_PARENT_REC_TMP: ' || l_module_name,pa_debug.g_err_stage,3);

Line 243: /* Insert Parent Records into PA_FP_RA_MAP_TMP table with the system_reference1

239: IF P_PA_DEBUG_MODE = 'Y' THEN
240: pa_debug.write('INSERT_PARENT_REC_TMP: ' || l_module_name,pa_debug.g_err_stage,3);
241: END IF;
242:
243: /* Insert Parent Records into PA_FP_RA_MAP_TMP table with the system_reference1
244: as that passed to this procedure. */
245:
246: pa_debug.g_err_stage := 'Inserting recs into pa_fp_ra_map_tmp';
247: IF P_PA_DEBUG_MODE = 'Y' THEN

Line 246: pa_debug.g_err_stage := 'Inserting recs into pa_fp_ra_map_tmp';

242:
243: /* Insert Parent Records into PA_FP_RA_MAP_TMP table with the system_reference1
244: as that passed to this procedure. */
245:
246: pa_debug.g_err_stage := 'Inserting recs into pa_fp_ra_map_tmp';
247: IF P_PA_DEBUG_MODE = 'Y' THEN
248: pa_debug.write('INSERT_PARENT_REC_TMP: ' || l_module_name,pa_debug.g_err_stage,3);
249: END IF;
250:

Line 256: INSERT INTO PA_FP_RA_MAP_TMP

252: /* we need to insert only last that is resource level records in tmp table.
253: This is required because in case resource list is grouped users can enter amounts at
254: resource group level.
255: */
256: INSERT INTO PA_FP_RA_MAP_TMP
257: (RESOURCE_ASSIGNMENT_ID
258: ,PARENT_ASSIGNMENT_ID
259: ,UNIT_OF_MEASURE)
260: SELECT resource_assignment_id

Line 279: INSERT INTO PA_FP_RA_MAP_TMP

275: /* When inserting task level records we need to select those records from resource assignments
276: for which parent member id is null. These could be either resource group level records or
277: resource level records depending upon whether resource list is grouped or not.
278: */
279: INSERT INTO PA_FP_RA_MAP_TMP
280: (RESOURCE_ASSIGNMENT_ID
281: ,PARENT_ASSIGNMENT_ID
282: ,UNIT_OF_MEASURE)
283: SELECT resource_assignment_id

Line 301: INSERT INTO pa_fp_ra_map_tmp

297: ELSIF PX_INSERTING_PARENT_TASK_LEVEL THEN
298: /* in this case we should start with last level in wbs and then go up the ladder. This is to avoid
299: selecting the same parent twice due to differnece in wbs across various branches
300: */
301: INSERT INTO pa_fp_ra_map_tmp
302: (RESOURCE_ASSIGNMENT_ID
303: ,PARENT_ASSIGNMENT_ID
304: ,UNIT_OF_MEASURE)
305: SELECT pra.resource_assignment_id

Line 2196: table PA_FP_RA_MAP_TMP */

2192: table should contain the uom as HOURS for the first user_enetered_level so that
2193: the Quantity in the next upper level records are automatically inserted correctly. */
2194:
2195: /* Perform the following steps in a loop until there are no records in the temp
2196: table PA_FP_RA_MAP_TMP */
2197:
2198: LOOP
2199: EXIT WHEN l_curr_rollup_level = 0;
2200:

Line 2201: pa_debug.g_err_stage := 'Inserting into PA_FP_RA_MAP_TMP for User Entered recs';

2197:
2198: LOOP
2199: EXIT WHEN l_curr_rollup_level = 0;
2200:
2201: pa_debug.g_err_stage := 'Inserting into PA_FP_RA_MAP_TMP for User Entered recs';
2202: IF P_PA_DEBUG_MODE = 'Y' THEN
2203: pa_debug.write('REFRESH_PERIOD_DENORM: ' || l_module_name,pa_debug.g_err_stage,3);
2204: END IF;
2205:

Line 2207: records into the pa_fp_ra_map_tmp table so that they can be

2203: pa_debug.write('REFRESH_PERIOD_DENORM: ' || l_module_name,pa_debug.g_err_stage,3);
2204: END IF;
2205:
2206: /* Call the procedure insert_parent_rec_temp to insert the parent
2207: records into the pa_fp_ra_map_tmp table so that they can be
2208: processed in the next loop; */
2209:
2210: pa_debug.g_err_stage := 'Calling Insert_Parent_Rec_Tmp';
2211: IF P_PA_DEBUG_MODE = 'Y' THEN

Line 2375: FROM pa_fp_ra_map_tmp tmp,

2371: ,fnd_global.user_id
2372: ,sysdate
2373: ,fnd_global.user_id
2374: ,fnd_global.login_id
2375: FROM pa_fp_ra_map_tmp tmp,
2376: pa_proj_periods_denorm ppd
2377: WHERE tmp.resource_assignment_id = ppd.resource_assignment_id
2378: AND ppd.budget_version_id = p_budget_version_id -- performance bug 2802862
2379: AND ((currency_type <> PA_FP_CONSTANTS_PKG.G_CURRENCY_TYPE_TRANSACTION) OR

Line 2559: (SELECT resource_assignment_id FROM pa_fp_ra_map_tmp);

2555: AND pra1.project_id = c_project_id --bug#2771574
2556: AND pra1.resource_list_member_id <> 0
2557: AND pra1.parent_assignment_id IS NULL /* manokuma: added during unit testing */
2558: AND pra1.resource_assignment_id IN
2559: (SELECT resource_assignment_id FROM pa_fp_ra_map_tmp);
2560:
2561: /* #2697999: Modified the below cursor to fetch the uom and track_as_labor_flag for
2562: the Resource group. If the Track as labor flag is 'Y', only then the UOM
2563: is populated as 'HOURS' for the res grp, else it is populated as NULL.

Line 2586: (SELECT resource_assignment_id FROM pa_fp_ra_map_tmp)

2582: AND pra.resource_list_member_id = prlm.resource_list_member_id
2583: AND prlm.parent_member_id = parent_prlm.resource_list_member_id
2584: AND prlm.parent_member_id is not null
2585: AND resource_assignment_id in
2586: (SELECT resource_assignment_id FROM pa_fp_ra_map_tmp)
2587: GROUP BY pra.task_id, prlm.parent_member_id;
2588:
2589: CURSOR cur_task_rec(c_budget_version_id IN NUMBER
2590: ,c_project_id IN NUMBER) IS --bug#2708524

Line 2597: (SELECT resource_assignment_id FROM pa_fp_ra_map_tmp)

2593: WHERE pra.budget_version_id = c_budget_version_id
2594: AND pra.project_id = c_project_id
2595: AND pra.resource_list_member_id <> 0
2596: AND pra.resource_assignment_id IN
2597: (SELECT resource_assignment_id FROM pa_fp_ra_map_tmp)
2598: GROUP BY task_id;
2599:
2600: CURSOR cur_parent_task_rec(c_curr_wbs_level IN NUMBER
2601: ,c_budget_version_id IN NUMBER --bug#2708524

Line 2607: (select resource_assignment_id FROM pa_fp_ra_map_tmp )

2603: SELECT PARENT_TASK_ID TASK_ID
2604: FROM pa_resource_assignments pra
2605: ,pa_tasks pt
2606: WHERE pra.resource_assignment_id IN
2607: (select resource_assignment_id FROM pa_fp_ra_map_tmp )
2608: AND pra.project_id = c_project_id --bug#2708524
2609: AND pra.budget_version_id = c_budget_version_id --bug#2708524
2610: AND pra.task_id = pt.task_id
2611: AND pt.parent_task_id IS NOT NULL

Line 2739: (select resource_assignment_id from pa_fp_ra_map_tmp)

2735: WHERE budget_version_id = p_budget_version_id
2736: AND resource_list_member_id <> 0
2737: AND parent_assignment_id IS NULL -- manokuma: added during unit testing
2738: AND resource_assignment_id in
2739: (select resource_assignment_id from pa_fp_ra_map_tmp)
2740: RETURNING pra1.resource_assignment_id, pra1.parent_assignment_id
2741: BULK COLLECT INTO l_ra_id_tbl, l_parent_ra_id_tbl; */
2742:
2743: OPEN cur_parent_ra_id(p_budget_version_id,l_project_id);

Line 2766: /* Delete the records from pa_fp_ra_map_tmp table where Resource Assignments are

2762: CLOSE cur_parent_ra_id;
2763:
2764: IF nvl(l_ra_id_tbl.last,0) >= 1 THEN /* only if something is fetched */
2765:
2766: /* Delete the records from pa_fp_ra_map_tmp table where Resource Assignments are
2767: present in the PL/SQL table returned and the Parent ID is NOT NULL. */
2768:
2769: FORALL i in l_ra_id_tbl.first..l_ra_id_tbl.last
2770:

Line 2771: DELETE FROM pa_fp_ra_map_tmp

2767: present in the PL/SQL table returned and the Parent ID is NOT NULL. */
2768:
2769: FORALL i in l_ra_id_tbl.first..l_ra_id_tbl.last
2770:
2771: DELETE FROM pa_fp_ra_map_tmp
2772: WHERE resource_assignment_id = l_ra_id_tbl(i)
2773: AND l_parent_ra_id_tbl(i) IS NOT NULL;
2774:
2775: pa_debug.g_err_stage := 'deleted ' || sql%rowcount || ' records from ra map tmp';

Line 2783: /* For the resource level records in pa_fp_ra_map_tmp, Insert the

2779:
2780:
2781: END IF;
2782:
2783: /* For the resource level records in pa_fp_ra_map_tmp, Insert the
2784: resource group level records. */
2785:
2786: pa_debug.g_err_stage := 'Inserting Resource Group Level records';
2787: IF P_PA_DEBUG_MODE = 'Y' THEN

Line 2842: into the Temp table pa_fp_ra_map_tmp. */

2838: END IF;
2839:
2840:
2841: /* Insert the parent returned into l_parent_ra_id_tbl
2842: into the Temp table pa_fp_ra_map_tmp. */
2843:
2844: IF nvl(l_parent_res_id_tbl.last,0) > 0 THEN
2845:
2846: FORALL i in l_parent_res_id_tbl.first..l_parent_res_id_tbl.last

Line 2848: INSERT INTO pa_fp_ra_map_tmp

2844: IF nvl(l_parent_res_id_tbl.last,0) > 0 THEN
2845:
2846: FORALL i in l_parent_res_id_tbl.first..l_parent_res_id_tbl.last
2847:
2848: INSERT INTO pa_fp_ra_map_tmp
2849: (RESOURCE_ASSIGNMENT_ID)
2850: VALUES
2851: (l_parent_res_id_tbl(i));
2852: END IF;

Line 2877: loop, pa_fp_ra_map_tmp table will contain only task level records. */

2873:
2874: IF l_planning_level <> PA_FP_CONSTANTS_PKG.G_BUDGET_ENTRY_LEVEL_PROJECT THEN
2875:
2876: /* Creating a Loop to continuously stamp the parent_assignment_id. By the end of this
2877: loop, pa_fp_ra_map_tmp table will contain only task level records. */
2878: l_task_id_tbl.delete; /* Deleting records from TASKID pl/sql table so that it can be used later. */
2879:
2880: LOOP
2881:

Line 2897: (select resource_assignment_id from pa_fp_ra_map_tmp)

2893: WHERE pra2.task_id = pra1.task_id
2894: AND pra2.resource_list_member_id = 0
2895: AND pra2.budget_version_id = p_budget_version_id)
2896: WHERE resource_assignment_id in
2897: (select resource_assignment_id from pa_fp_ra_map_tmp)
2898: AND pra1.resource_list_member_id <> 0
2899: AND pra1.budget_version_id = p_budget_version_id
2900: RETURNING resource_assignment_id, parent_assignment_id
2901: BULK COLLECT INTO l_ra_id_tbl, l_parent_ra_id_tbl;

Line 2908: /* Delete the records from pa_fp_ra_map_tmp table where Resource Assignments are

2904: IF P_PA_DEBUG_MODE = 'Y' THEN
2905: pa_debug.write('INSERT_MISSING_RES_PARENTS: ' || l_module_name,pa_debug.g_err_stage,3);
2906: END IF;
2907:
2908: /* Delete the records from pa_fp_ra_map_tmp table where Resource Assignments are
2909: present in the PL/SQL table returned and the Parent ID is NOT NULL. */
2910:
2911: IF nvl(l_ra_id_tbl.last,0) > 0 THEN
2912:

Line 2915: DELETE FROM pa_fp_ra_map_tmp

2911: IF nvl(l_ra_id_tbl.last,0) > 0 THEN
2912:
2913: FORALL i in l_ra_id_tbl.first..l_ra_id_tbl.last
2914:
2915: DELETE FROM pa_fp_ra_map_tmp
2916: WHERE resource_assignment_id = l_ra_id_tbl(i)
2917: AND l_parent_ra_id_tbl(i) IS NOT NULL;
2918: END IF;
2919:

Line 2925: /* Insert task level records for the records available in pa_fp_ra_map_tmp table

2921: IF P_PA_DEBUG_MODE = 'Y' THEN
2922: pa_debug.write('INSERT_MISSING_RES_PARENTS: ' || l_module_name,pa_debug.g_err_stage,3);
2923: END IF;
2924:
2925: /* Insert task level records for the records available in pa_fp_ra_map_tmp table
2926: (as of now only those records are available for which task level records do not exist). */
2927:
2928: pa_debug.g_err_stage := 'Inserting Task Level Records';
2929: IF P_PA_DEBUG_MODE = 'Y' THEN

Line 2979: /* Insert the newly generated resource assignment ids into pa_fp_ra_map_tmp table as for these

2975: IF P_PA_DEBUG_MODE = 'Y' THEN
2976: pa_debug.write('INSERT_MISSING_RES_PARENTS: ' || l_module_name,pa_debug.g_err_stage,3);
2977: END IF;
2978:
2979: /* Insert the newly generated resource assignment ids into pa_fp_ra_map_tmp table as for these
2980: records either parents need to be find or inserted. */
2981:
2982: IF nvl(l_ra_id_tbl.last,0) > 0 THEN
2983:

Line 2986: INSERT INTO pa_fp_ra_map_tmp(resource_assignment_id)

2982: IF nvl(l_ra_id_tbl.last,0) > 0 THEN
2983:
2984: FORALL i in l_ra_id_tbl.first..l_ra_id_tbl.last
2985:
2986: INSERT INTO pa_fp_ra_map_tmp(resource_assignment_id)
2987: VALUES (l_ra_id_tbl(i));
2988:
2989: END IF;
2990:

Line 3014: FROM pa_fp_ra_map_tmp);

3010: SELECT 'Y'
3011: INTO l_continue_processing_flag
3012: FROM dual
3013: WHERE EXISTS (SELECT 1
3014: FROM pa_fp_ra_map_tmp);
3015:
3016: EXCEPTION
3017:
3018: WHEN NO_DATA_FOUND THEN

Line 3027: IF (l_continue_processing_flag = 'Y') THEN /* Only if there are records existing in pa_fp_ra_map_tmp */

3023: IF P_PA_DEBUG_MODE = 'Y' THEN
3024: pa_debug.write('INSERT_MISSING_RES_PARENTS: ' || l_module_name,pa_debug.g_err_stage,3);
3025: END IF;
3026:
3027: IF (l_continue_processing_flag = 'Y') THEN /* Only if there are records existing in pa_fp_ra_map_tmp */
3028:
3029: pa_debug.g_err_stage := 'there are task level records to be processed';
3030: IF P_PA_DEBUG_MODE = 'Y' THEN
3031: pa_debug.write('INSERT_MISSING_RES_PARENTS: ' || l_module_name,pa_debug.g_err_stage,3);

Line 3075: (select resource_assignment_id from pa_fp_ra_map_tmp)

3071: where pra2.task_id = t.parent_task_id
3072: and pra1.task_id = t.task_id
3073: and pra2.budget_version_id = p_budget_version_id) /* manokuma: fixed during ut */
3074: WHERE resource_assignment_id in
3075: (select resource_assignment_id from pa_fp_ra_map_tmp)
3076: RETURNING resource_assignment_id, parent_assignment_id
3077: BULK COLLECT INTO l_ra_id_tbl, l_parent_ra_id_tbl;
3078:
3079: pa_debug.g_err_stage := 'updated ' || sql%rowcount || ' records ';

Line 3084: /* Delete the records from pa_fp_ra_map_tmp table where Resource Assignments are

3080: IF P_PA_DEBUG_MODE = 'Y' THEN
3081: pa_debug.write('INSERT_MISSING_RES_PARENTS: ' || l_module_name,pa_debug.g_err_stage,3);
3082: END IF;
3083:
3084: /* Delete the records from pa_fp_ra_map_tmp table where Resource Assignments are
3085: present in the PL/SQL table returned and the Parent ID is NOT NULL. */
3086:
3087: IF nvl(l_ra_id_tbl.last,0) > 0 THEN
3088: FORALL i in l_ra_id_tbl.first..l_ra_id_tbl.last

Line 3090: DELETE FROM pa_fp_ra_map_tmp

3086:
3087: IF nvl(l_ra_id_tbl.last,0) > 0 THEN
3088: FORALL i in l_ra_id_tbl.first..l_ra_id_tbl.last
3089:
3090: DELETE FROM pa_fp_ra_map_tmp
3091: WHERE resource_assignment_id = l_ra_id_tbl(i)
3092: AND l_parent_ra_id_tbl(i) IS NOT NULL;
3093:
3094: pa_debug.g_err_stage := 'deleted ' || sql%rowcount || ' records from map tmp';

Line 3100: /* Insert the Parent task level records for the records available in pa_fp_ra_map_tmp table */

3096: pa_debug.write('INSERT_MISSING_RES_PARENTS: ' || l_module_name,pa_debug.g_err_stage,3);
3097: END IF;
3098: END IF;
3099:
3100: /* Insert the Parent task level records for the records available in pa_fp_ra_map_tmp table */
3101:
3102: pa_debug.g_err_stage := 'Inserting the Parent Task Level records';
3103: IF P_PA_DEBUG_MODE = 'Y' THEN
3104: pa_debug.write('INSERT_MISSING_RES_PARENTS: ' || l_module_name,pa_debug.g_err_stage,3);

Line 3152: /* #2697890: Moved the following code for inserting into pa_fp_ra_map_tmp from outside the

3148: IF P_PA_DEBUG_MODE = 'Y' THEN
3149: pa_debug.write('INSERT_MISSING_RES_PARENTS: ' || l_module_name,pa_debug.g_err_stage,3);
3150: END IF;
3151:
3152: /* #2697890: Moved the following code for inserting into pa_fp_ra_map_tmp from outside the
3153: IF statement to inside the IF statement. The last time this loop is executed for the Top
3154: Task record, there is no parent found and hence the above INSERT will not be executed.
3155: The PL/SQL table l_ra_id_tbl will be holding the previous value i.e. one task lower than
3156: the Top task.

Line 3164: /* Insert the newly generated resource assignment ids into pa_fp_ra_map_tmp table. */

3160: level record is executed even for the lower task and the amounts are not updated for
3161: the Top Task record because of wrong stamping of the parent assignment id on the lower
3162: level task record. */
3163:
3164: /* Insert the newly generated resource assignment ids into pa_fp_ra_map_tmp table. */
3165:
3166: IF nvl(l_ra_id_tbl.last,0) > 0 THEN
3167:
3168: FORALL i in l_ra_id_tbl.first..l_ra_id_tbl.last

Line 3170: INSERT INTO pa_fp_ra_map_tmp(resource_assignment_id)

3166: IF nvl(l_ra_id_tbl.last,0) > 0 THEN
3167:
3168: FORALL i in l_ra_id_tbl.first..l_ra_id_tbl.last
3169:
3170: INSERT INTO pa_fp_ra_map_tmp(resource_assignment_id)
3171: VALUES (l_ra_id_tbl(i));
3172:
3173: pa_debug.g_err_stage := 'inserted ' || sql%rowcount || ' records in map tmp';
3174: IF P_PA_DEBUG_MODE = 'Y' THEN

Line 3196: attached then pa_fp_ra_map_tmp table will contain resource/resource group level records with

3192:
3193: /* By now, all parent task level records would have been inserted into PA_RESOURCE_ASSIGNMENTS
3194: table with parent_assignment_id stamped correctly. PA_RA_MAP temp table will contain only
3195: top task level records. In case planning level is project or top task and resource list is
3196: attached then pa_fp_ra_map_tmp table will contain resource/resource group level records with
3197: task_id as 0. */
3198:
3199: /* For all the records in pa_fp_ra_map_tmp table we need to insert project level records.
3200: Check if a Project level record exists for the Budget Version */

Line 3199: /* For all the records in pa_fp_ra_map_tmp table we need to insert project level records.

3195: top task level records. In case planning level is project or top task and resource list is
3196: attached then pa_fp_ra_map_tmp table will contain resource/resource group level records with
3197: task_id as 0. */
3198:
3199: /* For all the records in pa_fp_ra_map_tmp table we need to insert project level records.
3200: Check if a Project level record exists for the Budget Version */
3201:
3202: /* Bug 2647043 : This needs to be done only when planning level is not project and resource
3203: attached is not categorized as in this case the user entered record is project

Line 3281: /* Update all PA_RESOURCE_ASSIGNMENTS for resource_assignment id in pa_fp_ra_map_tmp table

3277: END IF;
3278:
3279: END;
3280:
3281: /* Update all PA_RESOURCE_ASSIGNMENTS for resource_assignment id in pa_fp_ra_map_tmp table
3282: with parent_assignment_id as that obtained earlier. */
3283:
3284: pa_debug.g_err_stage := 'updating top records with project level record as parent ';
3285: IF P_PA_DEBUG_MODE = 'Y' THEN

Line 3293: FROM pa_fp_ra_map_tmp)

3289: UPDATE PA_RESOURCE_ASSIGNMENTS
3290: SET parent_assignment_id = l_proj_ra_id
3291: WHERE resource_assignment_id IN
3292: (SELECT resource_assignment_id
3293: FROM pa_fp_ra_map_tmp)
3294: AND project_id = l_project_id --bug#2708524
3295: AND budget_version_id = p_budget_version_id ; --bug#2708524
3296:
3297: pa_debug.g_err_stage := 'updated ' || sql%rowcount || ' records. end of INSERT_MISSING_RES_PARENTS';

Line 3646: records for which rollup API is called. It expects input in pa_fp_ra_map_tmp table. This API

3642: END ROLLUP_RES_ASSIGNMENT_AMOUNTS;
3643:
3644: /***********************************************************************************************
3645: INSERT_MISSING_PARENT_DENORM: This API will only insert the parent level records for all the
3646: records for which rollup API is called. It expects input in pa_fp_ra_map_tmp table. This API
3647: creates parent record for each currency type and amount type available for child level
3648: records.
3649: Prerequisite: The USER_ENTERED level records have to be updated with all amounts and
3650: currencies.

Line 3651: Records have to be inserted into pa_fp_ra_map_tmp table. This API will be called

3647: creates parent record for each currency type and amount type available for child level
3648: records.
3649: Prerequisite: The USER_ENTERED level records have to be updated with all amounts and
3650: currencies.
3651: Records have to be inserted into pa_fp_ra_map_tmp table. This API will be called
3652: only if there are some records in pa_fp_ra_map_tmp table.
3653: ***********************************************************************************************/
3654:
3655: PROCEDURE INSERT_MISSING_PARENT_DENORM(p_budget_version_id IN NUMBER

Line 3652: only if there are some records in pa_fp_ra_map_tmp table.

3648: records.
3649: Prerequisite: The USER_ENTERED level records have to be updated with all amounts and
3650: currencies.
3651: Records have to be inserted into pa_fp_ra_map_tmp table. This API will be called
3652: only if there are some records in pa_fp_ra_map_tmp table.
3653: ***********************************************************************************************/
3654:
3655: PROCEDURE INSERT_MISSING_PARENT_DENORM(p_budget_version_id IN NUMBER
3656: ,x_return_status OUT NOCOPY VARCHAR2 --File.Sql.39 bug 4440895

Line 3718: FROM pa_fp_ra_map_tmp)

3714: (ppd.amount_type_code = PA_FP_CONSTANTS_PKG.G_AMOUNT_TYPE_QUANTITY AND
3715: ppd.currency_type = PA_FP_CONSTANTS_PKG.G_CURRENCY_TYPE_TRANSACTION))
3716: AND pra.resource_assignment_id in
3717: (SELECT resource_assignment_id
3718: FROM pa_fp_ra_map_tmp)
3719: AND pra.parent_assignment_id IS NOT NULL;
3720:
3721: BEGIN
3722:

Line 3821: /* Insert parents for the records in pa_fp_ra_map_tmp table. As of now the amounts are

3817:
3818: LOOP
3819: EXIT WHEN l_curr_rollup_level = 0;
3820:
3821: /* Insert parents for the records in pa_fp_ra_map_tmp table. As of now the amounts are
3822: inserted as NULL. For each parent we need to insert records for each currency type
3823: and amount type for which their child exists. */
3824: INSERT_PARENT_REC_TMP(p_budget_version_id => p_budget_version_id
3825: ,PX_INSERTING_RES_GROUP_LEVEL => L_INSERTING_RES_GROUP_LEVEL

Line 4008: /* Inserting the parent level records that need to be updated into pa_fp_ra_map_tmp

4004: p_msg_name => 'PA_FP_INV_PARAM_PASSED');
4005: RAISE PA_FP_ROLLUP_PKG.Invalid_Arg_Exc;
4006: END IF;
4007:
4008: /* Inserting the parent level records that need to be updated into pa_fp_ra_map_tmp
4009: from Resource_Assignments and those that are present in the pa_fp_rollup_tmp
4010: (i.e. records that have got updated).*/
4011:
4012: DELETE from pa_fp_ra_map_tmp;

Line 4012: DELETE from pa_fp_ra_map_tmp;

4008: /* Inserting the parent level records that need to be updated into pa_fp_ra_map_tmp
4009: from Resource_Assignments and those that are present in the pa_fp_rollup_tmp
4010: (i.e. records that have got updated).*/
4011:
4012: DELETE from pa_fp_ra_map_tmp;
4013:
4014: pa_debug.g_err_stage := 'inserting into map tmp table';
4015: IF P_PA_DEBUG_MODE = 'Y' THEN
4016: pa_debug.write('ROLLUP_DENORM_AMOUNTS: ' || l_module_name,pa_debug.g_err_stage,3);

Line 4019: INSERT into pa_fp_ra_map_tmp(resource_assignment_id)

4015: IF P_PA_DEBUG_MODE = 'Y' THEN
4016: pa_debug.write('ROLLUP_DENORM_AMOUNTS: ' || l_module_name,pa_debug.g_err_stage,3);
4017: END IF;
4018:
4019: INSERT into pa_fp_ra_map_tmp(resource_assignment_id)
4020: (SELECT DISTINCT tmp.parent_assignment_id
4021: FROM pa_fp_rollup_tmp tmp);
4022:
4023: pa_debug.g_err_stage := 'inserted ' || sql%rowcount || ' records';

Line 4172: (SELECT tmp.resource_assignment_id from pa_fp_ra_map_tmp tmp)

4168: AND ppd2.resource_assignment_id = pra.resource_assignment_id -- Modified for 2801522
4169: )
4170: WHERE ppd1.budget_version_id = p_budget_version_id -- #2839138
4171: AND ppd1.resource_assignment_id in
4172: (SELECT tmp.resource_assignment_id from pa_fp_ra_map_tmp tmp)
4173: RETURNING parent_assignment_id
4174: BULK COLLECT INTO l_parent_ra_id_tbl;
4175:
4176: pa_debug.g_err_stage := 'updated ' || sql%rowcount || ' records';

Line 4312: (SELECT tmp.resource_assignment_id from pa_fp_ra_map_tmp tmp)

4308: AND ppd1.amount_subtype_id = ppd2.amount_subtype_id
4309: )
4310: WHERE ppd1.budget_version_id = p_budget_version_id -- #2839138
4311: AND ppd1.resource_assignment_id in
4312: (SELECT tmp.resource_assignment_id from pa_fp_ra_map_tmp tmp)
4313: RETURNING parent_assignment_id
4314: BULK COLLECT INTO l_parent_ra_id_tbl;
4315:
4316: pa_debug.g_err_stage := 'updated ' || sql%rowcount || ' records';

Line 4327: DELETE FROM pa_fp_ra_map_tmp;

4323: END IF;
4324:
4325: EXIT WHEN l_upd_rec = 0;
4326:
4327: DELETE FROM pa_fp_ra_map_tmp;
4328:
4329: IF nvl(l_parent_ra_id_tbl.last,0) >= 1 THEN
4330:
4331: FORALL i IN l_parent_ra_id_tbl.first..l_parent_ra_id_tbl.last

Line 4333: INSERT INTO pa_fp_ra_map_tmp

4329: IF nvl(l_parent_ra_id_tbl.last,0) >= 1 THEN
4330:
4331: FORALL i IN l_parent_ra_id_tbl.first..l_parent_ra_id_tbl.last
4332:
4333: INSERT INTO pa_fp_ra_map_tmp
4334: (RESOURCE_ASSIGNMENT_ID)
4335: VALUES (l_parent_ra_id_tbl(i));
4336:
4337: pa_debug.g_err_stage := 'inserted ' || sql%rowcount || ' records in map tmp';