Advertisement
EddyCZ

Untitled

Nov 16th, 2023
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.25 KB | None | 0 0
  1. SELECT DISTINCT
  2. line.contract,
  3. line.part_no,
  4. -- MaCoCz ZPA000118 Begin
  5. --Decode(type_, '5' , NULL, line.component_part) component_part,
  6. -- MaCoCz ZPA000118 End
  7. line.eng_chg_level,
  8. line.alternative_no,
  9. Shop_Ord_Code_API.Decode(line.bom_type) bom_type_client,
  10. line.bom_type bom_type_db,
  11. line.eff_phase_in_date,
  12. line.eff_phase_out_date,
  13. line.rowtype,
  14. line.alternative_no,
  15. -- MaCoCz ZPA000118 Begin
  16. --Decode(type_, '5' , NULL, line.qty_per_assembly) qty_per_assembly,
  17. -- MaCoCz ZPA000118 End
  18. -- MaCoCz ZPA000118 - 939937 Begin
  19. line.line_item_no,
  20. -- MaCoCz ZPA000118 - 939937 End
  21. alt.rowstate
  22. FROM MANUF_STRUCTURE_TAB line, MANUF_STRUCT_ALTERNATE_TAB alt, INVENTORY_PART inv
  23. WHERE alt.rowstate NOT IN ('Obsolete','Cancelled')
  24. AND alt.alternative_no = line.alternative_no
  25. AND alt.bom_type = line.bom_type
  26. AND alt.eng_chg_level = line.eng_chg_level
  27. AND alt.contract = line.contract
  28. AND alt.part_no = line.part_no
  29. -- MaCoCz ZPA000118 Begin
  30. AND line.component_part = inv.part_no
  31. AND line.contract = inv.contract
  32. -- MaCoCz ZPA000118 End
  33. --AND NVL(line.eff_phase_out_date, TO_DATE('31.12.99','DD.MM.YY')) > TO_DATE('16.11.23', 'DD.MM.YY')
  34. -- MaCoCz ZPA000118 - 832971 Begin
  35. AND line.part_no >=
  36. (select min (t.part_no) from MANUF_STRUCTURE_TAB t where t.part_no like NVL('A2903584', line.part_no))
  37. AND line.part_no <=
  38. (select max (t.part_no) from MANUF_STRUCTURE_TAB t where t.part_no like NVL('A2903584', line.part_no))
  39. -- MaCoCz ZPA000118 - 832971 End
  40. AND line.part_no = NVL('A2903584', line.part_no)
  41. AND line.contract = 'ZPA'
  42. -- MaCoCz ZPA000118 Begin
  43. --AND line.component_part = nvl (part_out_,line.component_part)
  44. AND line.component_part >= (select min (t.component_part) from MANUF_STRUCTURE_TAB t where
  45. t.part_no = line.part_no
  46. AND t.contract = line.contract
  47. AND t.bom_type = line.bom_type
  48. AND t.eng_chg_level = line.eng_chg_level
  49. AND t.alternative_no = line.alternative_no
  50. AND t.component_part like NVL(NULL, t.component_part))
  51. AND line.component_part <= (select max (t.component_part) from MANUF_STRUCTURE_TAB t where
  52. t.part_no = line.part_no
  53. AND t.contract = line.contract
  54. AND t.bom_type = line.bom_type
  55. AND t.eng_chg_level = line.eng_chg_level
  56. AND t.alternative_no = line.alternative_no
  57. AND t.component_part like NVL(NULL, t.component_part))
  58. -- MaCoCz ZPA000118 End
  59. -- MaCoCz ZPA000118 Begin
  60. AND NVL(inv.description, ' ') like NVL(NULL, '%')
  61. AND NVL(inv.type_designation, ' ') like NVL(NULL, '%')
  62. AND NVL(inv.dim_quality, ' ') like NVL(NULL, '%')
  63. -- MaCoCz ZPA000118 End
  64. ORDER BY line.contract, line.part_no, DECODE(line.bom_type , 'T', to_number(substr(line.eng_chg_level,2)), to_number(line.eng_chg_level)), bom_type_client;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement