Wednesday, 7 August 2013

Relation between OM and AR-EBS

SELECT OH.ORDER_NUMBER,
CT.TRX_NUMBER "INVOICE NUMBER",
OH.SALES_CHANNEL_CODE,
to_char(OH.ORDER_NUMBER),
CT.INTERFACE_HEADER_ATTRIBUTE1
---D.ORGANIZATION_CODE "WAREHOUSE ID"
FROM
APPS.OE_ORDER_HEADERS_ALL OH,
APPS.RA_CUSTOMER_TRX_ALL CT
---APPS.ORG_ORGANIZATION_DEFINITIONS OD
where CT.INTERFACE_HEADER_ATTRIBUTE1=to_char(OH.ORDER_NUMBER)
--AND OH.SHIP_FROM_ORG_ID=OD.ORGANIZATION_ID
AND CT.TRX_NUMBER='10009802'

SELECT ooha.order_number,
oola.line_number so_line_number,
oola.ordered_item,
ooha.sales_channel_code,
oola.ordered_quantity * oola.unit_selling_price so_extended_price,
rcta.trx_number invoice_number, rcta.trx_date, rctla.line_number inv_line_number,
rctla.unit_selling_price inv_unit_selling_price FROM  
apps.oe_order_headers_all ooha, apps.oe_order_lines_all oola, apps.ra_customer_trx_all rcta, apps.ra_customer_trx_lines_all rctla
WHERE  ooha.header_id = oola.header_id
AND rcta.customer_trx_id = rctla.customer_trx_id
AND rctla.interface_line_attribute6 = TO_CHAR (oola.line_id)
AND rctla.interface_line_attribute1 = TO_CHAR (ooha.order_number)
---AND order_number = :p_order_number


select order_number,to_char(ORDER_NUMBER) from apps.oe_order_headers_all

No comments:

Post a Comment