Tuesday 15 November 2016

SQL to check Slace Order Line Pricing in oracle apps

When we do a pricing of a Sales Order  on a bulk level we may need to check the Re-Pricing Status to see if all the lines have been re-priced successfully or not.

In order to see the if the line pricing is successful or not we can use the below SQL

/* Formatted on 11/15/2016 2:36:18 PM (QP5 v5.114.809.3010) */
SELECT   DISTINCT ooh.org_id,
                  ool.creation_date,
                  ool.line_id,
                  ooh.order_number,
                  ool.line_number,
                  ool.ordered_item,
                  ool.unit_selling_price,
                  qlh.name,
                  qll.operand,
                  qll.start_date_active,
                  ool.flow_status_code,
                  ool.calculate_price_flag,
                  ool.unit_list_price
  FROM   oe_order_headers_all ooh,
         oe_order_lines_all ool,
         wsh_delivery_details wdd,
         qp_list_headers qlh,
         qp_list_lines qll,
         qp_pricing_attributes qpa,
         mtl_system_items_b msib
 WHERE       ooh.header_id = ool.header_id
         AND ool.line_id = wdd.source_line_id
         AND wdd.released_status IN ('R', 'B')
         AND qlh.list_header_id = qpa.list_header_id
         AND qpa.product_attr_value = TO_CHAR (msib.inventory_item_id)
         AND msib.organization_id = :warehouse_id
         AND msib.segment1 = ool.ordered_item
         AND qpa.list_line_id = qll.list_line_id
         AND ool.price_list_id = qlh.list_header_id
         AND ooh.order_number = :order_number
         AND ool.unit_selling_price <> qll.operand

For the rows returned by the SQL we need to check the value of calculate_price_flag.
If Calculate_price_flag = N , if we see on front end the value will be Freeze which means that the item re-pricing will not be allowed,

If there are some records where calculate_price_flag = Y and no re-pricing is done please check if any manual modifier is applied on order line, If any modifier is applied overrding the Price List Price then re-pricing will not take place

No comments:

Post a Comment