[Home] [Help]
339: ||' - last_update_date), 1,1,0,1,-1,-600) bo_last_update, '
340: ||' step_status , '
341: ||' COUNT(distinct batchstep_no) '
342: ||' OVER (PARTITION BY batch_id) oper_count '
343: ||' FROM gme_batch_steps '
344: -- B5714301, changed the position of operation count
345: -- ||' WHERE batch_id = :pbatch1 '
346: ||' WHERE batchstep_id IN ( select batchstep_id from gme_batch_steps '
347: ||' WHERE batch_id = :pbatch1 ) '
342: ||' OVER (PARTITION BY batch_id) oper_count '
343: ||' FROM gme_batch_steps '
344: -- B5714301, changed the position of operation count
345: -- ||' WHERE batch_id = :pbatch1 '
346: ||' WHERE batchstep_id IN ( select batchstep_id from gme_batch_steps '
347: ||' WHERE batch_id = :pbatch1 ) '
348: ||' AND step_status in (1,2) '
349: ||' AND delete_mark = 0 '
350: -- B5473156, This check is not required as per scenario in the bug
505:
506: UPDATE GMP_APS_OUTPUT_DTL gad
507: SET attribute9 = ( SELECT gbr.batchstep_resource_id
508: FROM GME_BATCH_HEADER gbh,
509: GME_BATCH_STEPS gbs,
510: GME_BATCH_STEP_ACTIVITIES gba,
511: GME_BATCH_STEP_RESOURCES gbr,
512: CR_RSRC_DTL crd
513: WHERE gbh.batch_id = gbs.batch_id
667: ||' DECODE(sign(:LUP2 '
668: ||' - gsa.last_update_date), 1,1,0,1,-1,-500) bsa_last_update '
669: -- For R12.0
670: ||' FROM gme_batch_step_activities gsa, '
671: ||' gme_batch_steps gbs, '
672: ||' gme_batch_step_resources gsr, '
673: ||' cr_rsrc_dtl crd ' -- For R12.0
674: ||' WHERE '
675: ||' gsr.batch_id = gsa.batch_id '
2059: BEGIN
2060: SELECT count(*) INTO v_plan_charges
2061: FROM
2062: gmp_aps_output_dtl gad,
2063: gme_batch_steps gbs
2064: WHERE gad.wip_entity_id = pbatch_id
2065: AND gad.load_type = 10
2066: AND gbs.batch_id = gad.wip_entity_id
2067: AND gbs.batchstep_no = pstep_no
2081: -- For New Batch only B5454215
2082:
2083: IF v_plan_charges <> 0 THEN
2084:
2085: UPDATE gme_batch_steps
2086: SET plan_start_date = pstart_date,
2087: plan_cmplt_date = pend_date,
2088: due_date = pdue_date,
2089: -- For R12.0
2095: AND batchstep_id = pstep_id ;
2096:
2097: ELSE
2098:
2099: UPDATE gme_batch_steps
2100: SET plan_start_date = pstart_date,
2101: plan_cmplt_date = pend_date,
2102: -- For R12.0
2103: due_date = pdue_date,
2112: ELSE
2113:
2114: IF v_plan_charges <> 0 THEN
2115:
2116: UPDATE gme_batch_steps
2117: SET plan_start_date = pstart_date,
2118: plan_cmplt_date = pend_date,
2119: -- For R12.0
2120: plan_charges = DECODE(step_status,1,v_plan_charges,plan_charges),
2125: AND batchstep_id = pstep_id ;
2126:
2127: ELSE
2128:
2129: UPDATE gme_batch_steps
2130: SET plan_start_date = pstart_date,
2131: plan_cmplt_date = pend_date,
2132: last_update_date = SYSDATE,
2133: last_updated_by = puser_id
2263: CURSOR lock_batch_steps IS
2264: SELECT
2265: batch_id
2266: FROM
2267: gme_batch_steps
2268: WHERE
2269: batch_id = v_batch_id
2270: FOR UPDATE NOWAIT;
2271:
2800: ||' DECODE(nvl(gsa.sequence_dependent_ind,0),1,1,0) , '
2801: ||' max((gsr.plan_rsrc_usage/gsr.plan_rsrc_count)) actual_usage '
2802: ||' FROM gme_batch_step_activities gsa,'
2803: ||' gme_batch_step_resources gsr,'
2804: ||' gme_batch_steps gbs '
2805: ||' WHERE gsa.batch_id = :p_batch_id '
2806: ||' AND gbs.batch_id = gsa.batch_id '
2807: ||' AND gsr.batch_id = gsa.batch_id '
2808: ||' AND gsa.delete_mark = 0 '
2920: -- For WIP steps No deletes
2921: DELETE from GME_BATCH_STEP_CHARGES
2922: WHERE batch_id = pbatch_id
2923: AND BATCHSTEP_ID IN ( SELECT batchstep_id
2924: FROM gme_batch_steps
2925: WHERE batch_id = pbatch_id
2926: AND step_status = 1 );
2927: EXCEPTION
2928: WHEN NO_DATA_FOUND THEN
2941: -- UPDATE GME_BATCH_STEP_CHARGES
2942: -- set ACTIVITY_SEQUENCE_NUMBER = (SELECT min(gsa.sequence_dependent_ind)
2943: -- FROM gme_batch_step_activities gsa,
2944: -- gme_batch_step_resources gsr,
2945: -- gme_batch_steps gbs
2946: -- WHERE gsa.batchstep_id = GME_BATCH_STEP_CHARGES.batchstep_id
2947: -- AND gsa.batchstep_id = gbs.batchstep_id
2948: -- AND gsa.batchstep_id = gbs.batchstep_id
2949: -- AND gsr.batch_id = gsa.batch_id
2984: gad.creation_date,
2985: gad.created_by
2986: FROM gmp_aps_output_dtl gad,
2987: gmp_aps_output_tbl gao,
2988: gme_batch_steps gbs,
2989: cr_rsrc_dtl crd
2990: WHERE gad.parent_header_id = gao.header_id
2991: AND gad.group_id = gao.process_id
2992: AND gad.organization_id = gao.organization_id