Thursday, September 6, 2012

Query to get the details of discounts on the orders in Order Management

SELECT   h.transactional_curr_code           Currency2,
      ot.name                       Order_Type,
      DECODE(SUBSTR(UPPER(:P_ORDER_BY),1,1),'C',CUST_ACCT.CUST_ACCOUNT_ID,NULL) CUSTOMER_ID,
      DECODE(SUBSTR(UPPER(:P_ORDER_BY),1,1),'C',PARTY.PARTY_NAME,NULL) CUSTOMER_NAME_2,
      h.order_number                Order_Number,
      PARTY.PARTY_NAME  CUSTOMER_NAME_1, 
      CUST_ACCT.ACCOUNT_NUMBER CUSTOMER_NUMBER,
            h.ordered_date                Order_Date,

Code to write in before report and after report trigger - Oracle Reports

Piece of code to write in before report trigger

function BeforeReport return boolean is
begin
  BEGIN
  SRW.USER_EXIT('FND SRWINIT');

Query to check the line workflows assigned to an order type



exec MO_GLOBAL.SET_POLICY_CONTEXT('S',102);

SELECT OWA.order_type_id,
       ol.name,
       oe.meaning item_type_code,
       wf.display_name line_flow
  FROM wf_activities_vl wf,
       oe_workflow_assignments OWA,
       oe_line_types_v ol,
       oe_lookups oe
 WHERE     OWA.line_type_id = ol.line_type_id
       AND oe.lookup_type(+) = 'WF_ASSIGN_ITEM_TYPES'
       AND oe.lookup_code(+) = OWA.item_type_code
       AND wf.name = OWA.process_name
       AND wf.item_type = 'OEOL'
       AND wf.version =
              (SELECT MAX (version)
                 FROM wf_activities_vl wf1
                WHERE wf1.name = wf.name AND wf1.item_type = 'OEOL');

Query to check the workflow assigned to an order type

Query to check the workflow assigned to an order type


  SELECT ot.order_type_id,
         ot.name order_type_name,
         ot.description,
         ot.start_date_active,