Professional Documents
Culture Documents
RA_CUSTOMERS
Column
Introduction
1256 Red Rock Consulting 1109
1257 Shell Rock Consulting 1110
View -
CAR_COMM_CUSTOMER_V
Oracle Applications has a very flexible architecture CUSTOMER_ID CUSTOMER_NAME CUSTOMER_NUMBER CUSTOMER_CLASS_CODE
This article provides a high level overview of the Another name assigned to a table for easy
Oracle Applications data structure and some identification and used for data classification
business examples. However, before we get between Oracle Application modules.
understand the data structure there is some
technical terminology that needs explanation. Primary Key
The business examples will be illustrated in Oracle The column or columns that uniquely identify each
SQL*Plus but you can use the same table joins in row of a table.
your preferred reporting writing tool such as Oracle
Querybuilder and Oracle Discoverer.
Foreign Key
Please refer to the Oracle Technical Reference One of more columns in one table whose values
manuals for more detail on the entity data models, refer to the primary key values in another table.
table descriptions and functional decomposition.
Record/Row CUSTOMER_ID
CUSTOMER_NAME
NUM
VC2
Primary Key
CUSTOMER_NUMBER VC2
STATUS VC2
Column/Field Relationship
View CITY
POSTAL_CODE
VC2
VC2
STATE VC2
ORG_ID NUM
AR GL AP
FND FA CM
• There is a table name (e.g. ITEM) you would
like to use but unsure of the exact name. OE INV PO
Login to SQL*Plus and type
SELECT table_name Oracle Applications Data
FROM all_tables Structure
WHERE table_name LIKE ‘%ITEM%’
• There is a column (e.g. CUSTOMER_NAME) that
Oracle General Ledger
you would like to use but unsure which table
the column belongs to. Gl_code_combinations
Login to SQL*Plus and type
✚ Setup > Accounts > Combinations
SELECT table_name, column_name
FROM all_tab_columns This table stores the valid account combinations.
WHERE column_name = ‘CUSTOMER_NAME’
The value in your chart of account segments are
• The columns org_id and organization_id are stored in the columns segment1 to segment30
different. Organisation_id refers to the depending on your application configuration.
inventory organisations in Oracle Inventory and
org_id refers to the operating unit. For example, say your chart of accounts is
Company – Cost Centre – Account
• Table names that ends with _all has the column then segment1 = company, segment 2 = cost
org_id included. The org_id signifies the centre and segment3 = account.
operating unit. Therefore, if you have multi- However, this sequencing of segments is not
organisation functionality, you will need to use guaranteed therefore, its best to check your
the _all tables. Note that not all tables will configuration.
have _all suffix.
Another important column is the account_type
• The majority of the entities describes in the which signifies your account is an Asset, Liability,
following are tables but you may find that there Revenue, Expense or Owners Equity account.
is a view that combines all your requirements.
These views will be based on non _all tables. Gl_je_batches
You need to type the following in SQL*Plus to
see the data in these views. ✚ Journals > Enter
Ap_invoices_all • Payment_num
Ap_payment_distributions_all
✚ Invoices > Entry > Invoices
✚ Payments > Entry > Payments
This table stores all the invoices you enter. For an
invoice to be approved, the total invoice amount This table stores accounting information for
must be stored in ap_invoice_distributions_all and payments. There is at least one CASH payment
ap_payment_schedules_all. distribution for each invoice payment. Additional
rows may include DISCOUNT, GAIN and LOSS
Some columns of interest includes : distributions where appropriate.
• Invoice_num
Some columns of interest includes :
• Invoice_date
• Line_type_lookup_code
• Amount_paid
(CASH/DISCOUNT/GAIN/LOSS)
• Invoice_currency_code
• Base_amount
• Invoice_type_lookup_code
• Payment_status_flag Oracle Purchasing
Ap_invoice_distributions_all Po_vendors
Some columns of interest includes : This table stores purchase order shipment
schedules and blanket agreement price breaks. A
• Segment1 (supplier number) purchase order is closed when QUANTITY is equal
• Vendor_name to QUANTITY_RECEIVED.
• Line_num • Receipt_source_code
• Item_description • Shipped_date
• Unit_price • Ship_to_org_id
Cst_item_costs
Some columns of interest includes :
✚ Costs > Item Costs
• Transaction_quantity
• Transaction_type_id This table stores the item cost information. Note
• Transaction_source_type_id that there can be multiple costs per item and the
actual cost is where the cost type is Frozen.
• Transaction_source_name
This table stores all transactions except • Price_list_id (links to so_price_lists for price list)
adjustments and miscellaneous cash receipts. This • Schedule_date
table is updated when a transaction occurs against
an invoice, debit memo, chargeback, credit memo, • Promise_date
on-account credit, or receipt. So_line_details
• Due_date • Released_flag
• Amount_due_remaining • Quantity
• Invoice_currency_code • Schedule_date
• Amount_applied • Delivery (link to mtl_demand for reservation
details)
• Anmount_credited
• Amount_adjusted So_picking_batches_all
This table stores the orders and returns The header_count column indicates the number of
information. picking headers are contained in a picking batch.
• Order_category (I, P. S, R, RMA) This table stores the picking headers within a
picking batch.
• Order_number
• Purchase_order_num Some columns of interest includes :
• Original_system_source_code (for imported
• Status_code (BACKORDERED, BACKORDER
orders from an external source)
RELEASE, CLOSED, OPEN, PENDING, IN
• Original_system_reference (for imported orders PROGRESS)
from an external source)
So_picking_lines_all
• Requested_quantity
• shipped_quantity
• Date_requested
• Cancelled_quantity
So_picking_line_details
• Requested_quantity
• Serial_number
Wsh_departure
• Name
• Planned_departure_date
• Actual_depature_date
Wsh_delivery
• Name
• Planned_departure_date
• Actual_depature_date
• Waybill
i n v e n t o r y _ i t e m _ i d
j e _ b a t c h _ i d o r g a n i z a t i o s n u _ b i i dn v e n t o r y _ c o d e
o r g a n i z a t i o n _ i d
G L 3 I N V 2 I N V 4 i n v e n t o r y _ i t e m _ i d
g l _ j e _ h e a d e r s m t l _ s e c o n d a r y _ i n v e n t o r i e sm t l _ s y s t e m _ i t e m s
o r g a n i z a t i o n _ i d
s e c o n d a r y _ i n v e n t o r y _ n a mi n e v e n t o r y _ i t e m _ i d
j e _ h e a d e r _ i d
o r g a n i z a t i o n _ i d
G L 4 I N V 5 I N V 7
c o d e _ c o m b i n a t i o n _ i dg l _ j e _ l i n e s m t l _ o n h a n d _ q u a n t i t y c s t _ i t e m _ c o s t s
G e n e r a l L e dI ng ve er n t o r y
b i l l _ t o _ c u s t o m e r _ i d
c u s t o m e r s_ h i di p _ t o _ c u s t o m e r _ i d
A R 1 A R 4 A R 7 O E 1 h e a d e r _ i d O E 4
r a _ c u s t o m e r s r a _ c u s t o m e r _ t r x _ a l l a r _ c a s h _ r e c e i p t s s o _ h e a d e r s _ a l l s o _ p i c k i n g _ b a t c h e s _ a l l
b i l l _ t o _ s i t e _ u s e _ i d
c u s t o m e r _ i d c u s t o m e r _ t r x _ i d c a s h _ r e c e i p t _ i d h e a d e r _ i d b a t c h _ i d
s h i p _ t o _ s i t e _ u s e _ i d c u s t o m e r _ t r x _ i d o r d e r _ h e a d e r _ i d
A R 2 A R 5 A R 8 O E 2 O E 5
r a _ a d d r e s s e s _ a l l r a _ c u s t o m e r _ t r x _ l i n e s _ a a r l _l r e c e i v a b l e _ a p p l i c a t is o o n _ s l i n e s _ a l l s o _ p i c k i n g _ h e a d e r s _ a l l
l i n e _ i d
a d d r e s s _ i d c u s t o m e r _ t r x _ l i n e _ i d p a y m e n t _ s c h e d u l e _ i d l i n e _ i d p i c k i n g _ h e a d e r _ i d
o r d e r _ l i n e _ i d
A R 3 A1 R 6 A R 9 O E 3 O E 6 O E 8
r a _ s i t e _ u s e s _ a l l r a _ c u s t _ t r x _ l i n e _ g l _ d i s t _a ra _l l p a y m e n t _ s c h e d u l e ss o _ l i n e _ d e t a i l s s o _ p i c k i n g _ l i n e s _ a l l w s h _ d e p a r t u r e
s i t e _ u s e _ i d
l i n e _ d e t a i l _ i d
d e p a r t u r e _ i d
p i c k i n g _ l i n pe l _ a i n d n e d _ d e p a r t u r e _ i d
a c t u a l _ d e p a r t u r e _ i d
O E 7 O E 9
s o _ p i c k i n g _ l i n e _ d e t a i l s w s h _ d e l i v e r i e s
R e c e i v a b l e sO r d e r E n t r y
v e n d o r _ i d
A P 1 i n v o i c e _ i d A P 3 P O 1 P O 3 P O 7
a p _ i n v o i c e s _ a l l a p _ p a y m e n t _ s c h e d u l e s _ a l l p o _ v e n d o r s p o _ h e a d e r s _ a l l r c v _ s h i p m e n t _ h e a d e r s
i n v o i c e _ i d v e n d o r _ i d p o _ h e a d e r _ i d s h i p m e n t _ h e a d e r _ i d
i n v o i c e _ i d
A P 2 A P 4 P O 2 P O 4 P O 8
a p _ i n v o i c e _ d i s t r i b u t i o n s _ a l al p _ c h e c k s _ a l l p o _ v e n d o r _ s i t e s _ a l l p o _ l i n e s _ a l l r c v _ s h i p m e n t _ l i n e s
v e n d o r _ s i t e _ i d
c h e c k _ i d p o _ l i n e _ i d
A P 5 P O 5
a p _ i n v o i c e _ p a y m e n t s _ a l l p o _ l i n e _ l o c a t i o n s _ a l l
i n v o i c e _ p a y m e n t _ i d l i n e _ l o c a t i o n _ i d
P O p o _ d i s t r i b
6 u t i o n _ i d
A P 6
a p _ i n v o i c e _ d i s t r i b u t i o n s _ P a al l y a b l e s P u r c h a s i n g p o _ d i s t r i b u t i o n s _ a l l
C r o s s A p p l i c a t i o n J o i n s
G L 1 c o d e _ c o m b i n a t i o n _ i d = A R 6 , A cR o 9 d e _ c o m b i n a t i o n _ i d A P 1 p o _ h e a d e r _ i d = P O 3 p o _ h e a d e r _ i d
P O 6
G L 1 c o d e _ c o m b i n a t i o n _ i d = P O 6 b u d g e t _ a c c o u n t _ i d , a c c r uA a P l _6 a c c po ou _n td _i s i td r , i b u t i o n _ i d = P O 6 p o _ d i s t r i b u t i o n _ i d
v a r i a n c e _ a c c o u n t _ i d
G L 1 c o d e _ c o m b i n a t i o n _ i d = I N V 6 r e f e r e n c e _ a c c o u n t s A P 1 v e n d o r _ i d = P O 1 v e n d o r _ i d
G L 1 c o d e _ c o m b i n a t i o n _ i d = A P 2 , A Pa 6c c t s _ p a y _ c o d e _ c o m b i n a A t iP o 1n _ i d v e n d o r _ s i t e _ i d= P O 2 v e n d o r _ s i t e _ i d
G L 1 c o d e _ c o m b i n a t i o n _ i d = A P 6 d i s t _ c o d e _ c o m b i n a t i o n _ i dO E 1 c u s t o m e r _ i d = A R 1 c u s t o m e r _ i d
I N V 3 s o u r c e _ l i n e _ i d = O E 3 l i n e _ d e t a i l _ i d O E 1 s h i p _ t o _ s i t e _ u= s e _ i d A R 2 s i t e _ u s e _ i d
a n d s o u r c e _ c o d e = ' O R D E R E N T R Y ' a n d s i t e _ u s e _ c o d e = ' S H I P _ T O '
I N V 3 p i
c k i n g _ l i n e _ i d = O E 6 p i c k i n g _ l i n e _ i d O E 1 b i l l _ t o _ s i t e _ u s= e _ i d A R 2 s i t e _ i s e _ i d
a n d s o u r c e _ c o d e = ' O R D E R E N T R Y ' a n d s i t e _ u s e _ c o d e = ' B I L L _ T O '
I N V 3 s h i p m e n t _ n u m b e r = P O 7 s h i p m e n t _ n u m A R 5 i n t e r f a c e _ l i n e _= a t t r i b Ou t E e 1 1 o r d e r _ n u m b e r
a n d s o u r c e _ c o d e = ' R C V ' a n d i n t e r f a c e _ c o n t e x t = ' O R D E R E N T R Y '
I N V 3 t r a n s a c t i o n _ s o u r c e _ i d= P O 8 s h i p m e n t _ l i n e _ i d A R 5 i n t e r f a c e _ l i n e _= a t t r i b Ou t E e 2 6 l i n e _ i d
a n d s o u r c e _ c o d e = ' R C V ' a n d i n t e r f a c e _ c o n t e x t = ' O R D E R E N T R Y '
I N V 4 o r g a n i z a t i o n _ i d = O E 2 o r g a n i z a t i o n _ i d A R 5 i n t e r f a c e _ l i n e _= a t t r i b Ou t E e 6 7 p i c k i n g _ l i n e _ i d
I N V 4 i n v e n t o r y _ i t e m _ i d = O E 2 , P Oi n 4 v ,e n t o r y _ i t e m _ i d a n d i n t e r f a c e _ c o n t e x t = ' O R D E R E N T R Y '
A R 5
Reconciliation
Are you having problem reconciling your General Ledger to your subledger ? This process can take a long time
to resolve if you don’t know where to look.
The following SQL*Plus example displays the sum of the Trade Receipts from your Receivables subledger for a
given period name (i.e. ‘Apr-00’) by the General Ledger batch name. This example also assumes that you are
entering receipts in batches.
You can even go further and look at the accounts for which these trade receipts have debited and credited by
joining ar_receivable_applications to the gl_code_combinations table via code_combination_id.
The gl_import_references table links the General Ledger journal tables to Receivables.
SELECT
Gb.name gl_batch_name,
B.name ar_batch,
NVL(SUM(DECODE(ra.status,'APP', ra.amount_applied,0)),0) +
NVL(SUM(DECODE(ra.status,'ACC', ra.amount_applied,0)),0) +
NVL(SUM(DECODE(ra.status,'UNAPP',ra.amount_applied,0)),0) +
NVL(SUM(DECODE(ra.status,'UNID', ra.amount_applied,0)),0) rec_amount
FROM ar_receivable_applications_all ra,
ar_cash_receipts_all cr,
ar_batches_all b,
ar_cash_receipt_history_all crh,
gl_je_batches gb
WHERE ra.cash_receipt_id = cr.cash_receipt_id
AND cr.cash_receipt_id = crh.cash_receipt_id
AND crh.batch_id = b.batch_id
AND (crh.batch_id, crh.cash_receipt_id, gb.je_batch_id) IN
(SELECT DISTINCT
ab.batch_id,
ac.cash_receipt_id,
b.je_batch_id
FROM
ar_batches_all ab,
ar_cash_receipt_history_all ah,
ar_cash_receipts_all ac,
gl_import_references i,
gl_je_headers h,
gl_je_batches b
WHERE h.je_header_id = i.je_header_id
AND b.je_batch_id = i.je_batch_id
AND i.reference_2 = ah.cash_receipt_id
AND ah.cash_receipt_id = ac.cash_receipt_id
AND ab.batch_id(+) = ah.batch_id
AND h.je_source = 'Receivables'
AND h.je_category = 'Trade Receipts'
AND h.je_batch_id = b.je_batch_id
AND h.period_name = 'Apr-00')
GROUP BY gb.name, b.name
ORDER BY 1, 2
/
Information Management
You schedule your orders but you are running low in stock for some items. The following example displays the
reservation information for the item parameter. Based on this information, you can then decide which orders
can be rescheduled.
The table mtl_demand stores the reservation information and fnd_user contains user information. The majority
of the tables have the columns created_by, last_updated_by that represents the user who entered the
transaction and the last user to have updated the transaction, respectively.
Your customers have been returning products, but why ? Is it the product quality, is it the delivery ? How can
the business improve ?
You enter return reasons on Return Material Authorisations (RMAs) and the following example reviews the
returns for a given date range (where &&from_date and &&to_date are parameters in SQL*Plus) for when the
RMAs have been created.
SELECT
l.transaction_reason_code reason_code,
c.customer_name cust_name,
SUBSTR(s.segment1, 1, 10) item,
h.order_number ord_no,
t.trx_number inv_no,
0 - NVL(l.ordered_quantity, 0) - NVL(l.cancelled_quantity, 0) rma_quantity,
NVL(tl.quantity_credited, 0) qty_credited,
NVL(tl.quantity_credited, 0) * NVL(unit_selling_price, 0) total_cr,
u.user_name creator_name,
h.creation_date creation_date
FROM fnd_user u,
mtl_system_items s,
ra_customers c,
ra_customer_trx_all t,
ra_customer_trx_lines_all tl,
so_headers_all h,
so_lines_all l
WHERE h.order_category = 'RMA'
AND h.cancelled_flag is null
AND tl.customer_trx_id = t.customer_trx_id(+)
AND tl.interface_line_attribute6(+) = l.line_id
AND c.customer_id = h.customer_id
AND u.user_id = h.created_by
AND l.inventory_item_id = s.inventory_item_id
AND l.warehouse_id = s.organization_id
AND h.header_id = l.header_id
AND h.creation_date between to_date('&&from_date', 'DD-MON-RRRR')
AND to_date('&&to_date', 'DD-MON-RRRR')
ORDER BY 1, 2
/
You need to ensure that all orders entered for the day is booked in order to progress to the next step.
Therefore, you may setup an Oracle Alert based on the following SQL*Plus and email the output to the Sales
Order Administrator. The following can also highlight training issues if one particular user is not booking orders
on a regular basis as indicated by the Created_by column.
SELECT
o.organization_code Org_name,
SUBSTR(msi.segment1, 1, 10) Item,
SUBSTR(msi.description, 1, 45) Item_desc,
sh.order_number Order_number,
sh.date_ordered Date_ordered,
SUBSTR(fu.user_name, 1, 12) Created_by,
NVL(sl.ordered_quantity, 0) - NVL(sl.cancelled_quantity, 0) Qty_ordered,
sl.selling_price*sl.ordered_quantity Ext_amount
FROM so_headers_all sh,
mtl_system_items msi,
so_lines_all sl,
fnd_user fu,
org_organization_definitions o
WHERE sh.header_id = sl.header_id
AND o.organization_id = msi.organization_id
AND sh.order_category IN ('R', 'RMA')
AND sl.inventory_item_id = msi.inventory_item_id
AND sl.warehouse_id = msi.organization_id
AND sh.created_by = fu.user_id
AND (sh.s1 = 5 or sh.s1 = 15)
AND sh.cancelled_flag is null
AND sh.creation_date BETWEEN TO_DATE('&&from_date, 'DD-MON-RR')
AND TO_DATE('&&to_date', 'DD-MON-RR')
ORDER BY
o.organization_code,
SUBSTR(msi.segment1, 1, 10),
SUBSTR(msi.description, 1, 45),
sh.order_number
/
Jenny Chan is an Applications Consultant with Red Rock Consulting based in Sydney, Australia. She has 9 years
experience within the Oracle environment, 5 of which have been working with Oracle Applications. You can
reach her by email at chanj@redrock.net.au and there are web pages of articles and tips at
http://www.redrock.net.au.