Join the OracleApps88 Telegram group @OracleApps88to get more information on Oracle EBS R12/Oracle Fusion applications.

If you are facing any issues while copying the Code/Script or any issues with Posts, Please send a mail to OracleApp88@Yahoo.com or message me at @apps88 or +91 905 957 4321 in telegram.

Monday, June 20, 2011

Sales Order Query

select
ooha.order_number "Ordr No ",
ooha.order_category_code "OrdAer Type",
TRUNC(ooha.ordered_date) " Order Date" ,
ooha.flow_status_code "Ordr status",
rac.customer_name "Customer Name",
rac.customer_number "customer number",
raa_bill.address1||', '||RAA_BILL.city||', '||RAA_BILL.state||', '||RAA_BILL.country||', '||RAA_BILL.postal_code "Bill to LOC",
raa_ship.address1||', '||RAA_SHIP.city||', '||RAA_SHIP.state||', '||RAA_SHIP.country||', '||RAA_SHIP.postal_code "Ship to LOC",
msib.segment1 "Item Name" ,
trunc(oola.request_date) "Req Date ",
oola.ordered_quantity "Ordr Qty",
oola.order_quantity_uom "UOM",
oola.source_type_code "Source Type",
oola.flow_status_code "Line Status",
oola.unit_selling_price "Price",
TRUNC((oola.unit_selling_price)*(oola.ordered_quantity )) "LINE TOTAL",
OOHA.transactional_curr_code "CURRENCY"
from
APPS.mtl_system_items_b msib,
APPS.oe_order_lines_all oola,
APPS.oe_order_headers_all ooha,
APPS.ra_customers rac,
APPS.RA_SITE_USES_ALL RASU_BILL,
APPS.RA_ADDRESSES_ALL RAA_BILL,
APPS.RA_SITE_USES_ALL RASU_SHIP,
APPS.RA_ADDRESSES_ALL RAA_SHIP
where 1=1
and oola.header_id = ooha.header_id
and ooha.invoice_to_org_id = RASU_BILL.site_use_id
and RASU_BILL.address_id = RAA_BILL.address_id
and OOHa.ship_to_org_id = RASU_SHIP.site_use_id
and rac.customer_id = ooha.sold_to_org_id
and RASU_SHIP.address_id = RAA_SHIP.address_id
and msib.inventory_item_id = oola.inventory_item_id
and msib.organization_id = oola.org_id
and ( ooha.order_number BETWEEN 14479 AND 14505
OR ooha.order_number = 66454 ) ;

No comments:

Post a Comment

If you are facing any issues while copying the Code/Script or any issues with Posts, Please send a mail to OracleApp88@Yahoo.com or message me at @apps88 or +91 905 957 4321 in telegram.
Best Blogger TipsGet Flower Effect