Query to find shipset and fulfilment set

Query to find shipset and fulfilment set
Oracle apps shipset and fulfillment set query
  SELECT order_number,
         ship_set_id,
         set_id fullfillment_set_id,
         COUNT (DISTINCT PAYMENT_TERM_ID)
    FROM (SELECT ship_set_id,
                 order_number,
                 line_number,
                 ool.payment_term_id,
                 set_id
            FROM oe_order_headers_all ooh,
                 oe_order_lines_all ool,
                 (SELECT s.set_id,
                         s.set_name,
                         set_status,
                         s.header_id,
                         (SELECT open_flag
                            FROM oe_order_lines_all lin
                           WHERE lin.line_id = ls.line_id)
                            line_open,
                         ls.line_id
                    FROM oe_sets s, oe_line_sets ls, oe_order_headers_all oh
                   WHERE     s.set_id = ls.set_id
                         AND s.set_type = 'FULFILLMENT_SET'
                         AND s.header_id = oh.header_id) fullfillment_set
           WHERE     ooh.header_id = ool.header_id
                 AND ooh.org_id = 1234            -- and order_number=92000065
                 AND fullfillment_set.line_id = ool.line_id)
GROUP BY order_number, ship_set_id, set_id
  HAVING COUNT (DISTINCT PAYMENT_TERM_ID) > 1
Related posts: Upload your own post and refer it anywhere anytime:

Leave a Reply