OPM Actual Item Cost Transaction

Description
Categories: Draft
Columns: Organization Code, Organization Name, Inventory Item Id, Start Date, End Date, Segment1, Description, Batch No, Line Type, Plan Qty ...
SELECT org.organization_code,
       org.organization_name,
       msib.inventory_item_id,
       ps.start_date,
       ps.end_date,
       msib.segment1,
       msib.description,
       gbh.batch_no,
       line_type,
       plan_qty,
       wip_plan_qty,
       original_qty,
       actual_qty,
       cal.cost_cmpntcls_id,
       ccm.cost_cmpntcls_code,
       cal.cost_analysis_code,
       cost_amt trx_cost,
       ccd.cmpnt_cost item_cmpt_cost,
       (actual_qty * cost_amt) yeild_value,
       ps.period_id,
       ps.period_code,
       ps.start_date,
       ps.end_date
  FROM gme_batch_header             gbh,
       gme_material_details         gmd,
       mtl_system_items_b           msib,
       org_organization_definitions org,
       cm_acst_led                  cal,
       cm_cmpt_dtl                  ccd,
       cm_cmpt_mst_b                ccm,
       gmf_period_statuses          ps
 WHERE 1=1
   AND gbh.organization_id = org.organization_id
   AND gbh.batch_id = gmd.batch_id
   AND gmd.inventory_item_id = msib.inventory_item_id
   AND gmd.organization_id = msib.organization_id
   AND cal.cost_cmpntcls_id = ccm.cost_cmpntcls_id
   AND gmd.material_detail_id = cal.transline_id
   AND gmd.inventory_item_id = cal.inventory_item_id(+)
   AND gmd.organization_id = cal.organization_id(+)
      --AND C.PERIOD_ID(+) = :P_PERIOD_ID
      --AND MSIB.INVENTORY_ITEM_ID = :P_INV_ITEM_ID
   AND cal.inventory_item_id = ccd.inventory_item_id
   AND cal.organization_id = ccd.organization_id
   AND cal.period_id = ccd.period_id
   AND cal.cmpntcost_id = ccd.cmpntcost_id
   AND cal.period_id = ps.period_id