/*Production Batch and Status */
SELECT batch_no,flv1.meaning batch_status
--,DECODE(gbh.BATCH_STATUS,1,'Pending',2,'WIP',3,'Completed',4,'Closed','Cancelled') STATUS
,recipe_validity_rule_id,formula_id,routing_id
,actual_start_date,due_date,plan_cmplt_date,actual_cmplt_date
FROM gme_batch_header gbh
,fnd_lookup_values flv1
WHERE -3 = -3
AND flv1.lookup_code = TO_CHAR (gbh.batch_status)
AND flv1.lookup_type = 'GME_BATCH_STATUS'
AND flv1.LANGUAGE = 'US'
-- AND flv1.meaning <> 'Cancelled'