Advance Supply Chaining Scripts - ASCP Full Pegging Concept Script

ASCP Pegging Script

SELECT DISTINCT msc.organization_code m_organization_code,
                      msc.category_name m_category_name,
                      item_segments m_item_segments,
                      msc.description m_description,
                      order_type_text m_order_type_text,
                      TO_CHAR (new_due_date) m_new_due_date,
                      TO_CHAR (quantity_rate) m_quantity_rate,
                     
                      --                TO_CHAR (msc.disposition_id),
--                TO_CHAR (msc.transaction_id) m_transaction_id,
                      b.item_name s1_item, b.description s1_desc,
                      d.meaning s1_order_type,
                      c.order_number s1_order_number,
                      TO_CHAR (a.demand_quantity) s1_demand_quantity,
                      (a.allocated_quantity) s1_allocated_quantity,
                      TO_CHAR (a.end_item_usage) s1_end_item_usage,
                      TO_CHAR (a1.end_item_usage) s2_end_item_usage,
                      a.demand_date s1_supply_date,
              --                TO_CHAR (a.transaction_id) s1_transaction_id,
--                TO_CHAR (a.demand_id),
                                                   msc1.item_name s2_item,
                      msc1.description s2_desc,
                      c1.order_number s2_order_number,
                      TO_CHAR (a1.demand_quantity) s2_demand_quantity,
                      TO_CHAR (a1.allocated_quantity) s2_allocated_quantity,
                      TO_CHAR (a1.demand_date) s2_supply_date,
                      TO_CHAR (c.new_order_quantity) c_qty,
                      TO_CHAR (c1.new_order_quantity) c1_qty,
                      d1.meaning s2_order_type
                 FROM msc_full_pegging a,
                      msc_system_items b,
                      msc_supplies c,
                      mfg_lookups d,
                      msc_orders_v msc,
                      msc_full_pegging a1,
                      msc_system_items msc1,
                      msc_supplies c1,
                      mfg_lookups d1
                WHERE 1 = 1
                  AND a.inventory_item_id = b.inventory_item_id
                  AND a.organization_id = b.organization_id
                  AND a.plan_id = b.plan_id
                  AND a.plan_id = c.plan_id
                  AND a.transaction_id(+) = c.transaction_id
                  AND d.lookup_type = 'MRP_ORDER_TYPE'
                  AND d.lookup_code = c.order_type
                  AND msc.transaction_id = a.transaction_id
--                  AND item_segments IN ('SK4-D16X2000')
                  AND msc.category_set_id = 23
                  AND msc.order_type_text NOT IN
                         ('Work order demand', 'Sales Orders',
                          'Planned order demand', 'Non-standard job demand')
                  AND msc.category_id = p_category
--:p_category                           --4220
                  AND msc.plan_id = p_plan
--:p_plan                                  -- 2021
                  AND msc.organization_id = p_org                     --:p_org
                  AND a.prev_pegging_id = a1.pegging_id(+)
                  AND a1.inventory_item_id = msc1.inventory_item_id(+)
                  AND a1.organization_id = msc1.organization_id(+)
                  AND a1.plan_id = msc1.plan_id(+)
                  AND a1.transaction_id = c1.transaction_id(+)
                  AND c1.order_type = d1.lookup_code
                  AND d1.lookup_type = 'MRP_ORDER_TYPE'
                  AND msc.plan_id = a.plan_id
                  AND msc1.plan_id = a1.plan_id

Comments

  1. Its impressive to know something about your note on Oracle apps Course. Please do share your articles like this your articles for our awareness. Mostly we do also provide Online Training on Cub training oracle apps course.

    ReplyDelete
  2. Can we have sql/plsql script to get the supply&demands horizontal plan as we see on the screen?

    Thanks in advence.

    ReplyDelete
  3. Nice information. Thanks for sharing such an amazing article. For online training and Self Paced courses visit our site click4learning.com/product/oracle-ascp/

    ReplyDelete

Post a Comment

Popular posts from this blog

Oracle Shipping Network SQL Query

Oracle Ar Invoice Numbering Sequence alter to avoid missing in between by cache