DBA Data[Home] [Help]

APPS.MSC_PUBLISH_SAFETY_STOCK_PKG dependencies on MSC_SUP_DEM_ENTRIES

Line 1224: --If it is the first record, then insert safety stock into MSC_SUP_DEM_ENTRIES OR

1220: --dbms_output.put_line('At 4');
1221:
1222: -------------------------------------------------------------------------------------
1223:
1224: --If it is the first record, then insert safety stock into MSC_SUP_DEM_ENTRIES OR
1225: --If the current record = the prev record (same plan_id, sr_instance_id, org_id and item_id)
1226: -- and no need to fill the gap between, then insert safety stock into MSC_SUP_DEM_ENTRIES OR
1227: --If it it a new record (the plan_id is different from the prev record plan_id or
1228: -- Sr_instance_id of the current is different from the previous sr_instance_id or

Line 1226: -- and no need to fill the gap between, then insert safety stock into MSC_SUP_DEM_ENTRIES OR

1222: -------------------------------------------------------------------------------------
1223:
1224: --If it is the first record, then insert safety stock into MSC_SUP_DEM_ENTRIES OR
1225: --If the current record = the prev record (same plan_id, sr_instance_id, org_id and item_id)
1226: -- and no need to fill the gap between, then insert safety stock into MSC_SUP_DEM_ENTRIES OR
1227: --If it it a new record (the plan_id is different from the prev record plan_id or
1228: -- Sr_instance_id of the current is different from the previous sr_instance_id or
1229: -- Org_id of the current record is different from the previous org_id or
1230: -- Item_id of the current record is different from the previous item_id)

Line 1231: -- then insert safety stocks into MSC_SUP_DEM_ENTRIES

1227: --If it it a new record (the plan_id is different from the prev record plan_id or
1228: -- Sr_instance_id of the current is different from the previous sr_instance_id or
1229: -- Org_id of the current record is different from the previous org_id or
1230: -- Item_id of the current record is different from the previous item_id)
1231: -- then insert safety stocks into MSC_SUP_DEM_ENTRIES
1232: --------------------------------------------------------------------------------------
1233:
1234: IF t_org_id IS NOT NULL AND t_org_id.COUNT > 0 THEN
1235:

Line 1459: FROM msc_sup_dem_entries

1455: BEGIN
1456: SELECT 1 INTO l_records_exist
1457: FROM dual
1458: WHERE exists ( SELECT 1
1459: FROM msc_sup_dem_entries
1460: WHERE plan_id = -1
1461: AND publisher_order_type = 2
1462: AND designator = p_designator
1463: AND version = l_version);

Line 2012: insert into msc_sup_dem_entries (

2008:
2009: -- IF (l_next_work_date = t_key_date(j)) THEN
2010: IF (t_key_date(j) >= p_horizon_start and t_key_date(j) <= p_horizon_end ) THEN
2011:
2012: insert into msc_sup_dem_entries (
2013: transaction_id,
2014: plan_id,
2015: sr_instance_id,
2016: publisher_name,

Line 2053: msc_sup_dem_entries_s.nextval,

2049: planner_code,
2050: version,
2051: designator
2052: ) values (
2053: msc_sup_dem_entries_s.nextval,
2054: -1,
2055: -1,
2056: t_pub(j),
2057: t_pub_id(j),

Line 2157: insert into msc_sup_dem_entries (

2153: --dbms_output.put_line('Start ' || b_bkt_start_date(k) || ' End ' || b_bkt_end_date(k) );
2154: --dbms_output.put_line(' prev ' || l_prev_work_date );
2155: IF (b_bkt_end_date(k) >= p_horizon_start and b_bkt_end_date(k) <= p_horizon_end ) THEN
2156:
2157: insert into msc_sup_dem_entries (
2158: transaction_id,
2159: plan_id,
2160: sr_instance_id,
2161: publisher_name,

Line 2198: msc_sup_dem_entries_s.nextval,

2194: planner_code,
2195: version,
2196: designator
2197: ) values (
2198: msc_sup_dem_entries_s.nextval,
2199: -1,
2200: -1,
2201: t_pub(j),
2202: t_pub_id(j),

Line 2281: insert into msc_sup_dem_entries (

2277: l_order_type_desc := msc_x_util.get_lookup_meaning ('MSC_X_ORDER_TYPE', SAFETY_STOCK);
2278: l_bucket_type_desc := msc_x_util.get_lookup_meaning('MSC_X_BUCKET_TYPE',b_bkt_type(k));
2279:
2280: IF (b_bkt_end_date(k) >= p_horizon_start and b_bkt_end_date(k) <= p_horizon_end ) THEN
2281: insert into msc_sup_dem_entries (
2282: transaction_id,
2283: plan_id,
2284: sr_instance_id,
2285: publisher_name,

Line 2322: msc_sup_dem_entries_s.nextval,

2318: planner_code,
2319: version,
2320: designator
2321: ) values (
2322: msc_sup_dem_entries_s.nextval,
2323: -1,
2324: -1,
2325: t_pub(j-1),
2326: t_pub_id(j-1),

Line 2400: insert into msc_sup_dem_entries (

2396: l_order_type_desc := msc_x_util.get_lookup_meaning ('MSC_X_ORDER_TYPE', SAFETY_STOCK);
2397: l_bucket_type_desc := msc_x_util.get_lookup_meaning('MSC_X_BUCKET_TYPE',b_bkt_type(k));
2398:
2399: IF (b_bkt_end_date(k) >= p_horizon_start and b_bkt_end_date(k) <= p_horizon_end ) THEN
2400: insert into msc_sup_dem_entries (
2401: transaction_id,
2402: plan_id,
2403: sr_instance_id,
2404: publisher_name,

Line 2441: msc_sup_dem_entries_s.nextval,

2437: planner_code,
2438: version,
2439: designator
2440: ) values (
2441: msc_sup_dem_entries_s.nextval,
2442: -1,
2443: -1,
2444: t_pub(j),
2445: t_pub_id(j),

Line 2531: update msc_sup_dem_entries

2527: FND_FILE.PUT_LINE(FND_FILE.LOG, 'total ' || l_total || ' item ' || t_item_id(j) || ' Key date ' || t_key_date(j));
2528: l_bucket_type_desc := msc_x_util.get_lookup_meaning('MSC_X_BUCKET_TYPE',1);
2529:
2530: IF (trunc(t_key_date(j)) >= trunc(p_horizon_start)) THEN
2531: update msc_sup_dem_entries
2532: set quantity = l_total,
2533: primary_quantity = l_total
2534: where publisher_id = t_pub_id(j)
2535: and publisher_site_id = t_pub_site_id(j)

Line 2547: insert into msc_sup_dem_entries (

2543: l_bucket_type_desc := msc_x_util.get_lookup_meaning('MSC_X_BUCKET_TYPE',t_bucket_type(j));
2544: IF l_rowcount = 0 THEN
2545: FND_FILE.PUT_LINE(FND_FILE.LOG, 'row count = 0' || 'Pub ' || t_pub(j) || 'Pub id ' || t_pub_id(j));
2546: --dbms_output.put_line('row count = 0'|| 'Pub ' || t_pub(j) || 'Pub id ' || t_pub_id(j));
2547: insert into msc_sup_dem_entries (
2548: transaction_id,
2549: plan_id,
2550: sr_instance_id,
2551: publisher_name,

Line 2588: msc_sup_dem_entries_s.nextval,

2584: planner_code,
2585: version,
2586: designator
2587: ) values (
2588: msc_sup_dem_entries_s.nextval,
2589: -1,
2590: -1,
2591: t_pub(j),
2592: t_pub_id(j),

Line 2709: insert into msc_sup_dem_entries (

2705: --dbms_output.put_line(' End ' || b_bkt_end_date(k) || ' prev ' || l_prev_work_date);
2706:
2707: IF (b_bkt_end_date(k) >= p_horizon_start ) THEN
2708:
2709: insert into msc_sup_dem_entries (
2710: transaction_id,
2711: plan_id,
2712: sr_instance_id,
2713: publisher_name,

Line 2750: msc_sup_dem_entries_s.nextval,

2746: planner_code,
2747: version,
2748: designator
2749: ) values (
2750: msc_sup_dem_entries_s.nextval,
2751: -1,
2752: -1,
2753: t_pub(j),
2754: t_pub_id(j),

Line 2818: insert into msc_sup_dem_entries (

2814:
2815: l_bucket_type_desc := msc_x_util.get_lookup_meaning('MSC_X_BUCKET_TYPE',t_bucket_type(j));
2816:
2817: IF ( t_key_date(j) >= p_horizon_start) THEN
2818: insert into msc_sup_dem_entries (
2819: transaction_id,
2820: plan_id,
2821: sr_instance_id,
2822: publisher_name,

Line 2859: msc_sup_dem_entries_s.nextval,

2855: planner_code,
2856: version,
2857: designator
2858: ) values (
2859: msc_sup_dem_entries_s.nextval,
2860: -1,
2861: -1,
2862: t_pub(j),
2863: t_pub_id(j),

Line 2921: update msc_sup_dem_entries

2917:
2918: --dbms_output.put_line('update date ' || t_key_date(j) || ' qty ' || l_total || ' t tol ' || t_total_qty(j) || ' ex ' || l_exp_qty);
2919: --dbms_output.put_line('update');
2920: IF (t_key_date(j) >= p_horizon_start) THEN
2921: update msc_sup_dem_entries
2922: set quantity = l_total,
2923: primary_quantity = l_total
2924: where publisher_id = t_pub_id(j)
2925: and publisher_site_id = t_pub_site_id(j)

Line 2937: insert into msc_sup_dem_entries (

2933: l_bucket_type_desc := msc_x_util.get_lookup_meaning('MSC_X_BUCKET_TYPE',t_bucket_type(j));
2934: IF l_rowcount = 0 THEN
2935: FND_FILE.PUT_LINE(FND_FILE.LOG, 'row count = 0' || 'Pub ' || t_pub(j) || 'Pub id ' || t_pub_id(j));
2936: --dbms_output.put_line('row count = 0'|| 'Pub ' || t_pub(j) || 'Pub id ' || t_pub_id(j));
2937: insert into msc_sup_dem_entries (
2938: transaction_id,
2939: plan_id,
2940: sr_instance_id,
2941: publisher_name,

Line 2978: msc_sup_dem_entries_s.nextval,

2974: planner_code,
2975: version,
2976: designator
2977: ) values (
2978: msc_sup_dem_entries_s.nextval,
2979: -1,
2980: -1,
2981: t_pub(j),
2982: t_pub_id(j),

Line 3063: insert into msc_sup_dem_entries (

3059: l_bucket_type_desc := msc_x_util.get_lookup_meaning('MSC_X_BUCKET_TYPE',b_bkt_type(k));
3060:
3061: IF (b_bkt_end_date(k) >= p_horizon_start and b_bkt_end_date(k) <= p_horizon_end ) THEN
3062:
3063: insert into msc_sup_dem_entries (
3064: transaction_id,
3065: plan_id,
3066: sr_instance_id,
3067: publisher_name,

Line 3104: msc_sup_dem_entries_s.nextval,

3100: planner_code,
3101: version,
3102: designator
3103: ) values (
3104: msc_sup_dem_entries_s.nextval,
3105: -1,
3106: -1,
3107: t_pub(j-1),
3108: t_pub_id(j-1),

Line 3191: insert into msc_sup_dem_entries (

3187: l_bucket_type_desc := msc_x_util.get_lookup_meaning('MSC_X_BUCKET_TYPE',b_bkt_type(k));
3188:
3189: IF (b_bkt_end_date(k) >= p_horizon_start and b_bkt_end_date(k) <= p_horizon_end ) THEN
3190:
3191: insert into msc_sup_dem_entries (
3192: transaction_id,
3193: plan_id,
3194: sr_instance_id,
3195: publisher_name,

Line 3232: msc_sup_dem_entries_s.nextval,

3228: planner_code,
3229: version,
3230: designator
3231: ) values (
3232: msc_sup_dem_entries_s.nextval,
3233: -1,
3234: -1,
3235: t_pub(j),
3236: t_pub_id(j),

Line 3321: delete from msc_sup_dem_entries sd

3317: --dbms_output.put_line('In delete_old_safety stock');
3318:
3319:
3320: IF ( p_overwrite = 1) THEN --delete all
3321: delete from msc_sup_dem_entries sd
3322: where sd.publisher_order_type in (SAFETY_STOCK, PROJECTED_AVAILABLE_BALANCE) and
3323: sd.plan_id = -1 and
3324: sd.publisher_id = 1 and
3325: exists (select cs.company_site_id

Line 3351: delete from msc_sup_dem_entries sd

3347: l_row := SQL%ROWCOUNT;
3348: FND_FILE.PUT_LINE(FND_FILE.LOG, 'Deleted number records: ' || l_row);
3349: --dbms_output.put_line('Deleted number records: ' || l_row);
3350: ELSIF ( p_overwrite = 2) THEN --delete by overwritten
3351: delete from msc_sup_dem_entries sd
3352: where sd.publisher_order_type in (SAFETY_STOCK, PROJECTED_AVAILABLE_BALANCE) and
3353: sd.plan_id = -1 and
3354: sd.publisher_id = 1 and
3355: exists (select cs.company_site_id