Вы находитесь на странице: 1из 64

OM Flow Status Meanings Sales Order Line Status Flow and Meaning

Below are some of the different statuses of Sales Order Line with brief explanation OM = Order Management Sales order form SE = Shipping Transactions or execution form 1 Entered (OM)! Order is sa"ed but not boo#ed $ Booked (OM)! Order is Boo#ed% & Awaiting Shipping (OM)! Order is boo#ed but lines are not 'et pic#ed% (a"igating to Shipping Execution) the deli"er' line status flow is! * Not Ready to Release (SE)! + deli"er' line ma' be in this status when it is interfaced manuall' into Shipping) is not scheduled and has no reser"ations% ,hen lines are imported automaticall' from Order Management this status is not used - Released to Warehouse (SE)! .ic# /elease has started but not 'et completed% One of the reason could be allocation ha"e not been pic# confirmed% The .ic# /elease process creates a Mo"e Order 0eader 1 Mo"er Order Line in 2n"entor'% This is a common status for users that perform a two3step pic# release process% This status indicates that in"entor' allocation has occurred howe"er pic# conformation has not 'et ta#en place%

4 Ready to Release (SE)! Order Line is boo#ed and passed to shipping execution% The line is now eligible to pic# /elease% 5 Backordered(SE)! The status of Bac#orderd is assigned to a line under the following circumstances% The .ic# /elease process attempted to allocate in"entor' to the line and all or a partial 6uantit' of the item was not a"ailable% 2n this case the s'stem automaticall' bac#orders the discrepant 6uantit'% +t Ship confirm the user enters a shipped 6uantit' for an item that is less than the original re6uested 6uantit'% The user manuall' Bac#orders the entire deli"er'% 7 Shipped (SE)! The deli"er' line is shipped confirmed% 8 Con ir!ed (SE)! The deli"er' line is shipped or bac#ordered and the trip stops are open% 19 "icked (OM)! .ic# release is complete) both allocations and pic# confirm 11 "icked "artial (OM)! This status occurs when a deli"er' line is not allocated the full 6uantit' during .ic# /elease and Ship :onfirm has not occurred 1$ #nter aced (SE)! The deli"er' line is shipped and 2n"entor' interface concurrent process is complete% 1& Awaiting $ul ill!ent (OM)! ,hen fulfillment set is used) (ot all shippable lines in a fulfillment set or a configuration are fulfilled 1* $ul illed (OM)! +ll lines in a fulfillment set are fulfilled% 1- #nter aced to Recei%a&les (OM)! The order is lin#ed with /ecei"ables and the in"oice is created% 14 "artially #nter aced to Recei%a&les (OM)! This status is used in a .TO flow and indicates that the particular .TO item is re6uired for re"enue% 15 Closed (OM)! :losed indicates that the line is closed% 17 Canceled (OM)! 2ndicates that the line has been completel' canceled% (o further processing will occur for this line%

Query to find out order and line hold information.


select distinct ohd.name ,ooh.hold_until_date ,ooh.hold_comment ,h.order_number ,l.item_identifier_type ,l.inventory_item_id ,l.ordered_item ,oh.header_id ,oh.line_id ,oh.order_hold_id from oe_hold_definitions ohd, oe_hold_sources_all ooh, oe_order_headers_all h, oe_order_lines_all l, oe_order_holds_all oh where ohd.hold_id = ooh.hold_id and oh.hold_source_id = ooh.hold_source_id and oh.header_id = h.header_id and h.header_id=l.header_id and l.open_flag='Y' and h.open_flag='Y' order by ohd.name,h.order_number

Query to find the Shipper detial Information.


select distinct wnd.delivery_id ,wnd.name ,wnd.customer_id ,wnd.volume ,wnd.status_code ,wnd.ship_method_code ,wnd.initial_pickup_date ,wdd.cust_po_number ,wdd.requested_quantity_uom ,wdd.shipped_quantity ,wdd.requested_quantity ,wdd.subinventory ,wdd.shipment_priority_code ,wdd.released_status ,wdd.serial_number ,wdd.lot_number --,msib.segment -- ,msib.description -- ,msib.revision_qty_control_code from wsh_new_deliveries wnd, wsh_delivery_assignments wda, wsh_delivery_details wdd, -- mtl_system_items_b msib, oe_order_lines_all l, oe_order_headers_all h where wnd.delivery_id = wda.delivery_id !"# wdd.delivery_detail_id = wda.delivery_detail_id !"# wdd.source_line_id = l.line_id --and wdd.organi$ation_id=msib.organi$ation_id !"# wdd.source_header_id = l.header_id !"# l.header_id = h.header_id and wnd.delivery_id=%&'(

Query to find out Move order line details


select mhl.request_number ,l.line_number ,h.order_number ,mrl.line_number ,mrl.line_id ,mrl.from_subinventory_code ,mrl.lot_number ,mrl.serial_number_start ,mrl.serial_number_end ,mrl.uom_code ,mrl.quantity

,mrl.quantity_delivered ,mrl.quantity_detailed ,wdd.source_header_number ,wdd.source_header_id ,wdd.source_line_id ,wdd.shipping_instructions ,wdd.inventory_item_id ,wdd.requested_quantity_uom ,wdd.ship_method_code ,wdd.subinventory ,wdd.shipment_priority_code ,wdd.organi$ation_id ,wdd.released_status ,wdd.source_code ,wnd.delivery_id ,wnd.name ,wnd.initial_pickup_location_id ,wnd.creation_date ,msib.segment ,msib.description ,msib.revision_qty_control_code from mtl_t)n_request_lines mrl, mtl_t)n_request_headers mhl, wsh_delivery_details wdd, wsh_new_deliveries wnd, wsh_delivery_assignments wda, oe_orde*_lines_all l, oe_order_headers_all h mtl_system_items_b msib where mhl.header_id=mrl.header_id and mrl.line_id=wdd.move_order_line_id and wda.delivery_id=wnd.delivery_id+,and wdd.delivery_detail_id = wda.delivery_detail_id and wdd.source_header_id=l.header_id and wdd.source_line_id=l.line_id and h.header_id=l.header_ and wdd.organi$ation_id=msib.organi$ation_id+,and wdd.inventory_item_id=msib.inventory_item_id+,and mhl.request_number=' '../ ' --order by wdd.creation_date desc --and wnd.delivery_id= 0&%1

Query to find price discounts and surcharges on order lines


select h.order_number ,l.line_number ,l.unit_list_price ,l.ordered_quantity ,pa.list_line_type_code ,pa.arithmetic_operator ,pa.operand ,pa.modifier_level_code ,pa.ad2usted_amount

,decode+pa.modifier_level_code,'3*#4*', l.unit_list_price5l.ordered_quantity5pa.operand5sign+pa.ad2usted_amount-6 '', +pa.ad2usted_amount5nvl+l.ordered_quantity,'--- #iscount_!mount from oe_order_headers_all h, oe_order_lines_all l, oe_price_ad2ustments pa where h.header_id = l.header_id and h.org_id = l.org_id and h.header_id = pa.header_id and l.line_id = pa.line_id+,and h.order_number=(70108

Shipping
#elivery 9ab, choose :hip ;onfirm and <3 9he ship confirmation window will appear and give you the options to backorder, ship all or ship partial quantities and set user defined shipping documents to print. 4nter the trip creation options vi$= :hip method, departure date, close trip and defer interface.9he ship confirm process triggers the inventory interface automatically to update quantities, and triggers the 3rder >anagement ?nterface to update the status of the order lines. @ig=/.( :hipping 9he items on the delivery gets shipped to the customer at this stage. 9he :ales order line information line level status becomes :hipped. oe_order_lines_all +flow_status_code AshippedBwsh_delivery_details +released_status A;B A:hippedBmtl_material_TRANSA TI!NS +linked through 9ransaction source header id?tem deducted from >9C_3"D!"#_EF!"9?9?4: "e)t :tep we need to run the G3*H @C3G I!;H<*3F"# J*3;4:: 93 J3JFC!94 9D4 !* INT"R#A " TA$%". "!K=*eports !nd *equests-L*un *equests Jrocess defered to set =Yes

Query to find delivery leg and pic& up stop info


select wt.name ,wt.status_code ,wt.vehicle_item_id ,wt.vehicle_number ,wt.carrier_id ,wt.ship_method_code ,wts.stop_id ,wts.trip_id ,wts.stop_location_id ,wts.status_code ,wts.stop_sequence_number ,wts.planned_arrival_date ,wts.planned_departure_date ,wts.actual_arrival_date ,wts.actual_departure_date

,wts.departure_net_weight ,wts.weight_uom_code ,wdl.delivery_leg_id ,wdl.delivery_id ,wdl.sequence_number ,wdl.pick_up_stop_id ,wdl.drop_off_stop_id ,wdl.shipper_title ,wdl.shipper_phone ,wdl.delivered_quantity ,wdl.loaded_quantity ,wdl.received_quantity from wsh_trips wt, wsh_trip_stops wts, wsh_delivery_legs wdl where wt.trip_id=wts.trip_id and wts.stop_id=wdl.pick_up_stop_id and wdl.delivery_id= &%0/

R'N A'T!IN(!I " )R! "SS.


!fter shipping the order the order lines gets eligible to get transfered to RA_INT"R#A "_%IN"S_A%%. Gorkflow background engine picks those records and post it to RA_INT"R#A "_%IN"S_A%%. 9his is also called *eceivables interface, that mean information moved to accounting area for invoicing details. ?nvoicing workflow activity transfers shipped item information to 3racle *eceivables. !t the same time records also goes in the table RA_INT"R#A "_SA%"S R"*ITS_A%% which hold details of sales credit for the particular order. ra_interface_lines_all +interface table into which the data is transferred from order management9hen !utoinvoice program imports data from this table which get affected into this stage are receivables base table. !t the same time records goes in. ra_customer_tr+_all +cust_tr)_id is primary key to link it to tr)_lines table and tr)_number is the invoice numberra_customer_tr+_lines_all +line_attribute_ and line_attribute_1 are linked to order number and line_id of the ordersGe need to logon !ccount *eceivables >odule to run the !uto ?nvoice Jrogram. *eceivables,Kision 3perations ontrol ,-Re.uest,- Run ;hoose the auto invoice master program and pass the mandatory parameters. ;lick ok button and :ubmit Iutton. 9he Ielow :creen shot view the concurrent request id .%1&7 7 to view the auto invoice import program to check the transaction imported successfully or not. <o to 3rder >anagement *esponsibility !rders/returns,-sales orders Euery the information using the order number and click the C?"4: tab, click on the actions button lov,choose the !dditional Cine information, ;lick on the ?nvoice6;redit >emos tab here we have to seen the transaction number.

<o to the *eceivables *esponsibilities TRANSA TI!NS,-TRANSA TI!NS Euery the information using the transaction number6order number+reference-. ?t will shows the transaction details. !nd ;lick the line items button,it will shows the line information. ;reate the *eceipt using the 9ransaction "umber. Receipts,-Receipts ;lick to !pply Iutton. 9he !pplication for opens up and check whether to filed showing the invoice number and amount applied filed and save the record close the window. *eceipt will be ceated to that particular transaction. ;lick the receipt history it will shows details of receipt. 9his will shows the receipt history details. Ge can go to ;ollection @orm and view the !mount detils from the customer. ollections,-Account *etails Dere enter the customer number click on the @ind Iutton 9his window will shows the account details of customer balance due amount and invoiced amount.

Query to find the Invoice and $an& details information.


select ra.tr)_number ,ra.customer_tr)_id ,ra.tr)_date ,ra.ship_date_actual ,ral.description item_desc ,ral.quantity_ordered ,ral.quantity_invoiced ,ral.unit_selling_price ,ral.sales_order ,ral.sales_order_date ,ral.line_type ,ral.e)tended_amount ,ral.revenue_amount ,al.lookup_code ,al.lookup_type ,al.meaning ,rt.name ,bank_account_id ,bank_account_name ,bank_account_num ,bank_account_type ,account_holder_name ,abb.bank_name ,abb.bank_branch_name ,abb.address_line MM','MMcityMM','MMstateMM','MMcountry !ddress ,abb.bank_num --,rct.name -- ,rct.description --,rct.type from ra_customer_tr)_all ra ,ra_customer_tr)_lines_all ral

,ar_lookups al ,ra_terms rt ,ap_bank_accounts ab ,ap_bank_branches abb --,ra_cust_tr)_types_all rct where ra.customer_tr)_id=ral.customer_tr)_id and ra.fob_point=al.lookup_code+,and rt.term_id+,-=ra.term_id and ra.;F:93>4*_I!"H_!;;3F"9_?#=ab.I!"H_!;;3F"9_?#+,and ab.bank_branch_id=abb.bank_branch_id+,- --and rct.cust_tr)_type_id=ra.cust_tr)_type_id and ra.tr)_number=' ''. /1'' and ral.line_type='C?"4 Euery to find the ;ustomer , :hip 9o and Iill 9o location ?nformation select distinct h.order_number ,hp.party_name N;ustomer "ameN ,ol.meaning N@reight 9ermsN ,ol .meaning N@3IN ,bill_loc.address MM','MMbill_loc.city NIill 9oN ,ship_loc.address MM','MMship_loc.city N:hip 9oN from oe_order_headers_all h ,h$_parties hp ,oe_lookups ol ,oe_lookups ol ,h$_cust_accounts hca ,h$_cust_acct_sites_all hcasa ,h$_cust_site_uses_all h$sua ,h$_party_sites hps ,h$_locations bill_loc ,h$_locations ship_loc where hp.party_id=hca.party_id and hca.;F:9_!;;3F"9_?#=h.sold_to_org_id and h.freight_terms_code = ol.lookup_code+,and ol .lookup_code+,-=h.fob_point_code and ol .lookup_type+,-='@3I' and ol.lookup_type+,- = '@*4?<D9_94*>:' and hcasa.cust_acct_site_id= h$sua.cust_acct_site_id and hcasa.cust_account_id=hca.cust_account_id and hcasa.party_site_id= hps.party_site_id and hps.location_id=bill_loc.location_id and hps.location_id=ship_loc.location_id and h.ship_to_org_id=hcasa.org_id and h.order_number and h.org_id=.'/8

Validation for Duplicate Pay Method SELECT FROM COUNT(*) ra_customers rc,

ra_addresses ra, ra_cust_receipt_methods rcrm, ar_receipt_methods arm W ERE rcrm!customer_id " rc!customer_id #N$ rcrm!receipt_method_id " arm!receipt_method_id #N$ c!customer_id " ra!customer_id #N$ c!ori%_s&stem_re'ere(ce" TR)M(p_customer_re') #N$ a!ori%_s&stem_re'ere(ce" TR)M(N*L(p_address_re',ra!ori%_s&stem_re'ere(ce)) #N$ rm!(ame " TR)M(p_pa&_method)+

Validation to check whether the given bank already exists SELECT COUNT(*) FROM (SELECT a,a!,a(-_accou(t_(ame, a,a!,a(-_accou(t_(um, a,a!curre(c&_code, a,,!,a(-_(ame, a,,!,a(-_,ra(ch_(ame, a,,!,a(-_(um, ..a,,!,a(-_(um,er a,,!cou(tr& FROM ap_,a(-_accou(ts a,a, ap_,a(-_,ra(ches a,, W ERE a,,!,a(-_,ra(ch_id " a,a!,a(-_,ra(ch_id ) /#N0 W ERE ,a(-_accou(t_(um " N*L(cur_cust_,(-!,a(-_accou(t_(um,,a(-_accou(t_(um) #N$ ,a(-_accou(t_(ame " N*L(cur_cust_,(-!,a(-_accou(t_(ame,,a(-_accou(t_(ame) #N$ ,a(-_(ame " N*L(cur_cust_,(-!,a(-_(ame,,a(-_(ame) #N$ ,a(-_(um " N*L(cur_cust_,(-!,a(-_(um,,a(-_(um) ..#N$ N*L(,a(-_(um,er,1)" N*L(N*L(cur_cust_,(-!,a(-_(um,er,,a(-_(um,er),1) #N$ ,a(-_,ra(ch_(ame " N*L(cur_cust_,(-!,a(-_,ra(ch_(ame,,a(-_,ra(ch_(ame) #N$ curre(c&_code " N*L(cur_cust_,(-!,a(-_accou(t_curre(c&_code,curre(c&_code) #N$ cou(tr& " N*L(cur_cust_,(-!,a(-_,ra(ch_cou(tr&,cou(tr&)+

Query to Link between Order Management and Account Receivables


SELECT ooha.order_number , oola.line_number so_line_number , oola.ordered_item , 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 !"# oe_order_headers_all ooha , oe_order_lines_all oola , ra_customer_trx_all rcta , ra_customer_trx_lines_all rctla $%E!E ooha.header_id & oola.header_id '() rcta.customer_trx_id & rctla.customer_trx_id '() rctla.inter*ace_line_attribute+ & T"_C%'! ,oola.line_id'() rctla.inter*ace_line_attribute. & T"_C%'! ,ooha.order_number'() order_number & /p_order_number

Query to get Customer Related information for a Sales Order


The query 0ill list S%12 T" and 31LL T" 'ddress *or a customer. SELECT ooh.order_number , hp_bill.party_name , hl_ship.address. 44)ecode,hl_ship.address5,(6LL,77,chr,.8-44hl_ship.address544)ecode,hl_ship.address9,(6LL,77,chr,.8-44hl_ship.address944)ecode,hl_ship.address:,(6LL,77,chr,.8-44hl_ship.address:44)ecode,hl_ship.city,(6LL,77,chr,.8-44hl_ship.city 44)ecode,hl_ship.state,(6LL,77,7,744hl_ship.state 44)ecode,hl_ship.postal_code,77,7,744hl_ship.postal_code ship_to_address , hl_bill.address. 44)ecode,hl_bill.address5,(6LL,77,chr,.8-44hl_bill.address544)ecode,hl_bill.address9,(6LL,77,chr,.8-44hl_bill.address944)ecode,hl_bill.address:,(6LL,77,chr,.8-44hl_bill.address:44)ecode,hl_bill.city,(6LL,77,chr,.8-44hl_bill.city 44)ecode,hl_bill.state,(6LL,77,7,744hl_bill.state 44)ecode,hl_bill.postal_code,77,7,744hl_bill.postal_code bill_to_address , ooh.transactional_curr_code currency_code , mp.organi;ation_code , ooh.*ob_point_code , ooh.*reight_terms_code , ooh.cust_po_number !"# oe_order_headers_all ooh , h;_cust_site_uses_all hcs_ship , h;_cust_acct_sites_all hca_ship , h;_party_sites hps_ship , h;_parties hp_ship

, h;_locations hl_ship , h;_cust_site_uses_all hcs_bill , h;_cust_acct_sites_all hca_bill , h;_party_sites hps_bill , h;_parties hp_bill , h;_locations hl_bill , mtl_parameters mp $%E!E . & . '() header_id & /p_header_id '() ooh.ship_to_org_id & hcs_ship.site_use_id '() hcs_ship.cust_acct_site_id & hca_ship.cust_acct_site_id '() hca_ship.party_site_id & hps_ship.party_site_id '() hps_ship.party_id & hp_ship.party_id '() hps_ship.location_id & hl_ship.location_id '() ooh.invoice_to_org_id & hcs_bill.site_use_id '() hcs_bill.cust_acct_site_id & hca_bill.cust_acct_site_id '() hca_bill.party_site_id & hps_bill.party_site_id '() hps_bill.party_id & hp_bill.party_id '() hps_bill.location_id & hl_bill.location_id '() mp.organi;ation_id,<- & ooh.ship_*rom_org_id

Query to get Customer Name, Number and Address


The query 0ill list 2arty (ame, (umber, Customer (umber and there 3ill To and Ship 'ddresses. SELECT hp.party_name , hp.party_number , hca.account_number , hca.cust_account_id , hp.party_id , hps.party_site_id , hps.location_id , hl.address. , hl.address5 , hl.address9 , hl.city , hl.state , hl.country , hl.postal_code , hcsu.site_use_code , hcsu.site_use_id , hcsa.bill_to_*lag !"# h;_parties hp , h;_party_sites hps , h;_locations hl , h;_cust_accounts_all hca , h;_cust_acct_sites_all hcsa , h;_cust_site_uses_all hcsu $%E!E hp.party_id & hps.party_id '() hps.location_id & hl.location_id '() hp.party_id & hca.party_id

'() '() '() '()

hcsa.party_site_id & hps.party_site_id hcsu.cust_acct_site_id & hcsa.cust_acct_site_id hca.cust_account_id & hcsa.cust_account_id hca.account_number & /customer_number

Customer Queries Customer Accounts that have Non Primary Phone Contact Points only
SELECT /*+ use_nl ( phone ca) */ account_number FROM hz_cust_accounts ca (SELECT o!ner_table_"# FROM ( SELECT o!ner_table_"# S$M(%ECO%E(pr"mar&_'la( )*) + ,)) pr"mar&_count S$M(%ECO%E(pr"mar&_'la( )*) , +)) non_pr"mar&_count FROM hz_contact_po"nts -.ERE status / )0) 01% contact_po"nt_t&pe/ )2.O1E) 3RO$2 4* o!ner_table_"# ) -.ERE pr"mar&_count / , 01% non_pr"mar&_count 5 , ) phone -.ERE ca6part&_"# / phone

SELECT account_number FROM hz_cust_accounts hca -.ERE 1OT E78STS ( SELECT + FROM hz_contact_po"nts hcp -.ERE contact_po"nt_t&pe / )2.O1E) 01% o!ner_table_name / ).9_20RT8ES) 01% o!ner_table_"# / hca6part&_"# 01% pr"mar&_'la( / )*) ) 01% E78STS ( SELECT + FROM hz_contact_po"nts hcp -.ERE contact_po"nt_t&pe / )2.O1E) 01% o!ner_table_name / ).9_20RT8ES) 01% o!ner_table_"# / hca6part&_"#

01% 1:L(pr"mar&_'la( )1)) / )1) ) L"st o' Customer 0ccounts that ha;e < or more 8#ent"'&"n( 0##resses SELECT /*+ use_nl(ps ca) */ ca6account_number cnt ca6creat"on_#ate ca6last_up#ate_#ate FROM ( SELECT ps6part&_"# CO$1T(ps6part&_"#) cnt FROM hz_part&_s"tes ps -.ERE "#ent"'&"n(_a##ress_'la( / )*) 3RO$2 4* ps6part&_"# .0:813 CO$1T(ps6part&_"#) 5 + ) ps hz_cust_accounts ca -.ERE ps6part&_"# / ca6part&_"# 2art"es that ha;e onl& non pr"mar& Contact 2o"nts

SELECT o!ner_table_"# FROM ( SELECT o!ner_table_"# S$M(%ECO%E(pr"mar&_'la( )*) + ,)) pr"mar&_count S$M(%ECO%E(pr"mar&_'la( )*) , +)) non_pr"mar&_count FROM hz_contact_po"nts -.ERE status / )0) 01% contact_po"nt_t&pe/ )2.O1E) 3RO$2 4* o!ner_table_"# ) -.ERE pr"mar&_count / , 01% non_pr"mar&_count 5 ,

List of Phones used by more than one accounts SELECT hcp_out6phone_area_co#e hcp_out6phone_number hca_out6account_number

part&_name FROM hz_contact_po"nts hcp_out hz_cust_accounts hca_out hz_part"es part& ( SELECT hcp6phone_area_co#e hcp6phone_number == CO$1T(%8ST81CT hca6account_number) FROM hz_contact_po"nts hcp hz_cust_accounts hca (SELECT hcp_"n6phone_area_co#e hcp_"n6phone_number FROM hz_contact_po"nts hcp_"n -.ERE hcp_"n6creat"on_#ate 5/ TO_%0TE()+=M0R=<,,>) )%%=MO1= ****)) 01% hcp_"n6creat"on_#ate ****)) 01% hcp_"n6o!ner_table_name / ).9_20RT8ES) 01% hcp_"n6contact_po"nt_t&pe / )2.O1E) ) ne!_phone -.ERE hcp6phone_area_co#e / ne!_phone6phone_area_co#e 01% hcp6phone_number / ne!_phone6phone_number 01% hca6part&_"# / hcp6o!ner_table_"# 3RO$2 4* hcp6phone_area_co#e hcp6phone_number .0:813 CO$1T(%8ST81CT hca6account_number) 5 + ) #up_phone -.ERE hcp_out6phone_area_co#e / #up_phone6phone_area_co#e 01% hcp_out6phone_number / #up_phone6phone_number 01% hca_out6part&_"# / hcp_out6o!ner_table_"# 01% part&6part&_"# / hca_out6part&_"# OR%ER 4* hcp_out6phone_area_co#e hcp_out6phone_number hca_out6account_number Customer)s 0##resses an# the"r usa(e ? TO_%0TE()+=02R=<,,>) )%%=MO1=

SELECT acct6account_number acct6status 0ccount_Status acct6account_establ"she#_#ate acct6account_term"nat"on_#ate acct6account_act";at"on_#ate part&6part&_name part&6status 2art&_Status as"te6status account_s"te_status as"te6b"ll_to_'la( as"te6sh"p_to_'la( as"te6customer_cate(or&_co#e ps"te6part&_s"te_name ps"te6status 2art&_S"te_Status ps"te6start_#ate_act";e ps"te6en#_#ate_act";e loc6a##ress+ @@ ) ) @@ loc6a##ress< a##ress loc6c"t& loc6state loc6postal_co#e s"teu6s"te_use_"# s"teu6status S"te_usa(e_status s"teu6s"te_use_co#e s"teu6pr"mar&_'la( s"teu6status s"te_uses_status FROM apps6hz_cust_accounts acct apps6hz_cust_acct_s"tes_all as"te apps6hz_part&_s"tes ps"te apps6hz_locat"ons loc apps6hz_cust_s"te_uses_all s"teu apps6hz_part"es part& -.ERE acct6account_number / Aaccount_number /* "n s"n(le Buotes */ 01% as"te6cust_account_"# / acct6cust_account_"# 01% as"te6part&_s"te_"# / ps"te6part&_s"te_"# 01% ps"te6locat"on_"# / loc6locat"on_"#

01% s"teu6cust_acct_s"te_"# 01% acct6part&_"# L"st o' %upl"cate 0##resses

/ as"te6cust_acct_s"te_"#

/ part&6part&_"#

Th"s Buer& !"ll '"n# out a##resses that use# b& at least +, #"''erent part"es6 SELECT acct6account_number part&6part&_name locat"ons6a##ress+ locat"ons6a##ress< locat"ons6c"t& locat"ons6state locat"ons6postal_co#e FROM hz_part&_s"tes ps"teo hz_cust_accounts acct hz_part"es part& (SELECT /*+ "n#eC ( loc .9_LOC0T8O1S_1+ ) */ locat"on_"# loc6a##ress+ loc6a##ress< loc6c"t& loc6state loc6postal_co#e part"es FROM hz_locat"ons loc (SELECT loc6a##ress+ loc6a##ress< loc6c"t& loc6state CO$1T(%8ST81CT ps"te6part&_"#) part"es FROM hz_locat"ons loc hz_part&_s"tes ps"te -.ERE ps"te6locat"on_"# / loc6locat"on_"# 3RO$2 4* loc6a##ress+ loc6a##ress<

loc6c"t& loc6state .0:813 count(*) 5 +, ) a##r -.ERE loc6a##ress+ / a##r6a##ress+ 01% loc6a##ress< / a##r6a##ress< 01% loc6c"t& / a##r6c"t& 01% loc6state / a##r6state ) locat"ons -.ERE ps"teo6locat"on_"# / locat"ons6locat"on_"# 01% ps"teo6part&_"# / part&6part&_"# 01% acct6part&_"# / part&6part&_"# or#er b& locat"ons6postal_co#e locat"ons6state locat"ons6c"t& locat"ons6a##ress+ part&6part&_name acct6account_number

Customer Emails Address


SELECT account_number )2art& Le;eL Commun"cat"on) Commun"cat"on_Le;eL phne6contact_po"nt_purpose phne6contact_po"nt_t&pe #eco#e(phne6contact_po"nt_t&pe )2.O1E) )()@@phne6phone_area_co#e @@)) ) @@phne6phone_number )EM08L) phne6ema"l_a##ress )-E4) phne6url ) comm_#eta"l phne6pr"mar&_'la( null a##ress FROM hz_contact_po"nts phne hz_cust_accounts acct -.ERE acct6part&_"# / phne6o!ner_table_"# 01% phne6o!ner_table_name / ).9_20RT8ES) 01% acct6account_number / )+,,,)

$18O1 SELECT account_number )2art& S"te Le;eL Commun"cat"on) phne6contact_po"nt_purpose phne6contact_po"nt_t&pe #eco#e(phne6contact_po"nt_t&pe )2.O1E) )()@@phne6phone_area_co#e @@)) ) @@phne6phone_number )EM08L) phne6ema"l_a##ress )-E4) phne6url ) comm_#eta"l phne6pr"mar&_'la( loc6a##ress+ @@ ) ) @@loc6a##ress< @@ ) ) @@loc6c"t& @@ ) ) @@loc6state @@ ) ) @@loc6postal_co#e a##ress FROM hz_contact_po"nts phne hz_cust_acct_s"tes_all s"te hz_cust_accounts acct hz_part&_s"tes ps"te hz_locat"ons loc -.ERE s"te6cust_acct_s"te_"# / phne6o!ner_table_"# 01% phne6o!ner_table_name / ).9_20RT*_S8TES) 01% s"te6cust_account_"# / acct6cust_account_"# 01% s"te6part&_s"te_"# / ps"te6part&_s"te_"# 01% ps"te6locat"on_"# / loc6locat"on_"# 01% acct6account_number / )+,,,)

OM Tables nd Details
Order Ma(a%eme(t Ta,2es

E(tered

oe_order_headers_a22 1 record created i( header ta,2e oe_order_2i(es_a22 Li(es 'or particu2ar records oe_price_ad3ustme(ts Whe( discou(t %ets app2ied oe_order_price_attri,s )' 2i(e has price attri,utes the( popu2ated oe_order_ho2ds_a22 )' a(& ho2d app2ied 'or order 2i-e credit chec- etc! /oo-ed oe_order_headers_a22 /oo-ed_'2a%"4 Order ,oo-ed! 5sh_de2i6er&_detai2s Re2eased_status Read& to re2ease 7ic- Re2eased 5sh_de2i6er&_detai2s Re2eased_status"4 Re2eased to Warehouse (Li(e has ,ee( re2eased to )(6e(tor& 'or processi(%) 5sh_pic-i(%_,atches #'ter ,atch is created 'or pic- re2ease! mt2_reser6atio(s This is o(2& so't reser6atio(s! No ph&sica2 mo6eme(t o' stocFu22 Tra(sactio( mt2_materia2_tra(sactio(s No records i( mt2_materia2_tra(sactio(s mt2_t8(_re9uest_headers mt2_t8(_re9uest_2i(es 5sh_de2i6er&_detai2s Re2eased to 5arehouse! 5sh_(e5_de2i6eries i' #uto.Create is 4es the( data popu2ated! 5sh_de2i6er&_assi%(me(ts de2i6eries %et assi%(ed 7ic- Co('irmed 5sh_de2i6er&_detai2s Re2eased_status"4 ard Reser6atio(s! 7ic-ed the stoc-! 7h&sica2 mo6eme(t o' stocShip Co('irmed 5sh_de2i6er&_detai2s Re2eased_status"C 4 To C:Shipped +$e2i6er& Note %et pri(ted $e2i6er& assi%(ed to trip stop9ua(tit& 5i22 ,e decreased 'rom sta%ed

mt2_materia2_tra(sactio(s O( the ship co('irm 'orm, chec- Ship a22 ,o8 5sh_(e5_de2i6eries )' $e'er )(ter'ace is chec-ed )!e its de'erred the( OM ; i(6e(tor& (ot updated! )' $e'er )(ter'ace is (ot chec-ed!: Shipped oe_order_2i(es_a22 Shipped_9ua(tit& %et popu2ated! 5sh_de2i6er&_2e%s 1 2e% is ca22ed as 1 trip!1 7ic-up ; drop up stop 'or each trip! oe_order_headers_a22 )' a22 the 2i(es %et shipped the( o(2& '2a% N #utoi(6oice 5sh_de2i6er&_detai2s Re2eased_status") Need to ru( 5or-'2o5 ,ac-%rou(d process! ra_i(ter'ace_2i(es_a22 $ata 5i22 ,e popu2ated a'ter 5-'5 process! ra_customer_tr8_a22 #'ter ru((i(% #utoi(6oice Master 7ro%ram 'or ra_customer_tr8_2i(es_a22 speci'ic ,atch tra(sactio( ta,2es %et popu2ated 7rice $etai2s 9p_2ist_headers_, To <et )tem 7rice $etai2s! 9p_2ist_2i(es )tems O( a(d =t& mt2_o(ha(d_9ua(tities TO chec- O( a(d =t& )tems! 7a&me(t Terms ra_terms 7a&me(t terms #utoMatic Num,eri(% S&stem ar_s&stem_parametes_a22 &ou ca( ch- #utomactic Num,eri(% is e(a,2ed>disa,2ed! Customer )('ormatio( h?_parties <et Customer i('ormatio( i(c2ude (ame,co(tacts,#ddress a(d 7ho(e h?_part&_sites h?_2ocatio(s h?_cust_accou(ts h?_cust_accou(t_sites_a22

h?_cust_site_uses_a22 ra_customers $ocume(t Se9ue(ce '(d_docume(t_se9ue(ces $ocume(t Se9ue(ce Num,ers '(d_doc_se9ue(ce_cate%ories '(d_doc_se9ue(ce_assi%(me(ts $e'au2t ru2es 'or 7rice List oe_de'_attr_de'_ru2es 7rice List $e'au2t Ru2es oe_de'_attr_co(d(s a-_o,3ect_attri,utes E(d User $etai2s csi_t_part&_detai2s To capture E(d user $etai2s Sa2es Credit Sa2es Credit )('ormatio(( o5 much credit ca( %et) oe_sa2es_credits #ttachi(% $ocume(ts '(d_attached_docume(ts #ttched $ocume(ts a(d Te8t i('ormatio( '(d_docume(ts_t2 '(d_docume(ts_short_te8t /2a(-et Sa2es Order oe_,2a(-et_headers_a22 /2a(-et Sa2es Order )('ormatio(! oe_,2a(-et_2i(es_a22 7rocessi(% Co(strai(ts oe_pc_assi%(me(ts Sa2es order Shipme(t schedu2e 7rocessi(% Co(strati(s oe_pc_e8c2usio(s Sa2es Order o2ds oe_ho2d_de'i(itio(s Order o2d a(d Ma(a%i(% $etai2s! oe_ho2d_authori?atio(s oe_ho2d_sources_a22

oe_order_ho2ds_a22 o2d Re2aese oe_ho2d_re2eases_a22 Credit Ch- $etai2s oe_credit_chec-_ru2es To %et the Credit Chec- #%ai(t Customer! Ca(ce2 Orders oe_order_2i(es_a22 Ca(ce2 Order $etai2s! o2d re2eased Sa2es Order!

OM !te" Details
CUSTOMER @ OR$ER $ET#)LS @ )TEM $ET#)LS SELECT $)ST)NCT RC!CUSTOMER_N#ME, RC!CUSTOMER_NUM/ER, RC!CUSTOMER_)$, OE !OR$ER_NUM/ER, OE !OR<_)$, OE !OR$ER_SOURCE_)$, OE !OR)<_S4S_$OCUMENT_REF, OE !OR$ERE$_$#TE, OE !7R)CE_L)ST_)$, OE !SOL$_FROM_OR<_)$, OE !SOL$_TO_OR<_)$, OE !)N*O)CE_TO_OR<_)$, OE !FLOW_ST#TUS_CO$E, OE !/OO0E$_$#TE, OEL!OR$ERE$_=U#NT)T4, OEL!S )77E$_=U#NT)T4, OEL!S )77E$_=U#NT)T4, OEL!)N*ENTOR4_)TEM_)$, OEL!7R)CE_L)ST_)$, OEL!UN)T_SELL)N<_7R)CE, S!7#RT4_N#ME, S!7#RT4_T47E, MS)!SE<MENT1 ..OTT!TR#NS#CT)ON_T47E_CO$E,OTT!N#ME TRN#ME FROM OE_OR$ER_ E#$ERS_#LL OE , OE_OR$ER_L)NES_#LL OEL, R#_CUSTOMERS RC, A_7#RT)ES S, MTL_S4STEM_)TEMS_/ MS), OE_TR#NS#CT)ON_T47ES OTT W ERE OE ! E#$ER_)$ " OEL! E#$ER_)$ #N$ OE !SOL$_TO_OR<_)$ " RC!CUSTOMER_)$ #N$ RC!7#RT4_)$ " S!7#RT4_)$ #N$ MS)!)N*ENTOR4_)TEM_)$ " OEL!)N*ENTOR4_)TEM_)$

..#N$ OE !OR$ER_T47E_)$ " OTT!TR#NS#CT)ON_T47E_)$ #N$ OE !OR$ER_NUM/ER " B1CDEFB

OM Pricelists
CUSTOMER @ OR$ERS @ )TEMS . TERMS . 7R)CEL)STS

SELECT $)ST)NCT RC!CUSTOMER_N#ME, RC!CUSTOMER_NUM/ER, RC!CUSTOMER_)$, OE !OR$ER_NUM/ER, OE !OR<_)$, OE !OR$ER_SOURCE_)$, OE !OR)<_S4S_$OCUMENT_REF, OE !OR$ERE$_$#TE, OE !7R)CE_L)ST_)$, OE !SOL$_FROM_OR<_)$, OE !SOL$_TO_OR<_)$, OE !)N*O)CE_TO_OR<_)$, OE !FLOW_ST#TUS_CO$E, OE !/OO0E$_$#TE, OEL!OR$ERE$_=U#NT)T4, OEL!S )77E$_=U#NT)T4, OEL!S )77E$_=U#NT)T4, OEL!)N*ENTOR4_)TEM_)$, OEL!7R)CE_L)ST_)$, OEL!UN)T_SELL)N<_7R)CE, S!7#RT4_N#ME, S!7#RT4_T47E,

MS)!SE<MENT1, OE7L!N#ME L)STN#ME, RT!N#ME TERMN#ME, RT!$ESCR)7T)ON FROM OE_OR$ER_ E#$ERS_#LL OE , OE_OR$ER_L)NES_#LL OEL, R#_CUSTOMERS RC, A_7#RT)ES S, MTL_S4STEM_)TEMS_/ MS),

OE_7R)CE_L)STS OE7L, R#_TERMS RT W ERE OE ! E#$ER_)$ " OEL! E#$ER_)$

#N$ OE !SOL$_TO_OR<_)$ " RC!CUSTOMER_)$ #N$ RC!7#RT4_)$ " S!7#RT4_)$ #N$ MS)!)N*ENTOR4_)TEM_)$ " OEL!)N*ENTOR4_)TEM_)$ #N$ OE !OR$ER_NUM/ER " B1CDEFB #N$ OEL!7R)CE_L)ST_)$ " OE7L!7R)CE_L)ST_)$ #N$ OE !7#4MENT_TERM_)$ "RT!TERM_)$

OM Open #acklog Orders


SELECT #! E#$ER_)$, #!OR<_)$, #!OR$ER_NUM/ER, #!OR$ER_T47E_)$, #!OR$ER_C#TE<OR4_CO$E, #!FLOW_ST#TUS_CO$E, #!S )7_FROM_OR<_)$, $!)N*ENTOR4_)TEM_)$, /!L)NE_NUM/ER, /!SC E$ULE_S )7_$#TE, C!N#ME, /!OR$ERE$_=U#NT)T4, /!C#NCELLE$_=U#NT)T4, /!S )77E$_=U#NT)T4, /!SC E$ULE_S )7_$#TE

FROM OE_OR$ER_ E#$ERS_#LL #, OE_OR$ER_L)NES_#LL /, R_#LL_OR<#N)A#T)ON_UN)TS C, MTL_S4STEM_)TEMS_/ $ W ERE #N$ #N$ #! E#$ER_)$ " /! E#$ER_)$ #!FLOW_ST#TUS_CO$E NOT L)0E BCLOSE$B #!S )7_FROM_OR<_)$(G) " C!OR<#N)A#T)ON_)$

#N$ #N$ #N$

#! )N*ENTOR4_)TEM_)$ " $! )N*ENTOR4_)TEM_)$ #!OR<_)$":7_OR<_)$ /!SC E$ULE_S )7_$#TEHS4S$#TE

<ROU7 /4 #! E#$ER_)$, #!OR<_)$, #!OR$ER_NUM/ER, #!OR$ER_T47E_)$, #!OR$ER_C#TE<OR4_CO$E, #!FLOW_ST#TUS_CO$E, #!S )7_FROM_OR<_)$, /!)N*ENTOR4_)TEM_)$, /!L)NE_NUM/ER, /!SC E$ULE_S )7_$#TE, C!N#ME, /!OR$ERE$_=U#NT)T4, /!C#NCELLE$_=U#NT)T4, /!S )77E$_=U#NT)T4, /!SC E$ULE_S )7_$#TE OR$ER /4 /!L)NE_NUM/ER

OM $%&O O' ( 'D )ty


SELECT DISTINCT m.segment1 as item , h.order_number , h.flow_status_code , l.ordered_quantity FROM oe_order_headers_all h , oe_order_lines_all l , mtl_system_items_b m WHERE l.HEADER_ID=h.header_id AND l.INVENTORY_ITEM_ID=m.INVENTORY_ITEM_ID AND l.inventory_item_id NOT IN (SELECT inventory_item_id FROM mtl_onhand_quantities) AND h.flow_status_code NOT IN ('CLOSED', 'CANCELLED')

OM #ackloc &epoer For ll Operating *nits


SELECT a.order_number "so_Num" , a.ordered_date , a.transactional_curr_code "currency"

, a.order_category_code "order_type" , soldfrom(a.sold_from_org_id) "sold_from" , soldto(A.SOLD_TO_ORG_ID)"Customer" , shipfrom(a.ship_from_org_id) "shiipping_from" , organizations(b.org_id) "operating_unit" , b.ordered_item "item_name" , b.OPEN_FLAG "so_status_open" FROM OE_ORDER_HEADERS_all a, OE_ORDER_LINES_all b WHERE a.header_id=b.header_id AND a.OPEN_FLAG='Y' AND b.open_flag='Y' AND A.SOLD_TO_ORG_ID=:SOLD_TO AND A.SHIP_FROM_ORG_ID=:SHIP_FROM

OM &elated )ueries
SELECT N*L(SUM(N*L(mo9!tra(sactio(_9ua(tit&,C) * (N*L(cic!item_cost,C) )),C) FROM mt2_o(ha(d_9ua(tities mo9, cst_item_costs cic, te_i(6_or%_operati(%_u(its_6 i(6_ou W ERE cic!i(6e(tor&_item_id " mo9!i(6e(tor&_item_id #N$ cic!cost_t&pe_id " :%_(um_cost_t&pe_id #N$ cic!or%a(i?atio(_id " mo9!or%a(i?atio(_id #N$ mo9!i(6e(tor&_item_id " :i(_(um_i(6e(tor&_item_id #N$ i(6_ou!or%_id " N*L(:i(_(um_operati(%_u(it, i(6_ou!or%_id) #N$ i(6_ou!or%a(i?atio(_id " mo9!or%a(i?atio(_id

SELECT u(i9ue rct!tr8_(um,er, rct!tr8_date, rctt!t&pe FROM oe_order_headers_a22 oha, ra_customer_tr8_2i(es_a22 rct2, ra_customer_tr8_a22 rct, ra_cust_tr8_t&pes_a22 rctt W ERE rct2!i(ter'ace_2i(e_co(te8t " BOR$ER ENTR4B #N$ rct2!i(ter'ace_2i(e_attri,ute1 " oha!order_(um,er #N$ rct2!customer_tr8_id " rct!customer_tr8_id #N$ rctt!cust_tr8_t&pe_id " rct!cust_tr8_t&pe_id #N$ oha!header_id " :i(_(um_header_id

#N$ rct!tr8_date " ( SELECT M#I(TRI_$#TE) FROM ra_customer_tr8_2i(es_a22 rct2a, ra_customer_tr8_a22 rcta W ERE rct2a!i(ter'ace_2i(e_co(te8t " BOR$ER ENTR4B #N$ rct2a!i(ter'ace_2i(e_attri,ute1 " oha!order_(um,er #N$ rcta!customer_tr8_id " rct2a!customer_tr8_id ) #N$ rct!tr8_(um,er " ( SELECT M#I(TRI_(um,er) FROM ra_customer_tr8_2i(es_a22 rct2a, ra_customer_tr8_a22 rcta W ERE rct2a!i(ter'ace_2i(e_co(te8t " BOR$ER ENTR4B #N$ rct2a!i(ter'ace_2i(e_attri,ute1 " oha!order_(um,er #N$ rcta!customer_tr8_id " rct2a!customer_tr8_id ) The same 'u(ctio(a2it& ca( ,e pro6ided ,& re 5riti(% the S=L as 'o22o5s, i( the process the cost %ets reduced to a2most ha2' o' the 'irst 9uer&! SELECT ma8(rct!tr8_(um,er), ma8(rct!tr8_date), ma8(rctt!t&pe) FROM oe_order_headers_a22 oha, ra_customer_tr8_a22 rct, ra_cust_tr8_t&pes_a22 rctt W ERE rct!i(ter'ace_header_co(te8t " BOR$ER ENTR4B #N$ rct!i(ter'ace_header_attri,ute1 " oha!order_(um,er #N$ rctt!cust_tr8_t&pe_id " rct!cust_tr8_t&pe_id #N$ oha!header_id " :i(_(um_header_id

SELECT haou!or%a(i?atio(_id, haou!(ame, hca!cust_accou(t_id, hp!part&_(ame, hca!accou(t_(um,er, hp!cate%or&_code, hca!sa2es_cha((e2_code, hca!attri,ute1, SU/STR (hca!attri,uteJ, K, D), hp!cou(tr&, haou!attri,ute1, M#I (o2a!actua2_shipme(t_date) shp_dte, FROM h?_cust_accou(ts hca, h?_parties hp, oe_order_headers_a22 oha, oe_order_2i(es_a22 o2a, hr_a22_or%a(i?atio(_u(its haou, ra_customers rac, ra_addresses_a22 raa W ERE hp!part&_id " hca!part&_id(G) #N$ oha!header_id(G) " o2a!header_id #N$ o2a!so2d_to_or%_id(G) " hca!cust_accou(t_id #N$ haou!T47E(G) " BOUB #N$ raa!part&_id " hp!part&_id #N$ rac!part&_id " raa!part&_id #N$ hca!status " B#B #N$ raa!or%_id " haou!or%a(i?atio(_id #N$ EI)STS ( SELECT 1 FROM R#_CUSTOMER_TRI_#LL RCT# W ERE C#!cust_accou(t_id " RCT#!,i22_to_customer_id #N$ RCT#!OR<_)$ " haou!or%a(i?atio(_id ) <ROU7 /4 haou!(ame, haou!or%a(i?atio(_id, hca!cust_accou(t_id, hp!part&_(ame,

hca!accou(t_(um,er, hca!sa2es_cha((e2_code, hca!attri,uteJ, hp!cou(tr&, hca!attri,ute1, hp!cate%or&_code, haou!attri,ute1 OR$ER /4 shp_dte desc SELECT .(SUM(ordered_9ua(tit&*u(it_se22i(%_price)), .(SUM(shipped_9ua(tit&*u(it_se22i(%_price)) )NTO out_(um_ordered_amt, out_(um_shipped_amt FROM oe_order_2i(es_a22 W ERE header_id " i(_(um_header_id #N$ ,oo-ed_'2a% " B4B <ROU7 /4 header_id+

SELECT N*L(SUM((oe2a!ordered_9ua(tit& @ N*L(oe2a!shipped_9ua(tit&,C) ) ),C) FROM oe_order_headers_a22 oeha, oe_order_2i(es_a22 oe2a W ERE oe2a!header_id " oeha!header_id #N$ oe2a!or%_id " N*L(:i(_(um_operati(%_u(it, oe2a!or%_id) #N$ oe2a!i(6e(tor&_item_id " N*L(:i(_(um_i(6e(tor&_item_id,oe2a!i(6e(tor&_item_id ) #N$ oe2a!ope(_'2a% " B4B #N$ oe2a!ca(ce22ed_'2a% " BNB #N$ oe2a!,oo-ed_'2a% " B4B #N$ oeha!header_id " 1JDL SELECT ..Gchoose oe2a!header_id E#$ER_)$, oe2a!2i(e_id L)NE_)$, oe2a!i(6e(tor&_item_id )N*ENTOR4_)TEM_)$,

oeha!order_(um,er OR$ER_NUM/ER, TRUNC(oeha!ordered_date) OR$ERE$_$#TE, $ECO$E(oe2a!optio(_(um,er,(u22,oe2a!2i(e_(um,er MM B!BMM oe2a!shipme(t_(um,er,oe2a!2i(e_(um,er MM B!BMM oe2a!shipme(t_(um,erMMB!B MM oe2a!optio(_(um,er) LO<)C#L_L)NE_NUM/ER, te_i(6e(tor&_i(9_p-%!%et_2i(e_status( oe2a!'2o5_status_code, oe2a!2i(e_id ) L)NE_FLOW_ST#TUS, SU/STR/(hp!part&_(ame, 1, KC) CUSTOMER_N#ME, oe2a!ordered_9ua(tit& OR$ERE$_=U#NT)T4, oe2a!shipped_9ua(tit& S )77E$_=U#NT)T4, oeha!so2d_to_or%_id SOL$_TO_OR<_)$, oeha!cust_po_(um,er CUST_7O_NUM/ER, oeha!re9uest_date RE=UESTE$_$#TE, oe2a!actua2_shipme(t_date #CTU#L_S )7MENT_$#TE, oe2a!schedu2e_ship_date SC E$ULE_S )7_$#TE, oe2a!ship_'rom_or%_id S )7_FROM_OR<_)$, mp!or%a(i?atio(_code OR<#N)A#T)ON_CO$E, oe2a!or%_id OR<_)$, decode (mp!attri,ute1,BL#<OSB, 5(d!attri,ute1, 5(d!(ame) $EL)*ER4_N#ME FROM mt2_parameters mp, oe_order_headers_a22 oeha, oe_order_2i(es_a22 oe2a, 5sh_de2i6er&_detai2s 5dd, 5sh_de2i6er&_assi%(me(ts 5da, h?_cust_accou(ts hca, h?_parties hp, 5sh_(e5_de2i6eries 5(d W ERE hp!part&_id " hca!part&_id #N$ oeha!so2d_to_or%_id " hca!cust_accou(t_id #N$ oe2a!ship_'rom_or%_id " mp!or%a(i?atio(_id #N$ oeha!header_id " oe2a!header_id #N$ oe2a!2i(e_id " 5dd!source_2i(e_id #N$ 5dd!de2i6er&_detai2_id " 5da!de2i6er&_detai2_id(G) #N$ 5da!de2i6er&_id " 5(d!de2i6er&_id(G) <ROU7 /4 oe2a!header_id, oe2a!2i(e_id,

oe2a!i(6e(tor&_item_id, oeha!order_(um,er, oeha!ordered_date, oe2a!2i(e_(um,er, oe2a!shipme(t_(um,er, oe2a!optio(_(um,er, oe2a!'2o5_status_code, hp!part&_(ame, oeha!so2d_to_or%_id , oeha!cust_po_(um,er, oe2a!ordered_9ua(tit&, oe2a!shipped_9ua(tit&, oeha!ordered_date, oeha!re9uest_date, oe2a!actua2_shipme(t_date, oe2a!schedu2e_ship_date, oe2a!ship_'rom_or%_id, mp!or%a(i?atio(_code, oe2a!or%_id, mp!attri,ute1, 5(d!attri,ute1, 5(d!(ame+ OM +ancelled Orders ,ith &easons
SELECT TO_C #R(oo2h!hist_creatio(_date,B4444.MM.$$B) , usr!descriptio( , oo2h!reaso(_code , cou(t(disti(ct oo2h!header_id) Orders FROM apps!oe_order_2i(es_histor& oo2h , apps!'(d_user usr W ERE oo2h!hist_creatio(_date N TRUNC(S4S$#TE) .EC #N$ oo2h!hist_t&pe_code " BC#NCELL#T)ONB #N$ oo2h!2ast_updated_,& " usr!user_id <ROU7 /4 TO_C #R(hist_creatio(_date,B4444.MM.$$B) , usr!descriptio( , reaso(_code OR$ER /4 1

OM (O-DS !nfor"ation
SELECT >*G use_(2 (ooh h2d ohs ohd ohr) *> ooh!order_(um,er OOrder Num,erO

, ooh!ordered_date , ooh!'2o5_status_code

OOrdered $ateO OOrder StatusO

, ooh!credit_card_appro6a2_code OCredit Card #ppro6a2 CodeO , ohd!(ame O o2d NameO , ohs!re2eased_'2a% O o2d Re2ease F2a%O , ohr!re2ease_reaso(_code O o2d Re2ease Reaso(O , ohr!creatio(_date O o2d Re2ease $ateO , ooh!pa&me(t_t&pe_code O7a&me(t T&pe CodeO FROM apps!oe_order_headers_a22 ooh , apps!oe_order_ho2ds_a22 h2d , apps!oe_ho2d_sources_a22 ohs , apps!oe_ho2d_de'i(itio(s ohd , apps!oe_ho2d_re2eases ohr W ERE ooh!ordered_date /ETWEEN TO_$#TE(B1C.sep.JCCP CL:LC:CCB, Bdd.mo(.&&&& hhJL:mi:ssB) #N$ TO_$#TE(B1C.sep.JCCP 1C:LC:CCB, Bdd.mo(.&&&& hhJL:mi:ssB) #N$ ooh!order_cate%or&_code " BOR$ERB .. .. #dd some other co(ditio(s to 'i2ter desired orders .. #N$ h2d!header_id (G) " ooh!header_id #N$ ohs!ho2d_source_id (G) " h2d!ho2d_source_id #N$ ohd!ho2d_id (G) " ohs!ho2d_id .. .. #dd ho2d (ame i' &our are 2oo-i(% 'or speci'ic ho2ds .. .. a(d de'!(ame " BTime Out 'or Credit Card #uthB #N$ ohr!ho2d_re2ease_id (G) " ohs!ho2d_re2ease_id OR$ER /4 ooh!order_(um,er

OM 'D & -ink )uery

SELECT ooha!order_(um,er , oo2a!2i(e_(um,er so_2i(e_(um,er , oo2a!ordered_item , oo2a!ordered_9ua(tit& * oo2a!u(it_se22i(%_price so_e8te(ded_price , rcta!tr8_(um,er i(6oice_(um,er , rcta!tr8_date , rct2a!2i(e_(um,er i(6_2i(e_(um,er , rct2a!u(it_se22i(%_price i(6_u(it_se22i(%_price FROM oe_order_headers_a22 ooha , oe_order_2i(es_a22 oo2a , ra_customer_tr8_a22 rcta , ra_customer_tr8_2i(es_a22 rct2a W ERE ooha!header_id " oo2a!header_id #N$ rcta!customer_tr8_id " rct2a!customer_tr8_id #N$ rct2a!i(ter'ace_2i(e_attri,uteF " TO_C #R (oo2a!2i(e_id) #N$ rct2a!i(ter'ace_2i(e_attri,ute1 " TO_C #R (ooha!order_(um,er) #N$ order_(um,er " :p_order_(um,er SELECT ooh!order_(um,er , hp_,i22!part&_(ame , h2_ship!address1 MM$ecode(h2_ship!addressJ,NULL,BB,chr(1C)) MMh2_ship!addressJMM$ecode(h2_ship!addressD,NULL,BB,chr(1C)) MMh2_ship!addressDMM$ecode(h2_ship!addressL,NULL,BB,chr(1C)) MMh2_ship!addressLMM$ecode(h2_ship!cit&,NULL,BB,chr(1C)) MMh2_ship!cit& MM$ecode(h2_ship!state,NULL,BB,B,B) MMh2_ship!state MM$ecode(h2_ship!posta2_code,BB,B,B) MMh2_ship!posta2_code ship_to_address , h2_,i22!address1 MM$ecode(h2_,i22!addressJ,NULL,BB,chr(1C)) MMh2_,i22!addressJMM$ecode(h2_,i22!addressD,NULL,BB,chr(1C)) MMh2_,i22!addressDMM$ecode(h2_,i22!addressL,NULL,BB,chr(1C)) MMh2_,i22!addressLMM$ecode(h2_,i22!cit&,NULL,BB,chr(1C)) MMh2_,i22!cit& MM$ecode(h2_,i22!state,NULL,BB,B,B) MMh2_,i22!state MM$ecode(h2_,i22!posta2_code,BB,B,B) MMh2_,i22!posta2_code ,i22_to_address , ooh!tra(sactio(a2_curr_code curre(c&_code , mp!or%a(i?atio(_code , ooh!'o,_poi(t_code , ooh!'rei%ht_terms_code , ooh!cust_po_(um,er FROM oe_order_headers_a22 ooh , h?_cust_site_uses_a22 hcs_ship , h?_cust_acct_sites_a22 hca_ship , h?_part&_sites hps_ship , h?_parties hp_ship , h?_2ocatio(s h2_ship , h?_cust_site_uses_a22 hcs_,i22 , h?_cust_acct_sites_a22 hca_,i22 , h?_part&_sites hps_,i22

, h?_parties hp_,i22 , h?_2ocatio(s h2_,i22 , mt2_parameters mp W ERE 1 " 1 #N$ header_id " :p_header_id #N$ ooh!ship_to_or%_id " hcs_ship!site_use_id #N$ hcs_ship!cust_acct_site_id " hca_ship!cust_acct_site_id #N$ hca_ship!part&_site_id " hps_ship!part&_site_id #N$ hps_ship!part&_id " hp_ship!part&_id #N$ hps_ship!2ocatio(_id " h2_ship!2ocatio(_id #N$ ooh!i(6oice_to_or%_id " hcs_,i22!site_use_id #N$ hcs_,i22!cust_acct_site_id " hca_,i22!cust_acct_site_id #N$ hca_,i22!part&_site_id " hps_,i22!part&_site_id #N$ hps_,i22!part&_id " hp_,i22!part&_id #N$ hps_,i22!2ocatio(_id " h2_,i22!2ocatio(_id #N$ mp!or%a(i?atio(_id(G) " ooh!ship_'rom_or%_id

MO SO Order ,ithout (O-DS


SELECT acct!accou(t_(um,er , order_(um,er , oo2!2i(e_(um,er , oo2!ordered_item , TRUNC(ordered_date) ordered_date , oo2!'2o5_status_code order_2i(e_status , 2oc!address1 /i22to_address1 , 2oc!addressJ /i22to_#ddressJ , 2oc!cit& ,i22to_cit& , 2oc!state ,i22to_state , 2oc!posta2_code ,i22to_posta2_code , 2oc1!address1 Shipto_address1 , 2oc1!addressJ Shipto_#ddressJ , 2oc1!cit& Shipto_cit& , 2oc1!state shipto_state , 2oc1!posta2_code shipto_posta2_code , u(it_se22i(%_price*ordered_9ua(tit& 2i(e_amou(t FROM apps!oe_order_headers_a22 ooh , apps!oe_order_2i(es_a22 oo2 , apps!h?_cust_accou(ts acct .. /i22 To #ddress , apps!h?_cust_acct_sites_a22 asite , apps!h?_part&_sites psite

, apps!h?_2ocatio(s 2oc , apps!h?_cust_site_uses_a22 siteu .. ship To #ddess , apps!h?_cust_acct_sites_a22 asite1 , apps!h?_part&_sites psite1 , apps!h?_2ocatio(s 2oc1 , apps!h?_cust_site_uses_a22 siteu1 W ERE ooh!ordered_date ,et5ee( s&sdate . 1C a(d s&sdate a(d ooh!header_id" oo2!header_id a(d order_cate%or&_code" BOR$ERB a(d ooh!'2o5_status_code HN BC#NCELLE$B a(d oo2!'2o5_status_code HN BC#NCELLE$B a(d acct!cust_accou(t_id " ooh!so2d_to_or%_id .. ,i22 To #ddress a(d ooh!i(6oice_to_or%_id " siteu!site_use_id a(d siteu!cust_acct_site_id " asite!cust_acct_site_id a(d asite!part&_site_id " psite!part&_site_id a(d psite!2ocatio(_id " 2oc!2ocatio(_id .. ship To #ddress a(d ooh!ship_to_or%_id " siteu1!site_use_id a(d siteu1!cust_acct_site_id " asite1!cust_acct_site_id a(d asite1!part&_site_id " psite1!part&_site_id a(d psite1!2ocatio(_id " 2oc1!2ocatio(_id #N$ NOT EI)STS ( SELECT B8B FROM apps!oe_order_ho2ds_a22 h2d , apps!oe_ho2d_sources_a22 src , apps!oe_ho2d_de'i(itio(s de' W ERE src!ho2d_source_id" h2d!ho2d_source_id a(d de'!ho2d_id" src!ho2d_id a(d h2d!header_id" ooh!header_id )

OM Freight +harge Details


SELECT oo2!ordered_item , opa!opera(d_per_p9t& , opa!ad3usted_amou(t , 92h!(ame , 922!2ist_2i(e_(o FROM oe_order_headers_a22 ooh , oe_order_2i(es_a22 oo2 , oe_price_ad3ustme(ts opa , 9p_2ist_headers_62 92h , 9p_2ist_2i(es 922 W ERE order_(um,er " 1CCCC #N$ oo2!header_id " ooh!header_id #N$ opa!2i(e_id " oo2!2i(e_id #N$ opa!2ist_2i(e_t&pe_code " BFRE)< T_C #R<EB #N$ 92h!2ist_header_id " opa!2ist_header_id #N$ 922!2ist_2i(e_id " opa!2ist_2i(e_id

OM Partially &eturned Orders


SELECT order_(um,er , ordered_date , ordLi(es , retur(Li(es FROM (SELECT >*G cardi(a2it& (oe 1) *> oe !order_(um,er , oeh!Ordered_date , cou(t(disti(ct oeL!2i(e_id) ordLi(es , cou(t(disti(ct oeLR!2i(e_id) retur(Li(es FROM apps!oe_order_headers_a22 oe , apps!oe_order_2i(es_a22 oeL , apps!oe_order_2i(es_a22 oeLR W ERE oe !ordered_date /ETWEEN S4S$#TE . KC #N$ S4S$#TE . LE!QK #N$ oe !header_id " oeL!header_id #N$ oeL!2i(e_id " oeLR!re'ere(ce_2i(e_id (G) <ROU7 /4 oe !order_(um,er , ordered_date #*)N< COUNT(*) N 1 )a W ERE ordLi(es N retur(Li(es #N$ retur(Li(es N C+

&

+usto"er )uery

SELECT hp!part&_(ame , hp!part&_(um,er , hca!accou(t_(um,er , hca!cust_accou(t_id , hp!part&_id , hps!part&_site_id , hps!2ocatio(_id , h2!address1 , h2!addressJ , h2!addressD , h2!cit& , h2!state , h2!cou(tr& , h2!posta2_code , hcsu!site_use_code , hcsu!site_use_id , hcsa!,i22_to_'2a% FROM h?_parties hp , h?_part&_sites hps , h?_2ocatio(s h2 , h?_cust_accou(ts_a22 hca , h?_cust_acct_sites_a22 hcsa , h?_cust_site_uses_a22 hcsu W ERE hp!part&_id " hps!part&_id #N$ hps!2ocatio(_id " h2!2ocatio(_id #N$ hp!part&_id " hca!part&_id #N$ hcsa!part&_site_id " hps!part&_site_id #N$ hcsu!cust_acct_site_id " hcsa!cust_acct_site_id #N$ hca!cust_accou(t_id " hcsa!cust_accou(t_id #N$ hca!accou(t_(um,er " :customer_(um,er

OM SO )uery
SELECT ooha!order_(um,er , oo2a!2i(e_(um,er so_2i(e_(um,er , oo2a!ordered_item , oo2a!ordered_9ua(tit& * oo2a!u(it_se22i(%_price so_e8te(ded_price , rcta!tr8_(um,er i(6oice_(um,er , rcta!tr8_date , rct2a!2i(e_(um,er i(6_2i(e_(um,er , rct2a!u(it_se22i(%_price i(6_u(it_se22i(%_price FROM oe_order_headers_a22 ooha , oe_order_2i(es_a22 oo2a , ra_customer_tr8_a22 rcta , ra_customer_tr8_2i(es_a22 rct2a W ERE ooha!header_id " oo2a!header_id #N$ rcta!customer_tr8_id " rct2a!customer_tr8_id

#N$ #N$ #N$

rct2a!i(ter'ace_2i(e_attri,uteF " TO_C #R (oo2a!2i(e_id) rct2a!i(ter'ace_2i(e_attri,ute1 " TO_C #R (ooha!order_(um,er) order_(um,er " :p_order_(um,er

& +usto"er +ontacts


CREATE OR REPLACE VIEW DISC_CUSTOMER_CONTACT_V (CUSTOMER_NAME, CUSTOMER_NUMBER, ADDRESS1, ADDRESS2, ADDRESS3, ADDRESS4, CITY, COUNTY, COUNTRY, STATE, POSTAL_CODE, CONCATENATED_ADDRESS, BILL_CONTACT, SHIP_CONTACT, PRIMARY_FLAG, PAYMENT_TERM_NAME, PHONE_NUMBER, PHONE_TYPE_MEANING, STATUS, COUNTRY_CODE) AS SELECT rac.customer_name, rac.customer_number, ara.address1, ara.address2, ara.address3, ara.address4, ara.city, ara.county, ara.country, ara.state, ara.postal_code, ara.concatenated_address, bil.contact_name bill_contact, shp.contact_name ship_contact, bil.primary_flag, shp.payment_term_name, phn.phone_number, phn.phone_type_meaning, DECODE (phn.status, 'A', 'Active', 'Inactive') status, phn.country_code FROM ra_customers rac, ar_addresses_v ara, hz_site_uses_v bil, hz_site_uses_v shp, ar_phones_v phn WHERE rac.customer_id = ara.customer_id (+) AND ara.address_id = bil.address_id (+) AND ara.address_id = shp.address_id (+) AND bil.site_use_code (+) = 'BILL_TO' AND shp.site_use_code (+)= 'SHIP_TO' AND ara.party_site_id = phn.owner_table_id(+) -and rac.customer_name like 'AEGON%';

---query to get cleared and reversed receipts

SELECT arm.NAME "Receipt_Method",

acr.receipt_date,

acr.receipt_number,

acr.amount,

acrha.gl_date,

acrha.status,

acr.reversal_comments

FROM ar_receipt_methods arm,

ar_cash_receipts_all acr,

ar_cash_receipt_history_all acrha

WHERE arm.receipt_method_id = acr.receipt_method_id

AND acr.cash_receipt_id = acrha.cash_receipt_id

AND arm.NAME LIKE '093%'

AND TRUNC (acr.receipt_date) BETWEEN '01-APR-2011' AND '31-MAR-2012'

AND EXISTS (

SELECT 1

FROM ar_cash_receipt_history_all a

WHERE a.cash_receipt_id = acr.cash_receipt_id

AND a.status IN ('CLEARED')

AND EXISTS (

SELECT 1

FROM ar_cash_receipt_history_all a

WHERE a.cash_receipt_id = acr.cash_receipt_id

AND a.status IN ('REVERSED')

AND NVL(a.current_record_flag,'N') = 'Y'

ORDER

BY 1,2,3,4,5

& Tables &elations

& -inks

Shipping +oncepts
!at is "ri# in Oracle A##s$

' trip is carrier speci*ic and represents a unique instance o* that carrier leaving your 0arehouse carrying deliveries. The carrier could be a public carrier such as 62S, )%L, edEx, or could be a company=s o0n *leet o* truc>s

' trip could represent a truc>, air cargo, ship cargo, or railcar. These entities 0ould be set up as 1tems in 1nventory 0ith an item type o* ?vehicle@.

Each trip has a minimum o* t0o stops, 2ic>A6p and )ropA"**. ' trip can be created automatically or manually *rom the Shipping Transaction *orm or can be automatically created *rom the Ship Con*irm *orm.

Companies that use public carriers let the system automatically create Trips as part o* the Ship Con*irm process. This eliminates unnecessary transactions.

!at is "ri# Sto#s in Oracle A##s$

' Stop is a point along the route that a trip ma>es to it=s *inal destination. The Ship Con*irm process initiates the ?2ic>A6p@ stop and putting the )elivery ?1nATransit@. #anually record all stops made by the Trip using the Shipping Transaction *orm or have the Ship Con*irm process automatically close a Trip, 0hich creates and closes the ?2ic>up@ stop and changes the )elivery status to ?Shipped@.

Companies that use public carries let the system automatically close a Trip as part o* Ship Con*irm.

!at is %elivery legs in Oracle A##s$

' )elivery Leg consists o* t0o stops 0here the delivery is pic>ed up and dropped o**, respectively on the same trip. The delivery might travel through several legs to get to its *inal destination. ' )elivery leg is synonymous to the 3ill o* Lading. ' bill o* lading is a receipt, listing all the goods that 0ere signed over to a carrier. The Ship Con*irm *orm has the option to generate a bill o* lading 0hich can then be printed as part o* the )elivery )ocument Set.

!at is %eliveries in Oracle A##s$

' )elivery is required to per*orm Ship Con*irm. 1t represents all the goods that 0ere shipped *rom the same 0arehouse, going to the same Customer location. The grouping o* delivery lines into deliveries is restricted by the grouping rules that are established on the Shipping 2arameters A )elivery Brouping Tab.

' )elivery can be created automatically or manually *rom the Shipping Transaction *orm at any time a*ter the order lines have become ?'0aiting Shipment@ or can be automatically created during the !elease Sales "rder process.

!at is %elivery Lines in Oracle A##s$

)elivery Lines are Sales "rder Lines 0hich have completed all their 0or>*lo0 activities that are prerequisites to Shipping such as Schedule C Line or Create Supply. )elivery lines are visible *rom the Shipping Transaction *orm. They are also visible *rom the Sales "rder Line=s 'dditional 1n*ormation C )eliveries tab.

!at is L&N's in Oracle A##s$

L2(, ,License 2late (umber- are also >no0n as Containers. ' container can be loaded inside o* another container, *or example, pac> an item into a box and then pac> that box onto a pallet.

Containers must be setup as inventory items. Containers can be made mandatory using your Shipping 2arameters.

!at is S!i# (rom in Oracle A##s$

The Ship rom location represents the 0arehouse that is per*orming the shipping transaction. ' 0arehouse is an 1nventory "rgani;ation. Each address that you can ship *rom 0ithin an organi;ation must be setup as an 1nventory location.

!at is S!i# to in Oracle A##s$

The Ship To location represents a ?ShipATo@ address that has been setup on the Customer=s record

OM.N)N*
SELECT a!order_(um,er, ,!2i(e_(um,er , '!2ot_(um,er, c!oe_i(ter'ace_'2a% FROM apps!oe_order_headers_a22 a , apps!oe_order_2i(es_a22 , , apps!5sh_de2i6er&_detai2s c , apps!mt2_materia2_tra(sactio(s d , apps!mt2_tra(sactio(_t&pes e , apps!mt2_tra(sactio(_2ot_(um,ers ' W ERE a!header_id " ,!header_id #N$ d!tr8_source_2i(e_id " c!source_2i(e_id #N$ ,!2i(e_id " d!tr8_source_2i(e_id #N$ '!tra(sactio(_id " d!tra(sactio(_id #N$ d!tra(sactio(_t&pe_id " e!tra(sactio(_t&pe_id #N$ d!tra(sactio(_t&pe_id " DD #N$ a!order_(um,er " B1JCCCCKDB

SELECT a!order_(um,er, ,!2i(e_(um,er , '!2ot_(um,er, c!oe_i(ter'ace_'2a% FROM apps!oe_order_headers_a22 a , apps!oe_order_2i(es_a22 , , apps!5sh_de2i6er&_detai2s c

, apps!mt2_materia2_tra(sactio(s d , apps!mt2_tra(sactio(_t&pes e , apps!mt2_tra(sactio(_2ot_(um,ers ' W ERE a!header_id " ,!header_id #N$ d!tr8_source_2i(e_id " c!source_2i(e_id a(d c!tra(sactio(_)d " d!tra(sactio(_)d .. additio(a2 2i(e #N$ ,!2i(e_id " d!tr8_source_2i(e_id #N$ '!tra(sactio(_id " d!tra(sactio(_id #N$ d!tra(sactio(_t&pe_id " e!tra(sactio(_t&pe_id #N$ a!order_(um,er " B1JCCCCKDB

SELECT

FROM

WHERE AND AND AND AND AND AND AND AND AND AND ORDER BY

mp.organization_code, rctta.NAME, hca.account_number, rctla.description, hca.account_name, rcta.bill_to_site_use_id bill_to, SUBSTR (hcasa.global_attribute14, 1, INSTR (hcasa.global_attribute14, '_') - 1 ) leg_code, DECODE (apsa.CLASS, 'CM', NVL (rcta.interface_header_attribute2, ct_reference), NVL (rcta.interface_header_attribute1, ct_reference) ) refer_new, rcta.trx_number, TO_CHAR (rcta.trx_date, 'DD-MON-YYYY') trx_date, rctla.extended_amount amt ra_customer_trx_all rcta, ar_payment_schedules_all apsa, ra_cust_trx_types_all rctta, ra_customer_trx_lines_all rctla, hz_cust_site_uses_all hcsua, hz_cust_accounts hca, hz_cust_acct_sites_all hcasa, mtl_parameters mp rcta.customer_trx_id = apsa.customer_trx_id rcta.customer_trx_id = rctla.customer_trx_id rcta.cust_trx_type_id = rctta.cust_trx_type_id hcsua.site_use_id = rcta.bill_to_site_use_id hcasa.cust_account_id = hca.cust_account_id hcsua.cust_acct_site_id = hcasa.cust_acct_site_id mp.organization_id = hcsua.warehouse_id hca.status = 'A' rctta.NAME LIKE ('%JE') TRUNC (apsa.gl_date) >= '01-JAN-2013' TRUNC (apsa.gl_date) <= '31-JAN-2013' 1, 9, 2, 3;

SELECT ood.organi;ation_name, msi.concatenated_segments item_code, mmt.transaction_date, mtt.transaction_type_id, mtt.transaction_type_name, mmt.transaction_quantity, mmt.subinventory_code, trans*er_subinventory,mmt.transaction_type_id,mmt.pic>ing_line_id,mmt.S"6!CE_L1(E_1), mmt.rcv_transaction_id !"# mtl_material_transactions mmt, mtl_transaction_types mtt, mtl_system_items_>*v msi, org_organi;ation_de*initions ood $%E!E mmt.transaction_type_id & mtt.transaction_type_id '() mmt.organi;ation_id & msi.organi;ation_id '() mmt.inventory_item_id & msi.inventory_item_id '() mmt.organi;ation_id & ood.organi;ation_id '() mtt.transaction_type_id ("T 1( ,..+, ..D, E5, .888F-

'() mmt.transaction_date 3ET$EE( (GL ,/p_trx_date_*rom, mmt.transaction_date '() (GL ,/p_trx_date_to, mmt.transaction_date '() msi.segment. & (GL ,/p_segment., msi.segment.'() msi.segment5 & (GL ,/p_segment5, msi.segment5'() msi.segment9 & (GL ,/p_segment9, msi.segment9'() ood.operating_unit & /p_org_id '() ood.organi;ation_id & (GL ,/p_0h, ood.organi;ation_id-

Вам также может понравиться