Архив

Публикации с меткой ‘GME’

Модуль GME/INV — Связка между заданиями и транзакциями

select *
from gme_batch_header          gbh,
     gme_material_details      gmd,
     mtl_material_transactions mmt
where 1=1
      and gbh.batch_type = 0
      -- gmd
      and gmd.batch_id = gbh.batch_id
      -- mmt
      and mmt.transaction_source_id = gmd.batch_id
      and mmt.trx_source_line_id    = gmd.material_detail_id
      -- for test
      --and trunc(gbh.plan_start_date) >
      --and gbh.batch_no =
      --and mmt.attribute_category =
      and rownum<100;

Модуль GME/GMD – Связка между формулой, рецептом и правилами применимости

select msi.organization_id    as org_id,
       md.formula_id          as formula_id,
       md.formulaline_id      as formulaline_id,
       md.line_type           as line_type,
       msi.inventory_item_id  as item_id,
       msi.segment1           as item_no,
       msi.description        as item_descr,
       rr.start_date          as start_date,
       nvl(rr.end_date,to_date('01-01-2099','dd-mm-yyyy')) as end_date
/**/
from mtl_system_items_b        msi,
     fm_matl_dtl               md,
     gmd_recipes               r,
     gmd_recipe_validity_rules rr
where 1 = 1
      -- formula
      and md.organization_id   = msi.organization_id
      and md.inventory_item_id = msi.inventory_item_id
      -- recipes
      and r.formula_id    = md.formula_id
      and r.recipe_status = 700 -- Утверждено для общего использования
      and r.delete_mark   = 0   -- не помечен на удаление
      and r.owner_organization_id =  md.organization_id
      -- recepe rules
      and rr.recipe_id       = r.RECIPE_ID
      and rr.organization_id = md.organization_id
      and rr.delete_mark          = 0   -- не помечен на удаление
      and rr.validity_rule_status = 700 -- Утверждено для общего использования
      and rr.recipe_use           = 0   -- использование рецепта = Производство
order by msi.organization_id, md.formula_id, md.line_type desc, md.line_no


Модуль GME/GMD — Получить количество из формулы для строки задания

select gbh.organization_id,
       gbh.batch_no,
       gmd.inventory_item_id,
       gmd.line_type,
       md.qty
from fm_matl_dtl md, gme_material_details gmd, gme_batch_header gbh
where 1 = 1
      and gmd.batch_id = gbh.batch_id
      and gmd.organization_id = gbh.organization_id
      and md.formula_id = gbh.formula_id
      and md.formulaline_id = gmd.formulaline_id
order by gbh.organization_id,
          gbh.batch_no,
          gmd.inventory_item_id,
          gmd.line_type
Categories: Oracle e-Business Suite, SQL Tags: , ,