ECC Service Contracts, Service Contracts Follow-Up Details

Description
Categories: Enterprise Command Center
Columns: Ecc Spec Id, Contract Id, Follow Up Date ...
Imported from Enterprise Command Center
Dataset Key: oks-followup
Query Procedure: oks_ecc_util_pvt.get_ecc_data_load_info
Security Procedure: oks_ecc_datasecurity_pkg_pub.GetFilterAttributeValues
select
x.*
from
(
select * from (
  SELECT    HDR.ID ecc_spec_id,
  HDR.ID contract_id,
  KHDR.FOLLOW_UP_DATE FOLLOW_UP_DATE
  FROM OKS_K_HEADERS_B khdr,OKC_K_HEADERS_ALL_B hdr
 WHERE hdr.end_date >=  NVL(fnd_date.canonical_to_date(fnd_profile.value('OKS_ECC_CONTARCT_FROM_DATE')),sysdate)
 and    hdr.template_yn = 'N'
 AND     hdr.scs_code IN ('SERVICE', 'WARRANTY', 'SUBSCRIPTION')
 AND     hdr.id = khdr.chr_id
 AND  KHDR.FOLLOW_UP_DATE IS NOT NULL
 union
select ID ecc_spec_id,
  CHR_ID contract_id,
  FOLLOW_UP_DUE_DATE FOLLOW_UP_DATE
FROM  OKS_FOLLOW_UP_ACTIONS
WHERE FOLLOW_UP_COMPLETION_DATE IS NULL
AND   FOLLOW_UP_DUE_DATE >= NVL(fnd_date.canonical_to_date(fnd_profile.value('OKS_ECC_CONTARCT_FROM_DATE')),sysdate))
) x
where
2=2