<ROOT>
 <APPS_INITIALIZE_DATA>
  <USER_NAME>ENGINATICS</USER_NAME>
  <RESPONSIBILITY_KEY>SYSTEM_ADMINISTRATOR</RESPONSIBILITY_KEY>
  <APPLICATION_SHORT_NAME>SYSADMIN</APPLICATION_SHORT_NAME>
 </APPS_INITIALIZE_DATA>
<REPORTS>
<!-- loader xml for Enginatics Blitz Report: XXDPF Shortages -->
 <REPORTS_ROW>
  <GUID>DBE650AAED5DA722E05362FB09059FC8</GUID>
  <SQL_TEXT>select to_char(0)                                   EBENE,        -- Auflösungsebene in der STL
       to_char(:ASSEMBLY)                           ARTIKEL,   -- Artikelnummer
       (select msit.description
          from mtl_system_items_b msi
              ,mtl_system_items_tl msit
         where 1 = 1
           and msi.organization_id = 207
           and msi.segment1 = :ASSEMBLY
           and msit.organization_id = msi.organization_id
           and msit.inventory_item_id = msi.inventory_item_id
           and msit.language = &apos;US&apos;)                BEZEICHNUNG,  -- Artikelbeschreibung
       null        STL_MENGE,    -- Menge in der Stückliste
       null             FE_EK,        -- Fertigen oder Einkaufen
       null           DISPONENT,    -- Planer aus Artikelstamm
       null             BUYER,        -- Einkäufer aus Artikelstamm Komponente
       null               WBZ,          -- Full Lead Time Komponente
       null               WST,          -- WIP Bereitstellungsart
       null            BEDARF,       -- gesamter Bedarf bis zum eingegebenen Datum
       null           BESTAND,      -- Summe Lagerbestand
       null           EINKAUF,      -- offene Bestellungen bis zum eingebenen Datum
       null       MIN_EK_DATE,  -- frühestest Promise oder Need by Date aus dem Einkauf
       null         FERTIGUNG,    -- offene Fertigungsaufträge bis zum eingegebenen Datum
       null
  from dual
union all
select detail.ebene             EBENE,        -- Auflösungsebene in der STL
       detail.component         KOMPONENTE,   -- Artikelnummer
       detail.comp_desc         BEZEICHNUNG,  -- Artikelbeschreibung
       detail.comp_quant        STL_MENGE,    -- Menge in der Stückliste
       detail.fe_ek             FE_EK,        -- Fertigen oder Einkaufen
       detail.planner           DISPONENT,    -- Planer aus Artikelstamm
       detail.buyer             BUYER,        -- Einkäufer aus Artikelstamm Komponente
       detail.wbz               WBZ,          -- Full Lead Time Komponente
       detail.wst               WST,          -- WIP Bereitstellungsart
       detail.bedarf            BEDARF,       -- gesamter Bedarf bis zum eingegebenen Datum
       detail.bestand           BESTAND,      -- Summe Lagerbestand
       detail.einkauf           EINKAUF,      -- offene Bestellungen bis zum eingebenen Datum
       detail.min_ek_date       MIN_EK_DATE,  -- frühestest Promise oder Need by Date aus dem Einkauf
       detail.fertigung         FERTIGUNG,    -- offene Fertigungsaufträge bis zum eingegebenen Datum
       detail.aufl
  from
(
select lpad(&apos; &apos; , level)||(level) EBENE,
--       bom.assembly,
--       bom.assy_desc,
       bom.item_num,
       bom.component,
       bom.planner,
       bom.buyer,
       bom.wbz,
       bom.comp_desc,
       bom.comp_quant,
       bom.fe_ek,
       bom.wst,
       bom.bedarf,
       bom.bestand,
       bom.einkauf,
       bom.min_ek_date,
       bom.fertigung,
       bom.aufl
  from
(
select msi_assy.segment1 ASSEMBLY,
       substr(msit_assy.description , 1 , 60) ASSY_DESC,
       to_number(bic.item_num) ITEM_NUM,
       msi_comp.segment1 COMPONENT,
       msi_comp.planner_code PLANNER,
       msi_comp.full_lead_time WBZ,
       (select papf.last_name
          from po_agents pa,
               per_all_people_f papf
         where 1 = 1
           and pa.agent_id = msi_comp.buyer_id
           and papf.person_id = pa.agent_id
           and rownum &lt; 2) BUYER,
       substr(msit_comp.description , 1 , 30) COMP_DESC,
       bic.component_quantity COMP_QUANT,
       decode(msi_comp.planning_make_buy_code , 1 , &apos;FE&apos; 
                                              , 2 , &apos;EK&apos;) FE_EK,
       (select meaning 
          from fnd_lookup_values 
         where lookup_type = &apos;WIP_SUPPLY&apos;
           and language = &apos;US&apos;
           and lookup_code = nvl(bic.wip_supply_type , msi_comp.wip_supply_type)) WST,
-- Berechnung ob Auflösen JA / NEIN
       case when
       (select nvl(sum(moqd.primary_transaction_quantity) , 0)
          from mtl_onhand_quantities_detail moqd
         where moqd.organization_id = msi_comp.organization_id
           and moqd.inventory_item_id = msi_comp.inventory_item_id) -
       (select nvl(sum(md.primary_uom_quantity - md.completed_quantity) , 0)
          from mtl_demand md
         where md.inventory_item_id = msi_comp.inventory_item_id
           and md.organization_id = msi_comp.organization_id
           and md.requirement_date &lt;= nvl(:TERMIN , sysdate + 1000)) -
       (select nvl(sum(wro.required_quantity - wro.quantity_issued) , 0)
          from wip_requirement_operations wro,
               wip_discrete_jobs wdj
         where wro.inventory_item_id = msi_comp.inventory_item_id
           and wro.organization_id = msi_comp.organization_id
           and wro.operation_seq_num &gt; 0
           and wdj.wip_entity_id = wro.wip_entity_id
           and wdj.status_type &lt; 5
           and wro.date_required &lt;= nvl(:TERMIN , sysdate + 1000)) -
        nvl(:MENGE , 0) &gt;= 0 
        then &apos;N&apos; 
        else &apos;Y&apos; 
        end AUFL,
-- Ende der Berechnung
       (select nvl(sum(wro.required_quantity - wro.quantity_issued) , 0)
          from wip_requirement_operations wro,
               wip_discrete_jobs wdj
         where wro.inventory_item_id = msi_comp.inventory_item_id
           and wro.organization_id = msi_comp.organization_id
           and wro.operation_seq_num &gt; 0
           and wdj.wip_entity_id = wro.wip_entity_id
           and wdj.status_type &lt; 5
           and wro.date_required &lt;= nvl(:TERMIN , sysdate + 1000)) +
       (select nvl(sum(md.primary_uom_quantity - md.completed_quantity) , 0)
          from mtl_demand md
         where md.inventory_item_id = msi_comp.inventory_item_id
           and md.organization_id = msi_comp.organization_id
           and md.requirement_date &lt;= nvl(:TERMIN , sysdate + 1000)) +
           nvl(:MENGE , 0) BEDARF,
       (select nvl(sum(moqd.primary_transaction_quantity) , 0)
          from mtl_onhand_quantities_detail moqd
         where moqd.organization_id = msi_comp.organization_id
           and moqd.inventory_item_id = msi_comp.inventory_item_id) BESTAND,
       (select nvl(sum(pll.quantity - pll.quantity_received - pll.quantity_cancelled) , 0)
          from po_lines_all pl,
               po_line_locations_all pll
         where pl.item_id = msi_comp.inventory_item_id
           and pll.po_line_id = pl.po_line_id
           and pll.ship_to_organization_id = msi_comp.organization_id
           and pll.closed_code = &apos;OPEN&apos;
           and pll.shipment_type in (&apos;STANDARD&apos; , &apos;BLANKET&apos;)
           and nvl(pll.promised_date , pll.need_by_date) &lt;= nvl(:TERMIN , sysdate + 1000)) EINKAUF,
       (select min(nvl(pll.promised_date , pll.need_by_date))
          from po_lines_all pl,
               po_line_locations_all pll
         where pl.item_id = msi_comp.inventory_item_id
           and pll.po_line_id = pl.po_line_id
           and pll.ship_to_organization_id = msi_comp.organization_id
           and pll.closed_code = &apos;OPEN&apos;
           and nvl(pll.promised_date , pll.need_by_date) &lt;= nvl(:TERMIN , sysdate + 1000)) MIN_EK_DATE,
       (select nvl(sum(wdj.net_quantity - wdj.quantity_completed) , 0)
          from wip_discrete_jobs wdj
         where wdj.organization_id = msi_comp.organization_id
           and wdj.primary_item_id = msi_comp.inventory_item_id
           and wdj.status_type &lt; 5
           and wdj.scheduled_completion_date &lt;= nvl(:TERMIN , sysdate + 1000)) FERTIGUNG
  from bom_bill_of_materials bbom,
       bom_inventory_components bic,
       mtl_system_items_b msi_assy,
       mtl_system_items_tl msit_assy,
       mtl_system_items_b msi_comp,
       mtl_system_items_tl msit_comp
 where bbom.organization_id = 207
   and bic.bill_sequence_id = bbom.bill_sequence_id
   and bic.disable_date is null
   and msi_assy.organization_id = bbom.organization_id
   and msi_assy.inventory_item_id = bbom.assembly_item_id
   and msit_assy.organization_id = msi_assy.organization_id
   and msit_assy.inventory_item_id = msi_assy.inventory_item_id
   and msit_assy.language = &apos;US&apos;
   and msi_comp.organization_id = msi_assy.organization_id
   and msi_comp.inventory_item_id = bic.component_item_id
   and msit_comp.organization_id = msi_comp.organization_id
   and msit_comp.inventory_item_id = msi_comp.inventory_item_id
   and msit_comp.language = &apos;US&apos;
) BOM
 start with bom.assembly = :ASSEMBLY
 connect by prior bom.component = bom.assembly
 order siblings by bom.item_num
) DETAIL
 where
2=2 and
detail.aufl = decode(nvl(upper(:ALLES) , &apos;Y&apos;) , &apos;N&apos; , &apos;Y&apos; , detail.aufl)
   and detail.wst != decode(nvl(upper(:MIT_BULK) , &apos;Y&apos;) , &apos;N&apos; , &apos;Bulk&apos; , &apos;Y&apos; , &apos;xxxx&apos;)
   and detail.ebene &lt;=  to_number(nvl(:MAX_LEVEL , 1000))</SQL_TEXT>
  <ENABLED>Y</ENABLED>
  <REPORT_TRANSLATIONS>
   <REPORT_TRANSLATIONS_ROW>
    <LANGUAGE>US</LANGUAGE>
    <REPORT_NAME>XXDPF Shortages</REPORT_NAME>
    <DESCRIPTION>Bill of Material for a given Assembly with Supply and Demand from ERP Instance</DESCRIPTION>
   </REPORT_TRANSLATIONS_ROW>
  </REPORT_TRANSLATIONS>
  <CATEGORY_ASSIGNMENTS>
  </CATEGORY_ASSIGNMENTS>
  <ANCHORS>
   <ANCHORS_ROW>
    <ANCHOR>2=2</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:alles</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:assembly</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:max_level</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:menge</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:mit_bulk</ANCHOR>
   </ANCHORS_ROW>
   <ANCHORS_ROW>
    <ANCHOR>:termin</ANCHOR>
   </ANCHORS_ROW>
  </ANCHORS>
  <PARAMETERS>
   <PARAMETERS_ROW>
    <SORT_ORDER>1</SORT_ORDER>
    <DISPLAY_SEQUENCE>10</DISPLAY_SEQUENCE>
    <ANCHOR>:assembly</ANCHOR>
    <PARAMETER_TYPE_DSP>Char</PARAMETER_TYPE_DSP>
    <REQUIRED>Y</REQUIRED>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Assembly</PARAMETER_NAME>
      <DESCRIPTION>Assembly</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>2</SORT_ORDER>
    <DISPLAY_SEQUENCE>20</DISPLAY_SEQUENCE>
    <ANCHOR>:alles</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>Yes_No</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
lookup_code id,
meaning value,
null description
from
fnd_lookups
where fnd_lookups.lookup_type=&apos;YES_NO&apos;
order by value,description</LOV_QUERY_DSP>
    <DEFAULT_VALUE>N</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Include all</PARAMETER_NAME>
      <DESCRIPTION>Include All</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>3</SORT_ORDER>
    <DISPLAY_SEQUENCE>30</DISPLAY_SEQUENCE>
    <ANCHOR>:max_level</ANCHOR>
    <PARAMETER_TYPE_DSP>Number</PARAMETER_TYPE_DSP>
    <DEFAULT_VALUE>10</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>max Level</PARAMETER_NAME>
      <DESCRIPTION>Max Level</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>4</SORT_ORDER>
    <DISPLAY_SEQUENCE>40</DISPLAY_SEQUENCE>
    <ANCHOR>:menge</ANCHOR>
    <PARAMETER_TYPE_DSP>Number</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Quantity</PARAMETER_NAME>
      <DESCRIPTION>Add QTY</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>5</SORT_ORDER>
    <DISPLAY_SEQUENCE>50</DISPLAY_SEQUENCE>
    <ANCHOR>:termin</ANCHOR>
    <PARAMETER_TYPE_DSP>Date</PARAMETER_TYPE_DSP>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>Date</PARAMETER_NAME>
      <DESCRIPTION>Date</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
   <PARAMETERS_ROW>
    <SORT_ORDER>6</SORT_ORDER>
    <DISPLAY_SEQUENCE>60</DISPLAY_SEQUENCE>
    <ANCHOR>:mit_bulk</ANCHOR>
    <PARAMETER_TYPE_DSP>LOV Oracle</PARAMETER_TYPE_DSP>
    <LOV_NAME>Yes_No</LOV_NAME>
    <VALIDATE_FROM_LIST_DSP>Y</VALIDATE_FROM_LIST_DSP>
    <LOV_QUERY_DSP>select
lookup_code id,
meaning value,
null description
from
fnd_lookups
where fnd_lookups.lookup_type=&apos;YES_NO&apos;
order by value,description</LOV_QUERY_DSP>
    <DEFAULT_VALUE>N</DEFAULT_VALUE>
    <PARAMETER_TRANSLATIONS>
     <PARAMETER_TRANSLATIONS_ROW>
      <LANGUAGE>US</LANGUAGE>
      <PARAMETER_NAME>with Bulk</PARAMETER_NAME>
      <DESCRIPTION>With Bulk</DESCRIPTION>
     </PARAMETER_TRANSLATIONS_ROW>
    </PARAMETER_TRANSLATIONS>
   </PARAMETERS_ROW>
  </PARAMETERS>
  <PARAMETER_DEPENDENCIES>
  </PARAMETER_DEPENDENCIES>
  <TEMPLATES>
  </TEMPLATES>
  <DEFAULT_TEMPLATES>
  </DEFAULT_TEMPLATES>
  <UPLOAD_COLUMNS>
  </UPLOAD_COLUMNS>
  <UPLOAD_PARAMETERS>
  </UPLOAD_PARAMETERS>
  <UPLOAD_SQLS>
  </UPLOAD_SQLS>
  <UPLOAD_DEPENDENCIES>
  </UPLOAD_DEPENDENCIES>
 </REPORTS_ROW>
</REPORTS>
</ROOT>
