Friday 23 January 2015

Query to retrive the Sales order and associate invoice.

SELECT
ooh.order_number,
ooh.ORDERED_DATE,
ooh.FLOW_STATUS_CODE SO_Status,
ool.line_number,
msi.SEGMENT1 Item_Name,
ool.ordered_quantity,
rct.TRX_NUMBER Invoice_Num,
rct.TRX_date Invoice_Date,
rct.STATUS_TRX,
decode(rct.COMPLETE_FLAG,'Y','Completed','In Complete') Inv_Status,
ool.UNIT_SELLING_price*ool.ordered_quantity line_total
from
oe_order_headers_all ooh,
oe_order_lines_all ool,
hz_cust_accounts hca,
ra_customer_trx_lines_all rctl,
ra_customer_trx_all rct,
mtl_system_items msi
where
ooh.header_id=ool.header_id
and ooh.sold_to_org_id=hca.cust_account_id
and msi.INVENTORY_ITEM_ID=ool.INVENTORY_ITEM_ID
and msi.ORGANIZATION_ID=ool.SHIP_FROM_ORG_ID
and rct.CUSTOMER_TRX_ID = rctl.CUSTOMER_TRX_ID
and rctl.LINE_TYPE = 'LINE'
and rctl.interface_line_attribute1 = to_char(ooh.ORDER_NUMBER)
and rctl.QUANTITY_invoiced = ool.ORDERED_QUANTITY
and ooh.order_number= 1195372 --517980
order by ool.line_number;

3 comments:

  1. query to find RMA order and receipt :

    SELECT ooha.ORDER_NUMBER "SALES ORDER"
    ,ORDER_CATEGORY_CODE
    ,ORDERED_ITEM
    ,CONTEXT
    ,SUBINVENTORY
    ,SHIPMENT_NUM
    ,RECEIPT_NUM
    ,ATTRIBUTE_CATEGORY
    ,CUSTOMER_ID
    ,UNIT_OF_MEASURE
    ,ITEM_DESCRIPTION
    ,SHIPMENT_LINE_STATUS_CODE
    ,SOURCE_DOCUMENT_CODE
    FROM OE_ORDER_HEADERS_ALL ooha
    ,OE_ORDER_LINES_ALL oola
    ,RCV_SHIPMENT_HEADERS rsh
    ,RCV_SHIPMENT_LINES rsl
    WHERE 1=1
    AND ooha.header_id=oola.header_id
    AND ooha.header_id=rsl.OE_ORDER_HEADER_ID
    AND rsh.shipment_header_id=rsl.shipment_header_id
    AND rsl.OE_ORDER_LINE_ID=oola.line_id
    AND ooha.ORDER_NUMBER='1102261'
    AND SOURCE_DOCUMENT_CODE ='RMA'

    ReplyDelete
  2. Halo,I'm Helena Julio from Ecuador,I want to talk good about Le_Meridian Funding Service on this topic.Le_Meridian Funding Service gives me financial support when all bank in my city turned down my request to grant me a loan of 500,000.00 USD, I tried all i could to get a loan from my banks here in Ecuador but they all turned me down because my credit was low but with god grace I came to know about Le_Meridian so I decided to give a try to apply for the loan. with God willing they grant me  loan of 500,000.00 USD the loan request that my banks here in Ecuador has turned me down for, it was really awesome doing business with them and my business is going well now. Here is Le_Meridian Funding Investment Email/WhatsApp Contact if you wish to apply loan from them.Email:lfdsloans@lemeridianfds.com / lfdsloans@outlook.comWhatsApp Contact:+1-989-394-3740.

    ReplyDelete
  3. Thanks for sharing this blog. The content is beneficial and useful. Very informative post. Visit here to learn more about Data Warehousing companies and Data analytics Companies. I am impressed by the information that you have on this blog. Thanks once more for all the details.Visit here for Top Big Data Companies.

    ReplyDelete

Query to Find Receipt Class and its GL Combinition Query

SELECT ARC.NAME ReceiptClass,        ARC.CREATION_METHOD_CODE Creation_Mehthod,        DECODE (ARC.REMIT_METHOD_CODE,             ...