Tai lieu vo cung hay ve Oracle EBS Custom ADI, WEB ADI, Oracle, Interface, ORacle ADI, Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,Oracle,
Oracle Custom WEB ADI for AP Invoice Interface Requirement: Web ADI interface needed to be developed to import Invoices, Layout to be designed Solution: Following steps to be followed Create integrator Create Layout Create Mappings Create Document Defining the Form Function for Integrator Raju Ch Oracle Custom WEB ADI for AP Invoice Interface Compile the below Custom table and Package in APPS schema > ==================================================================== DROP TABLE XXAA_APINV_IFACE_TBL; CREATE TABLE XXAA_APINV_IFACE_TBL ( SOURCE VARCHAR2(50), ORGANIZATION VARCHAR2(40), INVOICE_TYPE VARCHAR2(40), SUPPLIER_NAME VARCHAR2(60), SUPPLIER_NUM VARCHAR2(60), SUPPLIER_SITE VARCHAR2(40), INVOICE_DATE DATE, INVOICE_NUMBER VARCHAR2(60), INVOICE_AMOUNT NUMBER(10,2), TERMS VARCHAR2(60), INVOICE_CURRENCY VARCHAR2(25), GL_DATE DATE, PAYMENT_CURRENCY VARCHAR2(25), PAYMENT_METHOD VARCHAR2(40), LINE_NUM NUMBER, LINE_TYPE VARCHAR2(25), LINE_AMOUNT NUMBER(10,2), SEGMENT1 VARCHAR2(25), SEGMENT2 VARCHAR2(25), SEGMENT3 VARCHAR2(25), SEGMENT4 VARCHAR2(25), SEGMENT5 VARCHAR2(25), LINE_DESCRIPTION VARCHAR2(100), ORG_ID NUMBER, VENDOR_ID NUMBER, VENDOR_SITE_ID NUMBER, TERM_ID NUMBER, CODE_COMBINATION_ID NUMBER, last_update_date DATE, last_updated_by NUMBER, creation_date DATE, created_by NUMBER, last_update_login NUMBER , status VARCHAR2(50), error_code VARCHAR2(15), error_message VARCHAR2(3000) ); > ==================================================================== CREATE OR REPLACE PACKAGE XXAA_APINV_IFACE_PKG IS PROCEDURE XXAA_APINV_IFACE_LOAD_PRC ( P_SOURCE VARCHAR2 ,P_ORGANIZATION VARCHAR2 ,P_INVOICE_TYPE VARCHAR2 ,P_SUPPLIER_NAME VARCHAR2 ,P_SUPPLIER_NUM VARCHAR2 ,P_SUPPLIER_SITE VARCHAR2 ,P_INVOICE_DATE DATE ,P_INVOICE_NUMBER VARCHAR2 ,P_INVOICE_AMOUNT NUMBER ,P_TERMS VARCHAR2 Raju Ch Oracle Custom WEB ADI for AP Invoice Interface ,P_INVOICE_CURRENCY ,P_GL_DATE ,P_PAYMENT_CURRENCY ,P_PAYMENT_METHOD ,P_LINE_NUM ,P_LINE_TYPE ,P_LINE_AMOUNT ,P_LINE_DESCRIPTION ,P_SEGMENT1 ,P_SEGMENT2 ,P_SEGMENT3 ,P_SEGMENT4 ,P_SEGMENT5 VARCHAR2 DATE VARCHAR2 VARCHAR2 NUMBER VARCHAR2 NUMBER VARCHAR2 VARCHAR2 VARCHAR2 VARCHAR2 VARCHAR2 VARCHAR2 ); PROCEDURE XXAA_APINV_IFACE_IMPORT_PRC; END XXAA_APINV_IFACE_PKG; / > ==================================================================== CREATE OR REPLACE PACKAGE XXAA_APINV_IFACE_PKG IS PROCEDURE XXAA_APINV_IFACE_LOAD_PRC ( P_SOURCE VARCHAR2 ,P_ORGANIZATION VARCHAR2 ,P_INVOICE_TYPE VARCHAR2 ,P_SUPPLIER_NAME VARCHAR2 ,P_SUPPLIER_NUM VARCHAR2 ,P_SUPPLIER_SITE VARCHAR2 ,P_INVOICE_DATE DATE ,P_INVOICE_NUMBER VARCHAR2 ,P_INVOICE_AMOUNT NUMBER ,P_TERMS VARCHAR2 ,P_INVOICE_CURRENCY VARCHAR2 ,P_GL_DATE DATE ,P_PAYMENT_CURRENCY VARCHAR2 ,P_PAYMENT_METHOD VARCHAR2 ,P_LINE_NUM NUMBER ,P_LINE_TYPE VARCHAR2 ,P_LINE_AMOUNT NUMBER ,P_LINE_DESCRIPTION VARCHAR2 ,P_SEGMENT1 VARCHAR2 ,P_SEGMENT2 VARCHAR2 ,P_SEGMENT3 VARCHAR2 ,P_SEGMENT4 VARCHAR2 ,P_SEGMENT5 VARCHAR2 ); PROCEDURE XXAA_APINV_IFACE_IMPORT_PRC; END XXAA_APINV_IFACE_PKG; / > ==================================================================== CREATE OR REPLACE PACKAGE body XXAA_APINV_IFACE_PKG IS PROCEDURE XXAA_APINV_IFACE_LOAD_PRC ( P_SOURCE VARCHAR2 Raju Ch Oracle Custom WEB ADI for AP Invoice Interface ,P_ORGANIZATION ,P_INVOICE_TYPE ,P_SUPPLIER_NAME ,P_SUPPLIER_NUM ,P_SUPPLIER_SITE ,P_INVOICE_DATE ,P_INVOICE_NUMBER ,P_INVOICE_AMOUNT ,P_TERMS ,P_INVOICE_CURRENCY ,P_GL_DATE ,P_PAYMENT_CURRENCY ,P_PAYMENT_METHOD ,P_LINE_NUM ,P_LINE_TYPE ,P_LINE_AMOUNT ,P_LINE_DESCRIPTION ,P_SEGMENT1 ,P_SEGMENT2 ,P_SEGMENT3 ,P_SEGMENT4 ,P_SEGMENT5 Raju Ch VARCHAR2 VARCHAR2 VARCHAR2 VARCHAR2 VARCHAR2 DATE VARCHAR2 NUMBER VARCHAR2 VARCHAR2 DATE VARCHAR2 VARCHAR2 NUMBER VARCHAR2 NUMBER VARCHAR2 VARCHAR2 VARCHAR2 VARCHAR2 VARCHAR2 VARCHAR2 ) IS l_error_message l_error_code l_org_id l_invoice_num l_vendor_id l_vendor_site_id l_term_id l_code_combination_id VARCHAR2(3000); VARCHAR2(2); NUMBER; VARCHAR2(60); NUMBER; NUMBER; NUMBER; NUMBER; BEGIN l_error_message := ''; l_error_code :='V'; >Organization Validation BEGIN l_org_id := NULL; SELECT organization_id INTO l_org_id FROM hr_organization_units hou WHERE hou.name=P_ORGANIZATION; EXCEPTION WHEN no_data_found THEN l_error_message :=l_error_message||','||'Organization not defined '; l_error_code :='E'; WHEN too_many_rows THEN l_error_message :=l_error_message||','||'Too Many Records for Organization '; l_error_code :='E'; WHEN OTHERS THEN l_error_message :=l_error_message||','||'Other Errors with Organization '||SQLCODE ||sqlerrm; l_error_code :='E'; END; >Invoice Number Validation BEGIN Oracle Custom WEB ADI for AP Invoice Interface Raju Ch l_invoice_num := NULL; SELECT COUNT (api.invoice_num) INTO l_invoice_num FROM ap_invoices_all api WHERE UPPER(api.invoice_num) = UPPER(P_INVOICE_NUMBER); IF l_invoice_num > THEN l_error_message :=l_error_message||','||'Invoice number already exist in oracle '; l_error_code END IF; :='E'; EXCEPTION WHEN no_data_found THEN l_error_message :=l_error_message||','||'Error in validating the invoice number '; l_error_code :='E'; WHEN OTHERS THEN l_error_message :=l_error_message||','||'Other Errors with invoice number '||SQLCODE ||sqlerrm; l_error_code :='E'; END; >Supplier Validation BEGIN l_vendor_id := NULL; SELECT vendor_id INTO l_vendor_id FROM ap_suppliers aps WHERE (UPPER(aps.vendor_name) = UPPER(P_SUPPLIER_NAME) OR UPPER(aps.segment1) = UPPER(P_SUPPLIER_NUM)); EXCEPTION WHEN no_data_found THEN l_error_message :=l_error_message||','||'Supplier not defined '; l_error_code :='E'; WHEN too_many_rows THEN l_error_message :=l_error_message||','||'Too Many Records for Supplier '; l_error_code :='E'; WHEN OTHERS THEN l_error_message :=l_error_message||','||'Other Errors with Supplier '||SQLCODE ||sqlerrm; l_error_code :='E'; END; >Supplier Site Validation BEGIN l_vendor_site_id := NULL; SELECT vendor_site_id INTO l_vendor_site_id FROM ap_supplier_sites_all ass WHERE ass.vendor_id = l_vendor_id AND ass.org_id = l_org_id AND UPPER(ass.vendor_site_code) = UPPER(P_SUPPLIER_SITE); EXCEPTION WHEN no_data_found THEN l_error_message :=l_error_message||','||'Supplier Site not defined '; l_error_code :='E'; WHEN too_many_rows THEN l_error_message :=l_error_message||','||'Too Many Records for Supplier Site '; l_error_code :='E'; Oracle Custom WEB ADI for AP Invoice Interface Raju Ch WHEN OTHERS THEN l_error_message :=l_error_message||','||'Other Errors with Supplier Site '||SQLCODE ||sqlerrm; l_error_code :='E'; END; >Terms Validation BEGIN l_term_id := NULL; SELECT term_id INTO l_term_id FROM ap_terms apt WHERE UPPER(apt.name) = UPPER(P_TERMS); EXCEPTION WHEN no_data_found THEN l_error_message :=l_error_message||','||'Terms not defined '; l_error_code :='E'; WHEN too_many_rows THEN l_error_message :=l_error_message||','||'Too Many Records for Terms '; l_error_code :='E'; WHEN OTHERS THEN l_error_message :=l_error_message||','||'Other Errors with Terms '||SQLCODE ||sqlerrm; l_error_code :='E'; END; >Account segment Validation BEGIN SELECT code_combination_id INTO l_code_combination_id FROM gl_code_combinations WHERE segment1= P_SEGMENT1 AND segment2 = P_SEGMENT2 AND segment3 = P_SEGMENT3 AND segment4 = P_SEGMENT4 AND segment5 = P_SEGMENT5; EXCEPTION WHEN no_data_found THEN l_error_message :=l_error_message||','||'Invalid Flex field combination '; l_error_code :='E'; WHEN too_many_rows THEN l_error_message :=l_error_message||','||'Too Many Records for Flex field combination '; l_error_code :='E'; WHEN OTHERS THEN l_error_message :=l_error_message||','||'Other Errors with Flex field combination '||SQLCODE ||sqlerrm; l_error_code :='E'; END; >Insert the data into the staging table INSERT INTO XXAA_APINV_IFACE_TBL ( SOURCE ,ORGANIZATION ,INVOICE_TYPE ,SUPPLIER_NAME ,SUPPLIER_NUM ,SUPPLIER_SITE ,INVOICE_DATE ,INVOICE_NUMBER Oracle Custom WEB ADI for AP Invoice Interface ,INVOICE_AMOUNT ,TERMS ,INVOICE_CURRENCY ,GL_DATE ,PAYMENT_CURRENCY ,PAYMENT_METHOD ,LINE_NUM ,LINE_TYPE ,LINE_AMOUNT ,LINE_DESCRIPTION ,SEGMENT1 ,SEGMENT2 ,SEGMENT3 ,SEGMENT4 ,SEGMENT5 ,ORG_ID ,VENDOR_ID ,VENDOR_SITE_ID ,TERM_ID ,CODE_COMBINATION_ID ,last_update_date ,last_updated_by ,creation_date ,created_by ,last_update_login ,status ,error_code ,error_message ) VALUES (UPPER(P_SOURCE) ,P_ORGANIZATION ,UPPER(P_INVOICE_TYPE) ,P_SUPPLIER_NAME ,P_SUPPLIER_NUM ,P_SUPPLIER_SITE ,P_INVOICE_DATE ,P_INVOICE_NUMBER ,P_INVOICE_AMOUNT ,P_TERMS ,P_INVOICE_CURRENCY ,P_GL_DATE ,P_PAYMENT_CURRENCY ,P_PAYMENT_METHOD ,P_LINE_NUM ,P_LINE_TYPE ,P_LINE_AMOUNT ,P_LINE_DESCRIPTION ,P_SEGMENT1 ,P_SEGMENT2 ,P_SEGMENT3 ,P_SEGMENT4 ,P_SEGMENT5 ,L_ORG_ID ,L_VENDOR_ID ,L_VENDOR_SITE_ID ,L_TERM_ID ,L_CODE_COMBINATION_ID ,sysdate Raju Ch Oracle Custom WEB ADI for AP Invoice Interface ,fnd_global.user_id ,sysdate ,fnd_global.user_id ,fnd_global.login_id ,'NEW' ,l_error_code ,SUBSTR(l_error_message,2) ); IF (l_error_code='E') THEN raise_application_error(-20101,SUBSTR(l_error_message,2)); END IF; EXCEPTION WHEN OTHERS THEN raise_application_error(-20102,'Error -'||SQLCODE||'-'||sqlerrm); END XXAA_APINV_IFACE_LOAD_PRC; > -PROCEDURE XXAA_APINV_IFACE_IMPORT_PRC IS CURSOR c_inv IS SELECT DISTINCT api.source, api.org_id, api.invoice_type, api.vendor_id, api.vendor_site_id, api.invoice_date, api.invoice_number, api.invoice_amount, api.term_id, api.invoice_currency, api.gl_date, api.payment_currency, api.payment_method FROM XXAA_APINV_IFACE_TBL api WHERE api.error_code='V' ORDER BY api.org_id, api.invoice_type, api.vendor_id, api.vendor_site_id, api.invoice_number; CURSOR c_lin(X_INVOICE_NUMBER VARCHAR2) IS SELECT apl.line_num, apl.line_type, apl.line_amount, apl.code_combination_id, apl.line_description FROM XXAA_APINV_IFACE_TBL apl WHERE apl.error_code='V' AND apl.invoice_number = X_INVOICE_NUMBER Raju Ch Oracle Custom WEB ADI for AP Invoice Interface ORDER BY apl.line_num; l_batch_name l_conc_request_id l_phase l_status l_dev_phase l_dev_status l_message l_request_status l_count l_inv_seq VARCHAR2(100) := TO_CHAR(SYSDATE,'DD-MON-RR:HH24MISS'); NUMBER; VARCHAR2(25); VARCHAR2(25); VARCHAR2(25); VARCHAR2(25); VARCHAR2(500); BOOLEAN; NUMBER; NUMBER; BEGIN BEGIN FOR r_inv IN c_inv LOOP select ap_invoices_interface_s.NEXTVAL into l_inv_seq from dual; INSERT INTO AP_INVOICES_INTERFACE ( invoice_id, source, org_id , invoice_type_lookup_code, vendor_id, vendor_site_id, invoice_date, invoice_num, invoice_amount, terms_id, invoice_currency_code, gl_date, payment_currency_code, payment_method_lookup_code ) VALUES ( l_inv_seq, r_inv.source, r_inv.org_id, r_inv.invoice_type, r_inv.vendor_id, r_inv.vendor_site_id, r_inv.invoice_date, r_inv.invoice_number, r_inv.invoice_amount, r_inv.term_id, r_inv.invoice_currency, r_inv.gl_date, r_inv.payment_currency, r_inv.payment_method ); FOR r_lin IN c_lin(r_inv.invoice_number) LOOP Raju Ch Raju Ch Oracle Custom WEB ADI for AP Invoice Interface INSERT INTO AP_INVOICE_LINES_INTERFACE ( invoice_id, invoice_line_id, line_number, line_type_lookup_code, amount, dist_code_combination_id, description ) VALUES ( l_inv_seq, ap_invoice_lines_interface_s.NEXTVAL, r_lin.line_num, r_lin.line_type, r_lin.line_amount, r_lin.code_combination_id, r_lin.line_description ); END LOOP; END LOOP; COMMIT; END; l_conc_request_id := FND_REQUEST.SUBMIT_REQUEST ( APPLICATION ,PROGRAM ,ARGUMENT1 ,ARGUMENT2 ,ARGUMENT4 ); => => => => => 'SQLAP' 'APXIIMPT' '204' 'MANUAL INVOICE ENTRY' l_batch_name COMMIT; l_request_status := FND_CONCURRENT.WAIT_FOR_REQUEST ( l_conc_request_id, 60, 0, l_phase, l_status, l_dev_phase, l_dev_status, l_message ); COMMIT; EXCEPTION WHEN OTHERS THEN raise_application_error(-20103,'Error -'||SQLCODE||'-'||sqlerrm); END XXAA_APINV_IFACE_IMPORT_PRC; END XXAA_APINV_IFACE_PKG; / > ==================================================================== Oracle Custom WEB ADI for AP Invoice Interface Raju Ch Add default value as ‘USD’ to currency code item Navigation: Go to integrator-> Interface-> select the default type and default value for currency code attribute Do the changes for all required fields Oracle Custom WEB ADI for AP Invoice Interface Raju Ch Oracle Custom WEB ADI for AP Invoice Interface Result Raju Ch Oracle Custom WEB ADI for AP Invoice Interface Defining the Form Function for Integrator Define the form function for integrator to run the custom ADI document from any responsibility Define the custom Form Function Navigation -> Application Developer -> Application -> Function Function User Function Name : XXAA_APINV_IFACE_FF : XXAA APINV Interface Integrator Raju Ch Oracle Custom WEB ADI for AP Invoice Interface Raju Ch Properties Type - SSWA servlet function Form Parameters bne:page=BneCreateDoc&bne:viewer=BNE:EXCEL2007&bne:reporting=N&bne:integrator=USER_NAME:XXA A APINV Interface Integrator&bne:noreview=Yes Oracle Custom WEB ADI for AP Invoice Interface Web HTML HTML Call : BneApplicationService Save it Assign Function to Custom Menu Go and add the function into the custom responsibility Navigation-> Application Developer -> Application -> Menu Raju Ch Raju Ch Oracle Custom WEB ADI for AP Invoice Interface \ Search for your menu where you want to add this ADI Menu : AP_NAVIGATE_GUI12 Prompt : XXAA APINV Interface Integrator Function : XXAA APINV Interface Integrator Oracle Custom WEB ADI for AP Invoice Interface Now you can navigate to your custom responsibility to see the ADI which you have assigned Raju Ch Raju Ch Oracle Custom WEB ADI for AP Invoice Interface Test the sheet Once you create document, it will populate the file data on the sheet Fill the required information Source OU Name MANUAL INVOICE ENTRY Vision Opera tions MANUAL INVOICE ENTRY Vision Opera tions MANUAL INVOICE ENTRY Vision Opera tions Inv Typ e STA ND AR D STA ND AR D STA ND AR D Supp Nam e Dell Com puter s Dell Com puter s Dell Com puter s Sup p Nu m Su pp Sit e 509 DE LL 509 DE LL 509 DE LL Inv Date 15NO V2015 15NO V2015 15NO V2015 Inv Num 15NOV2015_0 01 15NOV2015_0 01 15NOV2015_0 01 In v A mt 9.9 9.9 9.9 Ter ms Im me diat e Im me diat e Im me diat e In v Cu rr US D US D US D GL Date 15MA R2015 15MA R2015 15MA R2015 Pa y Cu rr Pay Met hod US D CH ECK US D CH ECK US D CH ECK Lin e Nu m Lin e Ty pe Lin e A mt Line Descripti on ITE M 4.4 15-NOV2015_001 Line_01 ITE M 3.3 15-NOV2015_001 Line_02 ITE M 2.2 15-NOV2015_001 Line_03 C o m p A c c t 01 1 01 1 01 1 D e p t 0 0 0 Upload the data into oracle Navigation: Add-Ins Tab-> Oracle-> Upload Once we click on upload button, it will pop up the upload page where we have to select ‘Automatically Submit Import’ check box as we have added import procedure in importer rule If it is checked then only it will call that import program, otherwise it wont O u lt 0 0 0 0 0 0 P r o d 0 0 0 0 Oracle Custom WEB ADI for AP Invoice Interface Raju Ch If there is any error, then program will return error message and will rollback the transaction After correcting the data, run again And if there is no error, then program will insert all validated data into oracle tables and call the import journal program Click on Upload button Oracle Custom WEB ADI for AP Invoice Interface Wait until Import program completed We can monitor the import program from spread sheet itself by clicking on monitor button Click on the Monitor to check the request id Nav : Add-Ins Oracle Monitor Raju Ch Oracle Custom WEB ADI for AP Invoice Interface Verify the concurrent request id from application Raju Ch Oracle Custom WEB ADI for AP Invoice Interface Click on View Output button Raju Ch Oracle Custom WEB ADI for AP Invoice Interface Search with Invoice number from payables responsibility Raju Ch Oracle Custom WEB ADI for AP Invoice Interface Check the from the backend tables Raju Ch ... as Web ADI: Download "Text File" Parameters Raju Ch Oracle Custom WEB ADI for AP Invoice Interface Create Uploader Raju Ch Oracle Custom WEB ADI for AP Invoice Interface Raju Ch Oracle Custom WEB. .. XXAA_APINV_IFACE_IMPORT_PRC API Returns : FND Message Code Click on apply and then submit button Raju Ch Oracle Custom WEB ADI for AP Invoice Interface Raju Ch Oracle Custom WEB ADI for AP Invoice Interface Raju Ch Oracle. .. the Interface and Click on Next button Raju Ch Oracle Custom WEB ADI for AP Invoice Interface Create Content Content Name : XXAA APINV Interface Content Raju Ch Oracle Custom WEB ADI for AP Invoice