You are on page 1of 3

Defining a Custom Source to map the revenue account based a specific item category, location, and type of customer

(External/intercompany). Accounting Flexfield First Segment Second Third Fourth - Company - Location - Department - Account

(Shipment Warehouse) (Revenue Departments) (Intercompant/External)

1. ORACLE stores the Organization_ID in attribute 10 of the Line Transaction Flexfield

2. The Item ID (Transaction Inventory Item Identifier) is an Standard Source in Receivable. We can determine the category value by running the appropriated SQL.

3. The following PL/SQL function was developed:


create or replace function xxsla_sales_segment2 (v_organization_id_char IN VARCHAR2, v_inventory_item_id number) RETURN VARCHAR2 IS v_segment VARCHAR2(40); v_organization_id number; BEGIN v_organization_id := to_number(NVL(v_organization_id_char,0)); select cat_values.segment2 into v_segment from INV.MTL_ITEM_CATEGORIES MIC , INV.MTL_CATEGORY_SETS_B MCS , INV.MTL_CATEGORY_SETS_TL MCS_TL , INV.MTL_CATEGORIES_B cat_values where MCS.category_set_id = MCS_TL.category_set_id and MIC.inventory_item_id = NVL(v_inventory_item_id,0) and MIC.category_set_id = MCS.category_set_id and MIC.organization_id = v_organization_id and cat_values.category_id = MIC.category_id and UPPER(category_set_name) = UPPER('BCE_Sales') and language = 'US'; RETURN v_segment; EXCEPTION WHEN OTHERS THEN RETURN NULL; END;

4. Custom folder was defined as:

5. Custom Folder was used in the ADR as follows:

You might also like