Inventory On-hand quantity Interface

Inventory On-hand quantity Interface, AskHareesh.blogspot.com

Inventory On-hand quantity Interface

This interface lets you import the on hand inventory into Oracle.

Interface tables:
  • MTL_TRANSACTIONS_INTERFACE
  • MTL_MTL_TRANSACTION_LOTS_INTERFACE (If the item is Lot Controlled)
  • MTLL_SERIAL_NUMBERS_INTERFACE (If the item is Serial Controlled)
Concurrent Program:
  • Launch the Transaction Manager through Interface Manager or explicitly call the API – INV_TXN_MANAGER_PUB.PROCESS_TRANSACTIONS () to launch a dedicated transaction worker to process them.
  • The Transaction Manager picks up the rows to process based on the LOCK_FLAG, TRANSACTION_MODE, and PROCESS_FLAG.
  • Only records with TRANSACTION_MODE of 3, LOCK_FLAG of '2', and PROCESS_FLAG of '1' will be picked up by the Transaction Manager and assigned to a Transaction Worker. If a record fails to process completely, then PROCESS_FLAG will be set to '3' and ERROR_CODE and ERROR_EXPLANATION will be populated with the cause for the error.
Base Tables:
  • MTL_ON_HAND_QUANTITIES
  • MTL_LOT_NUMBERS
  • MTL_SERIAL_NUMBERS
Validations:
  • Validate organization_id
  • Check if item is assigned to organization
  • Validate disposition_id
  • Check if the item for the org is lot controlled before inserting into the Lots interface table.
  • Check if the item for the org is serial controlled before inserting into Serial interface table.
  • Check if inventory already exists for that item in that org and for a lot.
  • Validate organization_id, organization_code.
  • Validate inventory item id.
  • Transaction period must be open.
Important Columns:
Some important columns that need to be populated in the interface tables:
MTL_TRANSACTIONS_INTERFACE:
  • TRANSACTION_SOURCE_NAME (ANY USER DEFINED VALUE),
  • TRANSACTION_HEADER_ID (MTL_MATERIAL_TRANSACTIONS_S.NEXTVAL)
  • TRANSACTION_INTERFACE_ID (MTL_MATERIAL_TRANSACTIONS_S.NEXTVAL – If item is lot or serial controlled, use this field to link to mtl_transactions_interface otherwise leave it as NULL),
  • TRANSACTION_DATE,
  • TRANSACTION_TYPE_ID,
  • PROCESS_FLAG (1 = Yet to be processed, 2 = Processed, 3= Error)
  • TRANSACTION_MODE (2 = Concurrent – to launch a ded transaction worker to explicitly process a set of transactions, 3 = Background – will be picked up by transaction manager polling process and assigned to transaction worker. These will not be picked up until the transaction manager is running)
  • SOURCE_CODE,
  • SOURCE_HEADER_ID,
  • SOURCE_LINE_ID (Details about the source like Order Entry etc for tracking purposes)
  • TRANSACTION_SOURCE_ID
Source Type Foreign Key Reference
  • Account GL_CODE_COMBINATIONS.CODE_COMBINATION_ID
  • Account Alias MTL_GENERIC_DISPOSITIONS.DISPOSITION_ID
  • Job or schedule WIP_ENTITIES.WIP_ENTITY_ID
  • Sales Order MTL_SALES_ORDERS.SALES_ORDER_ID
  • ITEM_SEGMENT1 TO 20,
  • TRANSACTION_QTY,
  • TRANSACTION_UOM,
  • SUBINVENTORY_CODE,
  • ORGANIZATION_ID,
  • LOC_SEGMENT1 TO 20
MTL_TRANSACTION_LOTS_INTERFACE:
  • TRANSACTION_INTERFACE_ID,
  • LOT_NUMBER,
  • LOT_EXPIRATION_DATE,
  • TRANSACTION_QUANTITY,
  • SERIAL_TRANSACTION_TEMP_ID (This is required for items under both lot and serial control to identify child records in mtl_serial_numbers_interface)
MTL_SERIAL_NUMBERS_INTERFACE:
  • TRANSACTION_INTERFACE_ID,
  • FM_SERIAL_NUMBER,
  • TO_SERIAL_NUMBER,
  • VENDOR_SERIAL_NUMBER


Item import (Item conversion)

Item import (Item conversion), AskHareesh.blogspot.com

Item import (Item conversion)

The Item Interface lets you import items into Oracle Inventory.

Pre-requisites:
  • Creating an Organization
  • Code Combinations
  • Templates
  • Defining Item Status Codes
  • Defining Item Types

Interface tables:
  • MTL_SYSTEM_ITEMS_INTERFACE
  • MTL_ITEM_REVISIONS_INTERFACE (If importing revisions)
  • MTL_ITEM_CATEGORIES_INTERFACE (If importing categories)
  • MTL_INTERFACE_ERRORS (View errors after import)

Concurrent Program:
  • Item import
In the item import parameters form, for the parameter 'set process id', specify the 'set process id' value given in the mtl_item_categories_interface table. The parameter 'Create or Update' can have any value. Through the import process, we can only create item category assignment(s). Updating or Deletion of item category assignment is not supported.

Base Tables:
  • MTL_SYSTEM_ITEMS_B
  • MTL_ITEM_REVISIONS_B
  • MTL_CATEGORIES_B
  • MTL_CATEGORY_SETS_B
  • MTL_ITEM_STATUS
  • MTL_ITEM_TEMPLATES
Validations:
  • Check for valid item type.
  • Check for valid part_id/segment of the source table.
  • Validate part_id/segment1 for master org.
  • Validate and translate template id of the source table.
  • Check for valid template id. (Attributes are already set for items, default attributes for that template, i.e., purchasable, stockable, etc )
  • Check for valid item status.
  • Validate primary uom of the source table.
  • Validate attribute values.
  • Validate other UOMs of the source table.
  • Check for unique item type. Discard the item, if part has non-unique item type.
  • Check for description, inv_um uniqueness
  • Validate organization id.
  • Load master records and category records only if all
  • Load child record if no error found.
Important Columns:
Some important columns that need to populated in the interface tables:
MTL_SYSTEM_ITEMS_INTERFACE:
  • PROCESS_FLAG = 1 (1= Pending, 2= Assign Complete, 3= Assign/Validation Failed, 4= Validation succeeded; Import failed, 5 = Import in Process, 7 = Import succeeded)
  • TRANSACTION_TYPE = ‘CREATE’, ‘UPDATE’
  • SET_PROCESS_ID = 1
  • ORGANIZATION_ID
  • DESCRIPTION
  • ITEM_NUMBER and/or SEGMENT (n)
  • MATERIAL_COST
  • REVISION
  • TEMPLATE_ID
  • SUMMARY_FLAG
  • ENABLED_FLAG
  • PURCHASING_ITEM_FLAG
  • SALES_ACCOUNT (defaulted from MTL_PARAMETERS.SALES_ACCOUNT)
  • COST_OF_SALES_ACCOUNT(defaulted from MTL_PARAMETERS.COST_OF_SALES_ACCOUNT)
MTL_ITEM_CATEGORIES_INTERFACE:
  • INVENTORY_ITEM_ID or ITEM_NUMBER.
  • ORGANIZATION_ID or ORGANIZATION_CODE or both.
  • TRANSACTION_TYPE = 'CREATE' ('UPDATE' or 'DELETE' is not possible through Item Import).
  • CATEGORY_SET_ID or CATEGORY_SET_NAME or both.
  • CATEGORY_ID or CATEGORY_NAME or both.
  • PROCESS_FLAG = 1
  • SET_PROCESS_ID (The item and category interface records should have the same set_process_id, if you are importing item and category assignment together)
MTL_ITEM_REVISIONS_INTERFACE:
  • INVENTORY_ITEM_ID or ITEM_NUMBER (Must match the ORGANIZATION_ID or ORGANIZATION_CODE or both)
  • REVISION
  • CHANGE_NOTICE
  • ECN_INITIATION_DATE
  • IMPLEMENTATION_DATE
  • IMPLEMENTED_SERIAL_NUMBER
  • EFFECTIVITY_DATE
  • ATTRIBUTE_CATEGORY
  • ATTRIBUTEn
  • REVISED_ITEM_SEQUENCE_ID
  • DESCRIPTION
  • PROCESS_FLAG = 1
  • TRANSACTION_TYPE = 'CREATE'
  • SET_PROCESS_ID = 1
Each row in the mtl_item_revisions_interface table must have the REVISION and EFFECTIVITY_DATE in alphabetical (ASCII sort) and chronological order.


Order Import Interface (Sales Order Conversion)

Order Import Interface (Sales Order Conversion), AskHareesh.blogspot.com

Order Import Interface (Sales Order Conversion)

Order Import enables you to import Sales Orders into Oracle Applications instead of manually entering them.

Prerequisites:
  • Order Type
  • Line Type
  • Items
  • Customers
  • Ship Method/ Freight Carrier
  • Sales Person
  • Sales Territories
  • Customer Order Holds
  • Sub Inventory/ Locations
  • On hand Quantity
Interface tables:
  • OE_HEADERS_IFACE_ALL
  • OE_LINES_IFACE_ALL
  • OE_ACTIONS_IFACE_ALL
  • OE_ORDER_CUST_IFACE_ALL
  • OE_PRICE_ADJS_IFACE_ALL
  • OE_PRICE_ATTS_IFACE_ALL
Base tables:
  • OE_ORDER_HEADERS_ALL
  • OE_ORDER_LINES_ALL
Pricing tables:
  • QP_PRICING_ATTRIBUTES
Concurrent Program:
  • Order Import
Validations:
  • Check for sold_to_org_id. If does not exist, create new customer by calling create_new_cust_info API.
  • Check for sales_rep_id. Should exist for a booked order.
  • Ordered_date should exist (header level)
  • Delivery_lead_time should exist (line level)
  • Earliest_acceptable_date should exist.
  • Freight_terms should exist
Notes:
During import of orders, shipping tables are not populated. If importing customers together with the order, OE_ORDER_CUST_IFACE_ALL has to be populated and the base tables are HZ_PARTIES, HZ_LOCATIONS.

Orders can be categorized based on their status:
  1. Entered orders
  2. Booked orders
  3. Closed orders

Order Import API OE_ORDER_PUB.GET_ORDER and PROCESS_ORDER can also be used to import orders.

Important Columns:
Some important columns that need to populated in the interface tables:
OE_HEADERS_IFACE_ALL:
  • ORIG_SYS_DOCUMENT_REF
  • ORDER_SOURCE
  • CONVERSION_RATE
  • ORG_ID
  • ORDER_TYPE_ID
  • PRICE_LIST
  • SOLD_FROM_ORG_ID
  • SOLD_TO_ORG_ID
  • SHIP_TO_ORG_ID
  • SHIP_FROM_ORG_ID
  • CUSTOMER_NAME
  • INVOICE_TO_ORG_ID
  • OPERATION_CODE
  • OE_LINES_IFACE_ALL
  • ORDER_SOURCE_ID
  • ORIG_SYS_DOCUMENT_REF
  • ORIG_SYS_LINE_REF
  • ORIG_SYS_SHIPMENT_REF
  • INVENTORY_ITEM_ID
  • LINK_TO_LINE_REF
  • REQUEST_DATE
  • DELIVERY_LEAD_TIME
  • DELIVERY_ID
  • ORDERED_QUANTITY
  • ORDER_QUANTITY_UOM
  • SHIPPING_QUANTITY
  • PRICING_QUANTITY
  • PRICING_QUANTITY_UOM
  • SOLD_FROM_ORG_ID
  • SOLD_TO_ORG_ID
  • INVOICE_TO_ ORG_ID
  • SHIP_TO_ORG_ID
  • PRICE_LIST_ID
  • PAYMENT_TERM_ID

Complete GL Interface Standard Program & Validation Columns

Complete GL Interface, www.askhareesh.com
Standard Program:
  • Go to General Ledger Vision Operations(USA)
  • Run =>Import
  • Here Give the Source name and Save.
While Click on the save button  Back end One Program Concurrent Program is running.If it is Success the Records are Successfully loaded from interface table to base Table Otherwise Some Error are there.
Copy that Request_id and Enter into Generals our Records will be there...........


Validation Columns:
  • Source
  • period_name
  • currency_code
  • set_of_books_id
  • je_source
  • je_catregory
  • accounting_date
  • entered_dr
  • entered_cr
  • accounted_cr
  • accounted_dr
  • encumberance_type_id




GL Interface Package & Procedure

Complete GL Interface, www.askhareesh.com
GL Interface Package & Procedure

CREATE OR REPLACE package body APPS.XX_GL_INT_PKG is
procedure GL_INT_LOG(p_msg in varchar2) is
begin
fnd_file.put_line(fnd_file.log,p_msg);
end;
procedure GL_INT_MAIN(errbuf out varchar2, retcode out varchar2) is
 cursor c1 is select a.rowid row_id,a.* from GL_INTERFACE_TEMP a;
 v_gl_int    gl_interface%rowtype;
 v_process_flag    varchar2(10);
 v_error_msg   varchar2(100);
 v_tot_err_msg   varchar2(1000);
 begin
   GL_INT_LOG('before entering the loop');
 for i in c1 loop
                v_error_msg :=null;
                v_process_flag:='S';
                v_tot_err_msg:=null;
                v_gl_int:=null;
              --currency_code validation
                begin
                select  currency_code into v_gl_int.currency_code
                                      from fnd_currencies
                                     where currency_code=i.currency_code;
                 exception
                 when no_data_found then
                    v_process_flag:='E';
                    v_error_msg  := 'Invalid Currency Code =>'||i.currency_code;
                    v_tot_err_msg:= v_tot_err_msg||' '||v_error_msg ;
                 when others then
                    v_process_flag:='E';
                    v_error_msg   := ' Exception at Currency Code =>'||i.currency_code;
                    v_tot_err_msg:= v_tot_err_msg||' '||v_error_msg ;
                end;    
     
                --user_je_source_name validation
             begin
                  select user_je_source_name into v_gl_int.user_je_source_name
                                             from gl_je_sources
                                            where user_je_source_name=i.user_je_source_name;
                  exception
                 when no_data_found then
                    v_process_flag:='E';
                    v_error_msg  := 'Invalid Sourec Name =>'||i.user_je_source_name;
                    v_tot_err_msg:= v_tot_err_msg||' '||v_error_msg ;
                 when others then
                    v_process_flag:='E';
                    v_error_msg   := ' Exception at Sourec Name =>'||i.user_je_source_name;
                    v_tot_err_msg:= v_tot_err_msg||' '||v_error_msg ;
                end;    
             --category_name  validation
                begin
                     select user_je_category_name into v_gl_int.user_je_category_name
                     from gl_je_categories
                     where user_je_category_name=i.user_je_category_name;
                  exception
                  when no_data_found then
                    v_process_flag:='E';
                    v_error_msg  := 'Invalid category_name =>'||i.user_je_category_name;
                    v_tot_err_msg:= v_tot_err_msg||' '||v_error_msg ;
                  when others then
                    v_process_flag:='E';
                    v_error_msg   := ' Exception at category_name =>'||i.user_je_category_name;
                    v_tot_err_msg:= v_tot_err_msg||' '||v_error_msg ;  
               end;
             --user id validation
               begin
                     select user_id into v_gl_int.created_by from fnd_user
                                   where  user_id = i.created_by;
                  exception
                  when no_data_found then
                    v_process_flag:='E';
                    v_error_msg  := 'Invalid user id =>'||i.created_by;
                    v_tot_err_msg:= v_tot_err_msg||' '||v_error_msg ;
                  when others then
                    v_process_flag:='E';
                    v_error_msg   := ' Exception at user id =>'||i.created_by;
                    v_tot_err_msg:= v_tot_err_msg||' '||v_error_msg ;
                 end;
             -- set of books id validation
               begin
               SELECT SET_OF_BOOKS_ID INTO v_gl_int.set_of_books_id
                      FROM GL_SETS_OF_BOOKS WHERE SET_OF_BOOKS_ID=i.set_of_books_id;
                   exception
                  when no_data_found then
                    v_process_flag:='E';
                    v_error_msg  := 'Invalid set of books id =>'||i.set_of_books_id;
                    v_tot_err_msg:= v_tot_err_msg||' '||v_error_msg ;
                  when others then
                    v_process_flag:='E';
                    v_error_msg   := ' Exception atset of books id =>'||i.set_of_books_id;
                    v_tot_err_msg:= v_tot_err_msg||' '||v_error_msg ;
                end;
           v_gl_int.status                    :=i.status;
                        -- v_gl_int.set_of_books_id           :=i.set_of_books_id;
                         v_gl_int.accounting_date           :=i.accounting_date;
                        -- v_gl_int.currency_code             :=i.currency_code;
                         v_gl_int.date_created              :=i.date_created;
                         --v_gl_int.created_by                :=i.created_by;
                         v_gl_int.actual_flag               :=i.actual_flag ;
                         --v_gl_int.user_je_category_name     :=i.user_je_category_name;
                        --v_gl_int.user_je_source_name       :=i.user_je_source_name;
                         v_gl_int.segment1                  :=i.segment1;
                         v_gl_int.segment2                  :=i.segment2;
                         v_gl_int.segment3                  :=i.segment3;
                         v_gl_int.segment4                  :=i.segment4;
                         v_gl_int.segment5                  :=i.segment5 ;
                         v_gl_int.entered_dr                :=i.entered_dr;
                         v_gl_int.entered_cr                :=i.entered_cr;
                         v_gl_int.accounted_dr               :=i.accounted_dr;
                         v_gl_int.accounted_cr              :=i.accounted_cr;
                         v_gl_int.group_id                  :=i.group_id;
                       GL_INT_LOG('before inserting the loop');
               if v_process_flag = 'S' then    
             insert into gl_interface values v_gl_int;
               end if;
           update GL_INTERFACE_TEMP set process_flag=v_process_flag,
                                           error_message=v_tot_err_msg
                       where rowid=i.row_id;
               GL_INT_LOG('after inserting the loop');    
 end loop;
 exception
 when others then
 GL_INT_LOG('exception occured at GL_INT_MAIN loop');
 end GL_INT_MAIN;
 end XX_GL_INT_PKG;
 



Control file for GL Interface

Complete GL Interface, www.askhareesh.com
Control file for GL Interface
LOAD DATA
INFILE *
TRUNCATE INTO TABLE GL_INTERFACE_TEMP
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
                (STATUS,
                 SET_OF_BOOKS_ID,
                 ACCOUNTING_DATE,
                 CURRENCY_CODE,
                 DATE_CREATED,
                 CREATED_BY,
                 ACTUAL_FLAG,
                 USER_JE_CATEGORY_NAME,
                 USER_JE_SOURCE_NAME,
                 SEGMENT1,
                 SEGMENT2,
                 SEGMENT3,
                 SEGMENT4,
                 SEGMENT5,
                 ENTERED_DR,
                 ENTERED_CR,
                 ACCOUNTED_DR,
                 ACCOUNTED_CR,
                 GROUP_ID)
BEGIN DATA
"NEW","1","11-AUG-2002","USD","11-AUG-2002","1318","A","Inventory","JETFORMS","01","110","7730","0000","000","555","555","555","555","11"
"NEW","1","11-AUG-2002","USD","11-AUG-2002","1318","A","Inventory","JETFORMS","01","110","7730","0000","000","555","555","555","555","11"

Run below script from Command prompt:

sqlldr apps/apps control='/apps/aptest/visappl/xxcus/11.5.0/bin/XX_GL.ctl'    log='/apps/aptest/visappl/xxcus/11.5.0/bin/XX_GL.log'



Interface Error Tables In Oracle Applications

Interface Error Tables In Oracle Applications
This table stores the processing messages which will be generated during Order Entry concurrent program execution or UI process. This is a multi-lingual table.

SELECT OPT.*
FROM OE_PROCESSING_MSGS OPM, OE_PROCESSING_MSGS_TL OPT
WHERE     OPM.TRANSACTION_ID = OPT.TRANSACTION_ID
AND OPT.LANGUAGE = 'US'
AND ORIGINAL_SYS_DOCUMENT_REF = LV_DOC_REF

PO_INTERFACE_ERRORS contains error message information generated by the open interface programs in Oracle Purchasing. For every interface transaction row with errors, this table contains a row for each column that has an error.

SELECT *
FROM PO_INTERFACE_ERRORS
WHERE INTERFACE_LINE_ID = LN_INT_TRX_ID -- interface transaction id

MTL_TRANSACTIONS_INTERFACE allows calling applications to post material transactions (movements, issues, receipts etc. to Oracle Inventory transaction module.

The Transaction Manager picks up the rows to process based on the LOCK_FLAG, TRANSACTION_MODE, PROCESS_FLAG. Only records with TRANSACTION_MODE of '3', LOCK_FLAG of '2', and PROCESS_FLAG of '1' will be picked up by the Transaction Manager and assigned to a Transaction Worker. If a record fails to process completely, then PROCESS_FLAG will be set to '3' and ERROR_CODE and ERROR_EXPLANATION will be populated with the cause for the error.

SELECT ERROR_CODE,
            ERROR_EXPLANATION
FROM MTL_TRANSACTIONS_INTERFACE
WHERE TRANSACTION_REFERENCE = LN_TRX_REF

Interface data that failed in Auto Invoice validation are populated with the error details

SELECT *
FROM RA_INTERFACE_ERRORS_ALL
WHERE INTERFACE_LINE_ID = LN_INTF_ID

The HZ_PARTY_INTERFACE_ERRORS table contains the error messages that are generated while mapping data from the HZ_PARTY_INTERFACE table into other HZ tables.

SELECT *
FROM HZ_PARTY_INTERFACE_ERRORS
WHERE PARTY_INTERFACE_ID = LN_PARTY_INTEFACE_ID

MTL_INTERFACE_ERRORS stores errors that occur during the item interface process reporting where the errors occurred along with the error messages.

SELECT *
FROM MTL_INTERFACE_ERRORS
WHERE TRANSACTION_ID = LN_TRX_ID --Row identifier for row in MTL_SYSTEM_ITEMS_INTERFACE

WIP_INTERFACE_ERRORS stores the text of errors or warnings issued when loading information through the WIP Scheduling and Open Job and Schedule interfaces. It also stores information about the load requests that generate the errors. When the WIP Mass Load program loads records from the WIP Scheduling Interface, you can print a report showing these errors.

SELECT *
FROM WIP_INTERFACE_ERRORS
WHERE INTERFACE_ID = LN_INTF_ID

AP_INTERFACE_REJECTIONS stores information about invoice data from the AP_INVOICES_INTERFACE and AP_INVOICE_LINES_INTERFACE tables which could not be processed by Payables Open Interface Import.

SELECT * FROM AP_INTERFACE_REJECTIONS


Difference between Conversion and Interface in Oracle Apps

Difference between Conversion and Interface in Oracle Apps, askhareesh blog for Oracle Apps
Interfaces:
  • It is schedule concurrent Process which will be executed multiple times
  • We will not be knowing flat file Volume
  • We need to handle all the expected exceptions
  • Error Reports and sending mail alerts, If any error occurs
  • Only in Enhancement or customization projects
Conversion:
  • One time data transfer
  • We will be know exact falt file Volume
  • No need to know the exceptions
  • Not required to upload all records
  • Only in Implementation,Migration or up-gradation projects

Oracle Apps Outbound Interface Process - part4







GOTO C/TEMP PATH WE WILL GET FILE


Part1                                         Part2                                             Part3                                     Part4

Oracle Apps Outbound Interface Process - part3

SAVE AND COLSE IT THEN GOTO BELOW NAVIGATION








Part1                                         Part2                                             Part3                                     Part4

Oracle Apps Outbound Interface Process - part2

Click on executable



CLICK ON PERAMETERS BUTTON


Part1                                         Part2                                             Part3                                     Part4

Oracle Apps Outbound Interface Process - part1

Oracle Apps Outbound Interface Process


TYPE select * from v$parameter where name like '%utl_file%'

COPY ANY PATH IN THE ABOVE QUERY RESULT FOR OUTBOUND FILE DESTINATION
WE WILL USE THIS PATH IN PROCEDURE

NOTE: ONLY ABOVE QUERY PATHS ARE SUITABLE FOR OUTBOUND FILES



CREATE OUTBOUND PROCEDURE

CREATE OR REPLACE procedure GE_INV_Out_BAL(Errbuf OUT varchar2,
                                       Retcode ouT varchar2,
            f_id    in number,
            t_id    in varchar2) as
cursor c1 is select
    msi.segment1 item,
    msi.inventory_item_id Itemid,
    msi.description  itemdesc,
    msi.primary_uom_code Uom,
    ood.organization_name name,
    ood.organization_id   id,
    mc . segment1||','||mc.segment2 Category
    from
    mtl_system_items_b           msi,
    org_organization_definitions ood,
    mtl_item_categories          mic,
    mtl_categories               mc
    where
    msi.organization_id       = ood.organization_id
    and msi.inventory_item_id = mic.inventory_item_id
    and msi.organization_id   = mic.organization_id
    and mic.category_id       = mc.category_id
    and msi.purchasing_item_flag = 'Y'
    and msi.organization_id between f_id and t_id;
x_id     utl_file.file_type;
l_count  number(5) default 0;
begin
x_id:=utl_file.fopen('c:\temp','invoutdata.txt','W');
--select * from v$parameter where name like '%utl_file%'
for x1 in c1 loop
l_count:=l_count+1;
utl_file.put_line(x_id,x1.item    ||'-'||
                       x1.itemid  ||'-'||
                       x1.itemdesc||'-'||
                       x1.uom   ||'-'||
                       x1.name   ||'-'||
                       x1.id   ||'-'||
                       x1.category   );
end loop;
utl_file.fclose(x_id);
Fnd_file.Put_line(Fnd_file.output,'No of Records transfered to the data file :'||l_count);
Fnd_File.Put_line(fnd_File.Output,' ');
Fnd_File.Put_line(fnd_File.Output,'Submitted User name  '||Fnd_Profile.Value('USERNAME'));
Fnd_File.Put_line(fnd_File.Output,' ');
Fnd_File.Put_line(fnd_File.Output,'Submitted Responsibility name '||Fnd_profile.value('RESP_NAME'));
Fnd_File.Put_line(fnd_File.Output,' ');
Fnd_File.Put_line(fnd_File.Output,'Submission Date :'|| SYSDATE);
Exception
WHEN utl_file.invalid_operation THEN
  fnd_file.put_line(fnd_File.log,'invalid operation');
  utl_file.fclose_all;
WHEN utl_file.invalid_path THEN
  fnd_file.put_line(fnd_File.log,'invalid path');
  utl_file.fclose_all;
WHEN utl_file.invalid_mode THEN
  fnd_file.put_line(fnd_File.log,'invalid mode');
  utl_file.fclose_all;
WHEN utl_file.invalid_filehandle THEN
  fnd_file.put_line(fnd_File.log,'invalid filehandle');
  utl_file.fclose_all;
WHEN utl_file.read_error THEN
  fnd_file.put_line(fnd_File.log,'read error');
  utl_file.fclose_all;
WHEN utl_file.internal_error THEN
  fnd_file.put_line(fnd_File.log,'internal error');
  utl_file.fclose_all;
WHEN OTHERS THEN
  fnd_file.put_line(fnd_File.log,'other error');
  utl_file.fclose_all;
End GE_INV_Out_BAL;

RUN ABOVE PROCEDURE SUCCESSFULLY
GOTO SYSTEM ADMINISTRATOR

Part1                                         Part2                                             Part3                                     Part4