Friday, February 20, 2015

Script to Get the Sales Order Total Amount in Oracle Order Managment

DECLARE
   p_header_id                   NUMBER := 1084842;
   p_subtotal                    NUMBER;
   p_discount                    NUMBER;
   p_charges                     NUMBER;
   p_tax                         NUMBER;
   p_total                       NUMBER;
BEGIN
   apps.oe_oe_totals_summary.order_totals (p_header_id,
                                           p_subtotal,
                                           p_discount,
                                           p_charges,
                                           p_tax);
   p_total                         := p_subtotal + p_charges + p_tax;
   DBMS_OUTPUT.put_line (   'Order Subtotal : '
                         || p_subtotal
                         || ' Discount : '
                         || p_discount
                         || ' Charges : '
                         || p_charges
                         || ' Tax Amount : '
                         || p_tax
                         || ' Order Total:'
                         || p_total);
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line (   'UBEXP_ERROR In Main : '
                            || SUBSTR (SQLERRM, 1, 250));
END;