Vous êtes sur la page 1sur 6

3/31/2017 Usefulqueries/code/scriptsinOracleAppsOrderManagement

Usefulqueries/code/scriptsinOracleAppsOrder
3rdOctober2012
Management
Usefulqueries/code/scriptsinOracleAppsOrderManagement

Followingaresomeofthemostfrequentlyusedqueriesinoracleappsordermanagement:

[http://2.bp.blogspot.com/
iiTMeOrHzjE/Tc9pzTkBVqI/AAAAAAAAAyM/CnEh1XEAOHM/s1600/ordermanagement.jpg]
[http://www.blogger.com/blogger.g?blogID=1864084320442746779]
Orderheaderinfo
Select*fromoe_order_headers_allooh
whereorder_number=:p_order_number

Operatingunitinfo
select*fromhr_operating_units
whereorganization_id=oe_order_headers_all.org_id

Ordertypeinfo
select*fromapps.oe_transaction_types_tl
wheretransaction_type_id=oe_order_headers_all.order_type_id

Pricelistinfo
select*fromapps.qp_list_headers_tl
wherelist_header_id=oe_order_headers_all.price_list_id

select*fromapps.qp_list_lines
wherelist_header_id=oe_order_headers_all.price_list_id

Findcustomerinfo
select*fromhz_cust_accountshca
wherecust_account_id=oe_order_headers_all.sold_to_org_id

select*fromapps.hz_parties
whereparty_id=hz_cust_accounts.party_id

http://omapps.blogspot.in/2012/10/usefulqueriescodescriptsinoracle.html 1/6
3/31/2017 Usefulqueries/code/scriptsinOracleAppsOrderManagement

FindShiptolocationinfo
select*fromhz_cust_site_uses_all
wheresite_use_id=oe_order_headers_all.ship_to_org_id

select*fromapps.hz_cust_acct_sites_all
wherecust_acct_site_id=hz_cust_site_uses_all.cust_acct_site_id

select*fromhz_party_sites
whereparty_site_id=hz_cust_acct_sites_all.party_site_id

FindBilltolocation
select*fromhz_cust_site_uses_all
wheresite_use_id=oe_order_headers_all.invoice_to_org_id

select*fromhz_cust_acct_sites_all
wherecust_acct_site_id=hz_cust_site_uses_all.cust_acct_site_id

select*fromhz_party_sites
whereparty_site_id=hz_cust_acct_sites_all.party_site_id

actualaddress
select*fromhz_locations
wherelocation_id=hz_party_sites.location_id

Salesrepid
selectnamefromapps.ra_salesreps_allsalerepwhere
salesrep_id=oe_order_headers_all.salesrep_idandrownum=1

Paymentterms
selectnamefromapps.ra_terms_tl
whereterm_id=oe_order_headers_all.payment_term_id
andlanguage='US'

Ordersource
selectnamefromapps.oe_order_sources
whereorder_source_id=oe_order_headers_all.order_source_id
andenabled_flag='Y'

OrderSourceReference
selectorig_sys_document_reffromoe_order_headers_allooh
whereorder_number='&oracleordernumber'

FOBPointCode
selectlookup_codefromar_lookups
wherelookup_type='FOB'andenabled_flag='Y'
andupper(meaning)=upper(oe_order_headers_all.fob_point_code)

Freightterms
selectlookup_codefromapps.oe_lookups
whereupper(lookup_type)='FREIGHT_TERMS'andenabled_flag='Y'
andupper(lookup_code)=upper(oe_order_headers_all.freight_terms_code)

Forsaleschannelcodevalidation
selectlookup_codefromapps.oe_lookups
wherelookup_type='SALES_CHANNEL'andenabled_flag='Y'
http://omapps.blogspot.in/2012/10/usefulqueriescodescriptsinoracle.html 2/6
3/31/2017 Usefulqueries/code/scriptsinOracleAppsOrderManagement

upper(lookup_code)=upper(oe_order_headers_all.sales_channel_code)

Shipmethod
selectship_method_codefromwsh.wsh_carrier_services
whereship_method_code=oe_order_headers_all.shipping_method_code

WarehouseInfo
select*fromorg_organization_definitions
whereorganization_id=oe_order_headers_all.ship_from_org_id

SalesorderLinesDetails
select*fromapps.oe_order_lines_all
whereheader_id=oe_order_headers_all.header_id

Transactionalcurrencycode
selectota.price_list_id,qhb.currency_code
fromont.oe_transaction_types_allota,qp.qp_list_headers_bqhb
whereota.transaction_type_id=oe_order_headers_all.order_type_id
andota.price_list_id=qhb.list_header_id(+)
andNVL(qhb.list_type_code,'PRL')='PRL'
andqhb.currency_code=oe_order_headers_all.transactional_curr_code

Iteminfo
select*fromapps.mtl_system_items_b
wheresegment1likeoe_order_lines_all.ordered_item
andorganization_id=oe_order_lines_all.ship_from_org_id

UOM
selectuom_codefrominv.mtl_units_of_measure_tl
whereupper(uom_code)=upper(oe_order_lines_all.order_quantity_uom)
andlanguage='US'andnvl(disable_date,(sysdate+1))>sysdate

Itemtypecodevalidation
selectlookup_codefromapps.oe_lookups
whereupper(lookup_type)='ITEM_TYPE'
andenabled_flag='Y'
andupper(lookup_code)=oe_order_lines_all.item_type_code

Onhandquantities
select*fromapps.mtl_onhand_quantities
whereinventory_item_id=oe_order_lines_all.inventory_item_id
andorganization_id=oe_order_lines_all.ship_from_org_id

Shipping
select*fromwsh_delivery_details
wheresource_header_id=oe_order_headers_all.header_id

select*fromwsh_delivery_assignments
wheredelivery_detail_id=wsh_delivery_details.delivery_detail_id

select*fromwsh_new_deliveries
wheredelivery_id=wsh_delivery_assignments.delivery_id

select*fromwsh_delivery_legs
wheredelivery_id=wsh_new_deliveries.delivery_id
http://omapps.blogspot.in/2012/10/usefulqueriescodescriptsinoracle.html 3/6
3/31/2017 Usefulqueries/code/scriptsinOracleAppsOrderManagement

select*fromwsh_trip_stopswts
wherestop_id=wsh_delivery_legs.pick_up_stop_id

select*fromwsh_tripswt
wheretrip_id=wsh_trip_stops.trip_id

select*fromorg_organization_definitions
whereorganization_id=wsh_new_deliveries.organization_id

Materialtransactions
select*frommtl_material_transactions
whereinventory_item_id=oe_order_lines_all.inventory_item_id
andorganization_id=oe_order_lines_all.ship_from_org_id

select*frommtl_transaction_types
wheretransaction_type_id=mmt.transaction_type_id

select*fromapps.mtl_txn_source_types
wheretransaction_source_type_id=mmt.transaction_source_type_id
mmt=mtl_material_transactions

JoinbetweenOM,WSH,ARTables
SELECTooh.order_number
,ool.line_id
,ool.ordered_quantity
,ool.shipped_quantity
,ool.invoiced_quantity
,wdd.delivery_detail_id
,wnd.delivery_id
,rctl.interface_line_attribute1
,rctl.interface_line_attribute3
,rctl.interface_line_attribute6
,rct.org_id
,rct.creation_date
,trx_number
,rctl.quantity_ordered
,rct.interface_header_context
FROMoe_order_headers_allooh
,oe_order_lines_allool
,wsh_delivery_detailswdd
,wsh_new_deliverieswnd
,wsh_delivery_assignmentswda
,ra_customer_trx_allrct
,ra_customer_trx_lines_allrctl
WHEREooh.header_Id=ool.header_id
ANDwdd.source_header_id=ooh.header_id
ANDwdd.delivery_detail_Id=wda.delivery_detail_id
ANDwda.delivery_id=wnd.delivery_id
ANDrctl.interface_line_attribute1=to_char(ooh.order_number)
ANDrctl.interface_line_attribute6=to_char(ool.line_id)
ANDrctl.interface_line_attribute3=to_char(wnd.delivery_id)
ANDrctl.customer_trx_id=rct.customer_trx_id

http://omapps.blogspot.in/2012/10/usefulqueriescodescriptsinoracle.html 4/6
3/31/2017 Usefulqueries/code/scriptsinOracleAppsOrderManagement

ANDrct.interface_header_context='ORDERENTRY'

PurchasereleaseconcurrentprogramwilltransferthedetailsfromOMtoPOrequisitions
interface.Thefollowingquerywillverifythesame:
SELECTinterface_source_code,

interface_source_line_id,
quantity,
destination_type_code,
transaction_id,
process_flag,
request_id,
TRUNC(creation_date)
FROMpo_requisitions_interface_all
WHEREinterface_source_code='ORDERENTRY'
ANDinterface_source_line_idIN(SELECTdrop_ship_source_id
FROMoe_drop_ship_sources
WHEREheader_id=&order_hdr_id
ANDline_id=&order_line_id)

Thefollowingsqlisusedtoreviewtherequisition,salesorder,andreceiptnumber.Itshows
thejoinsbetweenvarioustablesinInternalSalesorder(ISO)

SELECTporh.segment1,
porl.line_num,
pord.distribution_num,
ooh.order_number
sales_order,
ool.line_numberso_line_num,
rsh.receipt_num,
rcv.transaction_type
FROMoe_order_headers_allooh,
po_requisition_headers_allporh,
po_requisition_lines_allporl,
po_req_distributions_allpord,
oe_order_lines_allool,
po_system_parameters_allposp,
rcv_shipment_headersrsh,
rcv_transactionsrcv
WHEREooh.order_source_id=posp.order_source_id
ANDporh.org_id=posp.org_id
ANDporh.requisition_header_id=ool.source_document_id
ANDporl.requisition_line_id=ool.source_document_line_id
ANDporh.requisition_header_id=porl.requisition_header_id
ANDporl.requisition_line_id=pord.requisition_line_id
ANDporl.requisition_line_id=rcv.requisition_line_id
ANDpord.distribution_id=rcv.req_distribution_id
ANDrcv.shipment_header_id=rsh.shipment_header_id

Posted3rdOctober2012byKrishnareddy

6 Viewcomments

satish 26November2013at03:18
can u please post the query for getting customer contact in sales order form(which is labelled as customer
contactinsalesorderform)
Reply

http://omapps.blogspot.in/2012/10/usefulqueriescodescriptsinoracle.html 5/6
3/31/2017 Usefulqueries/code/scriptsinOracleAppsOrderManagement

oracleabc 18December2014at00:24
SELECThzp.party_name
INTOlv_cust_num
FROMapps.oe_order_headers_alloeh,
hz_cust_account_roleshca,
hz_partieshzp
WHEREhca.party_id=hzp.party_id
ANDhca.cust_account_role_id=oeh.sold_to_contact_id
ANDoeh.header_id=P_HDR_ID
Reply

MikeNhlengthwa 30June2015at14:42
Plsassistineedtocreateonepurchaseorderpersalesorderondropship
Reply

RakeshRanjan 1November2015at10:36
SharedniceinfoincrispformatbutIdidn'tverifySQLssharedonutblog.
Reply

SudhakarNaidu 8July2016at06:42
IsthereanyjoinbetweenWIP_ENTITIES,wip_discrete_jobsandOMtables?
Reply

ManarSayed 3March2017at12:18
anyhelpforupdatebulkcustomerpricelist?
Reply

Enteryourcomment...

Commentas: Selectprofile...

Publish
Preview

http://omapps.blogspot.in/2012/10/usefulqueriescodescriptsinoracle.html 6/6

Vous aimerez peut-être aussi