Wednesday, March 30, 2016

SQL- ship confirm rule

 SELECT distinct wsh.name rule_name
 --, wdd.source_header_type_id , ott.attribute1,
 ,wda.delivery_id
              FROM wsh_ship_confirm_rules_v wsh,
                   fnd_lookup_values fnd,
                   wsh_delivery_assignments wda,
                   wsh_delivery_details wdd
                 , oe_transaction_types ott
             WHERE     wsh.name = fnd.meaning
                   AND fnd.lookup_type = 'KF DEF SHIP CONFIRM RULE'
                   AND wdd.delivery_detail_id = wda.delivery_detail_id
                   AND wda.delivery_id  in (  684472,674497)
                   AND wdd.source_code = 'OE'
                   AND wdd.source_header_type_id = ott.transaction_type_id
                AND ott.attribute1 = fnd.lookup_code
                   ;

No comments: