Professional Documents
Culture Documents
Custom Source
Custom Source
Please note that in addition to the Subledger Accounting setup screens, in order to
make use of the information in this document you will require the necessary privileges
to create a PL/SQL Procedure as the 'APPS' SQL*Plus username, and will also need a
working knowledge of how the Item and Transaction database tables link together.
1) Write the function needed to join to the Custom Source column
l_inventory_item_id number;
l_organization_id number;
l_segment varchar2(30);
BEGIN
select inventory_item_id,organization_id into l_inventory_item_id,
l_organization_id
from mtl_material_transactions
where transaction_id=p_transaction_id
;
select segment1 into l_segment from mtl_item_categories_v
where
inventory_item_id= l_inventory_item_id
and organization_id= l_organization_id
and category_set_name='Inv.Items';
RETURN l_segment;
END JGC_DELIVER_TRANS;
Set serveroutput on
declare
l_segment VARCHAR2(30);
begin
l_segment:=JGC_DELIVER_TRANS(22390328);
DBMS_OUTPUT.PUT_LINE('SEGMENT '||l_segment);
end;
Notice that the source for the ADR is the function name (i.e. custom source) created
previously and the test is for the function’s returned value i.e. ‘NEW’ in this case.
7 Journal Line Definition (JLD)
1. Make your test cases as simple as possible. Get the ADR to return the whole
of flexfield in order that you can check the output easily.
2. Test the function
3. Know the data model. I know of no documentation that will help you. The best
information available is in the source of the view gmf_subledger_rep_v (the
equivalent of the Release 11i view gl_subr_led_vw).
For example, the part of view gmf_subledger_rep_v for a Receiving Transaction is:
…
FROM gmf_xla_extract_headers eh,
rcv_transactions rt,
mtl_material_transactions mmt,
mtl_transaction_lot_numbers mtln,
rcv_shipment_headers rsh,
rcv_shipment_lines rsl,
po_headers_all poh,
po_vendors pv
WHERE eh.transaction_id = mmt.transaction_id
AND eh.source_document_id = rt.shipment_header_id
AND eh.source_line_id = rt.transaction_id
AND rt.transaction_id = mmt.rcv_transaction_id
AND eh.transaction_source_type_id IN (1, 7)
N.B the basic table here is gmf_xla_extract_headers, which is populated by the OPM
SLA Pre-Processor.