ECC Contract Lifecycle Management, CLM Protest, SQL4

Columns: Ecc Spec Id, Us Document Status ...
Imported from ECC
SELECT * FROM ( SELECT gt.char1 ecc_spec_id,
        flv.meaning document_status,
FROM    po_headers_all poh,
        po_session_gt gt,
        fnd_lookup_values flv
WHERE   poh.po_header_id = gt.index_num2
AND     poh.clm_closeout_status IS NOT NULL
AND     flv.view_application_id (+) = 201
AND     flv.lookup_type  = 'PO_CLM_CLOSEOUT_STATUS'
AND     flv.lookup_code  = poh.clm_closeout_status
AND     flv.language in ( 'US')
AND     gt.key = 3127023 ) PIVOT ( max(document_status) as document_status
                                             FOR language in ( 'US' "US"))