Sei sulla pagina 1di 13

INTERFACES

GENERAL LEDGER INTERFACE (GL INTERFACE): Process Steps: 1) we have received flat file from client 2) We have created Staging table as per flat file structure 3) Developed Control file and uploaded data 4) Developed PL/SQL Program to upload the data from stage into interface table a) Declare Cursor b) open cursor c) Validate each record d) If no invalid record then insert into interface table. 5) Run the journal import from GL => Journal => Import => Run Give the two parameters a) Source b) Group ID 6) Open the Output if status is 'SUCCESS' then take Request ID. 7) Open Journal Enter screen Query the records based on the %request_id% As batch Name Select Review journal button we can see the journal detailed transaction 8) If we want correct the journals we can correct from Journal=>Import=>Correct 9) If we want delete the journals we can delete from Journal=>Import=>Delete Pre-Requisitions: ================== Before Going to develop the GL interface we are supposed to check the following functional setups has completed or not 1) 2) 3) 4) 5) Source and category Creation (Setup=>Journal=>Sources) Period are defined and Open status (Setup=>open\Close) Accounting structure should be validated Set of Books should be defined a)currency b)Calendar c)Chart of Accounts Currency Conversion Rates should be defined.

General Ledger Interface: 1) Once we get the data into the stage table we have to transfer from stage table into Interface table by using PL/SQL Program Inside this program we write 1) Cursor (to select data from stage table) 2) Validate Data 3) Insert Statement (To Insert Into Interface table.) Note: 1) If Record is valid record then we will insert into interface table other wise we will insert into Error tables. 2) Before Inserting the Data into Interface tables first we have to understand the Interface table structure and we should know what data is valid and what data is not valid for the all Mandatory columns. 2) Once the data is inserted into the Interface table. Then we will submit concurrent program to transfer the data from interface table to Base Tables. In this Interface the Interface table is GL_INTERFACE

Mandatory Columns: ================== 1) STATUS 2) ACCOUNTING_DATE 3) CURRENCY_CODE 4) CREATED_BY 5) CREATION_DATE 6) USER_JE_SOURCE_NAME 7) USER_JE_CATEGORY_NAME 8) ACTUAL_FLAG 9) ENTERED_DR 10) ENTERED_CR 11) GROUP_ID 12) PERIOD_NAME 13) SET_OF_BOOKS_ID 1) Status Column will accept any Data. but we will insert always standard string called "NEW". It means that we are bringing new data into Oracle Applications. 2) ACCOUNTING_DATE: Column will accept valid accounting date as per the accounting Periods 3) CURRENCY_CODE: from FND_CURRENCIES table we can find out whether Currency Code is valid or Not if Currency code is available in the Table and enabled it is valid. Otherwise Invalid 4) CREATED_BY: IS nothing but User ID we have to find whether User ID is valid or not By using FND_USER table we can find out whether it is valid or not. 5) CREATION_DATE: Should be valid date and date should be <= SYSDATE 6) USER_JE_SOURCE_NAME: Valid Source name by using GL_JE_SOURCES table we can find whether valid source or not. 7) USER_JE_CATEGORY_NAME: Will accept valid category name by using GL_JE_CATEGORIES table we can find out whether valid category or Not. 8) ACTUL_FLAG: This Column will accept single Character Either 'A' 'B' 'E' A=Actual Amounts B=Budget Amounts E=Encumbrance Amounts 9) ENTERED_DR 10) ENTERED_CR: Both Columns we accept Numbers Only but same number we have to insert into both the columns.Always ENTERED_CR = ENTERED_DR. Otherwise Suspense Account will be created. General Ledger Procedure: CREATE OR REPLACE PROCEDURE GE_Pro30 (Errbuf OUT VARCHAR2, Retcode OUT VARCHAR2) IS -- cursor declaration CURSOR gl_cur IS SELECT status , set_of_books_id , accounting_date ,

currency , date_created , created_by , actual_flag , category , source , curr_conversion , segment1 , segment2 , segment3 , segment4 , segment5 , entered_dr , entered_cr , accounted_dr , accounted_cr , group_id FROM XX_TEMP; l_currencycode VARCHAR2(25); l_set_of_books_id NUMBER(3); l_flag VARCHAR2(2); l_error_msg VARCHAR2(100); l_err_flag VARCHAR2(10); l_category VARCHAR2(100); L_USERID NUMBER(10); l_count NUMBER(9) default 0; BEGIN DELETE FROM gl_interface; COMMIT; FOR rec_cur IN gl_cur LOOP l_count:=l_count+1; l_flag :='A'; --Category Column Validation BEGIN SELECT USER_JE_CATEGORY_NAME INTO l_CATEGORY FROM GL_JE_CATEGORIES WHERE USER_JE_CATEGORY_NAME = REC_CUR.Category; EXCEPTION WHEN OTHERS THEN l_flag:='E'; l_error_msg:='Category does not exist '; Fnd_File.put_line (Fnd_File.LOG,'Inserting data into the Interface TABLE'||'-'|| l_count||' '||l_error_msg); END; --End Category Column Validation --User ID column validation BEGIN SELECT USER_ID INTO L_USERID FROM FND_USER

WHERE USER_ID = REC_CUR.created_by; EXCEPTION WHEN OTHERS THEN l_flag:='E'; l_error_msg:='User ID does not exist '; Fnd_File.put_line (Fnd_File.LOG,'Inserting data into the Interface l_count||' '||l_error_msg); END; --End of Created_by OR UserID column Validation --Set of books Validation BEGIN SELECT set_of_books_id INTO l_set_of_books_id FROM GL_SETS_OF_BOOKS WHERE set_of_books_id=rec_cur.set_of_books_id; EXCEPTION WHEN OTHERS THEN l_flag:='E'; l_error_msg:='set of Books ID does not exist '; Fnd_File.put_line (Fnd_File.LOG,'Inserting data into the Interface l_count||' '||l_error_msg); END; --Cuurency Code Validation BEGIN SELECT currency_code INTO l_currencycode FROM fnd_currencies WHERE currency_code=rec_cur.currency AND currency_code='USD'; EXCEPTION WHEN OTHERS THEN l_flag:='E'; l_error_msg:='currency code does not exists'; Fnd_File.put_line (Fnd_File.LOG,'Inserting data into the Interface l_count||' '||l_error_msg); END; IF l_flag!='E' THEN Fnd_File.put_line (Fnd_File.LOG,'Inserting data into the Interface INSERT INTO gl_interface(status, set_of_books_id, accounting_date, currency_code, date_created, created_by, actual_flag, user_je_category_name, user_je_source_name, user_currency_conversion_type, segment1, segment2, segment3,

TABLE'||'-'||

TABLE'||'-'||

TABLE'||'-'||

TABLE');

segment4, segment5, entered_dr, entered_cr, accounted_dr, accounted_cr, group_id) VALUES (rec_cur.status , rec_cur.set_of_books_id , rec_cur.accounting_date , rec_cur.currency , rec_cur.date_created , rec_cur.created_by , rec_cur.actual_flag , rec_cur.category , rec_cur.source , rec_cur.curr_conversion , rec_cur.segment1 , rec_cur.segment2 , rec_cur.segment3 , rec_cur.segment4 , rec_cur.segment5 , rec_cur.entered_dr , rec_cur.entered_cr , rec_cur.accounted_dr , rec_cur.accounted_cr , rec_cur.group_id); END IF; l_flag:=NULL; l_error_msg:=NULL; END LOOP; COMMIT; END GE_Pro30; / PURCHASE ORDER INTERFACE: Process Steps: 1) Create the Staging tables 2) Develop the Control files and register as concurrent program 3) Develop the PL/SQL Program and write the validations and insert into interface table 4) Run the standard program called Import Standard Purchase orders from PO Responsibility Parameter: Default Buyer: Null Create or update items: No PO Status: APPROVED Batch ID: 13 (We can get from headers interface table) 5) Take the Request ID execute following query we can get the PO numbers select segment1 po_number from po_headers_all

where request _id = 145233; 6) Go to the PO Application and Query the PO from as per the PO number. Pre - Requisitions: ==================== 1) Distributions Accounts should be done. 2) Supplier, Site, Contact information should be entered 3) Locations Data should be entered 4) Currency, Organization, Terms and Conditions data should be entered. Purchase Order Interface: 1) PO_HEADERS_INTERFACE COLUMNS =================================== 1) DOCUMENT_TYPE_CODE = This column will accept any of the following string. STANDARD BLANKET PLANNED CONTRACT 2) VENDOR_NAME =It will accept valid vendor name. Using PO_VENDORS Table we can find out whether vendor name is valid or not. 4) VENDOR_SITE_NAME = PO_VENDOR_SITES_ALL 5) VENDOR_CONTACT_NAME = PO_VENDOR_CONTACTS 6) SHIPTO = HR_LOCATIONS table will be use to find the location is valid or not. 7) BILLTO = HR_LOCATIONS table will be use to find the location is valid or not. 8) CREATION_DATE = It should be in the Date Format. And also <=SYSDATE 9) AGENT_ID = it should be valid agent ID (Buyer ID) .By using PO_AGENTS table we can find out whether agent_id is valid or not. 10) ORG_ID = It should be Valid Org ID. By using hr_operating_units table we can find whether it is valid or not. 11) AUTHORIZATION_STATUS = Valid status either APPROVED, INCOMPLETE, CANCELLED 12) CURRENCY_CODE = Valid Currency Code from FND_CURRENCIES table we can find whether valid currency code or not. PO_LINES_INTERFACE COLUMNS: ================================ LINE_NUM = Will accept only unique values. LINE_TYPE = should be a Valid Line type. By using PO_LINE_TYPES we can find out whether it is valid or not. ITEM =It should be a valid Item by using MTL_SYSTEM_ITEMS_B table we can find whether valid Item or not. Item Desc = Item Desc also should be valid description UOM_Code = should be valid UOM by using MTL_UNITS_OF_MEASURES table we can find whether it is valid or not. QUANTITY =Will accept any Positive Number unit_Price = Will accept any Positive Number

NEED_BY_DATE = date Format and >= PO creation Date (from PO Headers Interface table) PROMISED_DATE = date Format and >= PO creation Date (from PO Headers Interface table) ORG_ID = It should be Valid Org ID. By using hr_operating_units table we can find whether it is valid or not. SHIP_TO_ORG =Valid ORG_ID ShipTo_Loc = Valid Shipping Location Purchase Order Procedure: CREATE OR REPLACE PROCEDURE PO_Int12 (Errbuf OUT VARCHAR2, Retcode OUT VARCHAR2) AS CURSOR c1 IS SELECT * FROM XX_TEMP_HEADERS; CURSOR c2 IS SELECT * FROM XX_TEMP_LINES; l_vendor_id number (10); l_item varchar2 (150); l_flag varchar2 (4) default 'A'; l_msg varchar2 (200); l_site_code varchar2 (100); l_curr_code varchar2 (10); l_org_id number (6); BEGIN DELETE FROM PO_HEADERS_INTERFACE; DELETE FROM PO_LINES_INTERFACE; COMMIT; FOR x1 IN c1 LOOP BEGIN SELECT vendor_id INTO l_vendor_id FROM po_vendors WHERE vendor_name = x1.VENDOR_NAME; EXCEPTION WHEN OTHERS THEN l_flag := 'E'; l_msg := 'Vendor id is Not in SYSTEM'; Fnd_FIle.Put_line(Fnd_File.Log,'Error Occured'||l_msg); END; --Vendor Site code Validation begin select vendor_site_code into l_site_code from po_vendor_sites_all where vendor_site_code = x1.vendor_site_code; EXCEPTION WHEN OTHERS THEN l_flag := 'E'; l_msg := 'Vendor Site Code is Not in SYSTEM'; Fnd_FIle.Put_line(Fnd_File.log,'Error Occured'||l_msg); END; --End of Site Code Validation

--Currency Code Validation Begin select currency_code into l_curr_code from fnd_currencies where currency_code = x1.CURRENCY_CODE; EXCEPTION WHEN OTHERS THEN l_flag := 'E'; l_msg := 'Currency Code is Invalid'; Fnd_FIle.Put_line(Fnd_File.Log,'Error Occured'||l_msg); END; --End of te Currency Validation --Operating Unit ID Validation Begin select organization_id into l_org_id from hr_operating_units where organization_id = x1.org_id; EXCEPTION WHEN OTHERS THEN l_flag := 'E'; l_msg := 'Invalid Organization ID'; Fnd_FIle.Put_line(Fnd_File.Log,'Error Occured'||l_msg); END; --End of the ORG ID Validation IF l_flag != 'E' THEN INSERT INTO po_headers_interface ( INTERFACE_HEADER_ID ,BATCH_ID ,ACTION ,ORG_ID ,DOCUMENT_TYPE_CODE ,CURRENCY_CODE ,AGENT_NAME ,VENDOR_NAME ,VENDOR_SITE_CODE ,SHIP_TO_LOCATION ,BILL_TO_LOCATION ,creation_date ,APPROVAL_STATUS ,APPROVED_DATE ,FREIGHT_TERMS ) VALUES ( x1.INTERFACE_HEADER_ID ,x1.batch_id ,x1.action

,x1.org_id ,x1.document_type_code ,x1.CURRENCY_CODE ,x1.AGENT_NAME ,x1.VENDOR_NAME ,x1.VENDOR_SITE_CODE ,x1.SHIP_TO_LOCATION ,x1.BILL_TO_LOCATION ,SYSDATE ,x1.APPROVAL_STATUS ,SYSDATE ,x1.FREIGHT_TERMS ); end if; END LOOP; FOR x2 IN c2 LOOP l_flag := 'A'; --Item Validation begin select segment1 into l_item from mtl_system_items_b where segment1 = x2.item AND ORGANIZATION_ID = fnd_profile.value('ORG_ID'); exception when others then l_flag := 'E'; l_msg := 'Item is not valid Item'; Fnd_FIle.Put_line(Fnd_File.Log,'Error Occured'||l_msg); END; --End of the Item Validation if l_flag != 'E' then INSERT INTO PO_LINES_INTERFACE ( INTERFACE_LINE_ID ,INTERFACE_HEADER_ID ,LINE_NUM ,SHIPMENT_NUM ,LINE_TYPE ,ITEM ,ITEM_DESCRIPTION ,item_id ,UOM_CODE ,QUANTITY ,UNIT_PRICE ,SHIP_TO_ORGANIZATION_CODE ,SHIP_TO_LOCATION ,NEED_BY_DATE ,PROMISED_DATE ,list_price_per_unit

) VALUES ( x2.INTERFACE_LINE_ID ,x2.INTERFACE_HEADER_ID ,x2.LINE_NUM ,x2.SHIPMENT_NUM ,x2.LINE_TYPE ,x2.ITEM ,x2.ITEM_DESCRIPTION ,x2.item_id ,x2.UOM_CODE ,x2.QUANTITY, X2.UNIT_PRICE, X2.SHIP_TO_ORGANIZATION_CODE, X2.SHIP_TO_LOCATION, sysdate, sysdate, X2.LIST_PRICE_PER_UNIT); END IF; END LOOP; COMMIT; END PO_INT12; / OUT BOUND INTERFACE: Out Bound Interface Code: CREATE OR REPLACE procedure RAMANA_INV_Out1(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('d:\oracle\proddb\8.1.7\plsql\temp','invoutdata.dat','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 RAMANA_INV_Out1;

XML Publisher

Steps: 1) Develop the Report (.rdf) Only Data Model 2) Save the report and Compile and Generate the data in .xml Format File=>Generate to File => XML 3) Open the Ms-Word document Design the Layout include the following Tool Bar options called Form and Template builder 4) Define the Table and Specify the Titles and Labels whatever we would like to print 5) Include 'Text Form Field' Double Click => Add Help Text button enter the following syntax: Here G_USER_ID is Group name from .rdf Data Model Note: It means Indirectly Repeating Frame starting 6)Define the Fields which we would like to display Include 'Text Form Field' Double Click => Add Help Text button enter the following syntax ? Note: Define all the fields like this 7) we have to close the Repeating Frame (For each Loop) Include 'Text Form Field' Double Click => Add Help Text button enter the following syntax 8) Save the document in .rtf (Rich Text File format) 9) Load the .xml file data and generate the Output in pdf Format Data=>Load XML Data=>Load the .xml File=>Once Data is Loaded successfully 10) Generate the Preview as per this Preview=>PDF XML Steps 1) Develop the .rdf file and .rtf file 2) Register both .rdf and .rtf file RDF File registration: ========================= 1) Move the .rdf file into CUS_TOP\11.5.0\Reports\US 2) Create Executable Concurrent Program Output = XML Request Group Responsibility User SRS 3) Copy the Concurrent Program Short name .rtf File Registration: ======================= 1) Go to the XML Publisher Administrator Responsibility 2) Select Data Definitions form Enter the following Data Definition Name = Enter Any Name Code = Concurrent Program Short Name Application = any application Start date = Current Date 3) Copy the Data Definition name we have to add this to the Template 4) Open the Template Form Enter the following Template Name: Any Name Data Definition: enter data definition whatever we have created Code: Concurrent Program Short Name Type: rtf Application: any Application File: Upload the .rtf file Language: English Territory: United States 5) Select Apply button After register the .rtf file submit concurrent Program from SRS window system will

automatically pick the .rtf file and generates the Output. If we want to customize the .rtf file we have to download by using template, Customize then upload the .rtf template

Potrebbero piacerti anche