Thursday 13 June 2013

Sales Order Hold & Release

/* Formatted on 6/13/2013 11:41:04 AM (QP5 v5.114.809.3010) */
select   oha.order_number,
         hs.hold_entity_code credit_check_criteria_code,
         flv.meaning credit_check_criteria,
         hd.name hold_name,
         hd.type_code hold_type,
         hr.release_reason_code,
         flv1.meaning release_reason,
         hs.released_flag,
         hs.hold_entity_id,
         oh.hold_release_id,
         oh.header_id,
         hs.hold_source_id
  from   ont.oe_hold_sources_all hs,
         ont.oe_hold_definitions hd,
         ont.oe_order_holds_all oh,
         ont.oe_order_headers_all oha,
         apps.fnd_lookup_values flv,
         ont.oe_hold_releases hr,
         apps.fnd_lookup_values flv1
 where       hs.org_id = '&ORG_ID'                                    
         and hs.hold_id = hd.hold_id
         and oh.hold_source_id = hs.hold_source_id
         and oh.header_id = oha.header_id
         and flv.lookup_type = 'HOLD_ENTITY_DESC'
         and flv.view_application_id = 660
         and flv.lookup_code = hs.hold_entity_code
         and oh.hold_release_id = hr.hold_release_id
         and flv1.lookup_type = 'RELEASE_REASON'
         and flv1.view_application_id = 660
         and flv1.lookup_code = hr.release_reason_code

No comments:

Post a Comment