CREATE OR REPLACE PROCEDURE SUPPLIER_CONV_INTF_LOAD(ERRBUF OUT VARCHAR2,RETCODE OUT VARCHAR2) AS CURSOR C1 IS SELECT * FROM ACP_SUP_CON_STAGE; L_VENDOR_NAME

PO_VENDORS.VENDOR_NAME%TYPE; L_ENABLED_FLAG FND_LOOKUP_VALUES.ENABLED_FLAG%TYPE; L_VENDOR_TYPE_LOOKUP_CODE FND_LOOKUP_VALUES.LOOKUP_TYPE%TYPE; L_FREIGHT_TERMS_LOOKUP_CODE FND_LOOKUP_VALUES.LOOKUP_CODE%TYPE; L_FOB_LOOKUP_CODE FND_LOOKUP_VALUES.LOOKUP_CODE%TYPE; L_SHIP_TO_LOCATION_CODE HR_LOCATIONS_ALL.LOCATION_CODE%TYPE; L_INVOICE_CURRENCY_CODE FND_CURRENCIES.CURRENCY_CODE%TYPE; L_TERMS_ID AP_TERMS.TERM_ID%TYPE; L_SET_OF_BOOKS_ID GL_SETS_OF_BOOKS.SET_OF_BOOKS_ID%TYPE; L_TERMS_DATE_BASIS FND_LOOKUP_VALUES.LOOKUP_CODE%TYPE; BEGIN DELETE FROM AP_SUPPLIERS_INT; DELETE FROM AP_SUPPLIER_SITES_INT; DELETE FROM AP_SUP_SITE_CONTACT_INT; COMMIT; FOR I IN C1 LOOP --VENDOR_NAME VALIDATION BEGIN SELECT VENDOR_NAME INTO L_VENDOR_NAME FROM PO_VENDORS WHERE VENDOR_NAME=I.VENDOR_NAME; EXCEPTION WHEN OTHERS THEN L_VENDOR_NAME:='SHARATH'; END; --ENABLED_FLAG VALIDATION BEGIN SELECT ENABLED_FLAG INTO L_ENABLED_FLAG FROM FND_LOOKUP_VALUES WHERE LOOKUP_TYPE='YES/NO'; EXCEPTION WHEN OTHERS THEN L_ENABLED_FLAG:='N'; END; -- FREIGHT_TERMS_LOOKUP_CODE VALIDATION BEGIN SELECT LOOKUP_CODE INTO L_FREIGHT_TERMS_LOOKUP_CODE FROM FND_LOOKUP_VALUES WHERE LOOKUP_CODE=I.FREIGHT_TERMS_LOOKUP_CODE; EXCEPTION WHEN OTHERS THEN L_FREIGHT_TERMS_LOOKUP_CODE:=NULL; END;

--INVOICE_CURRENCY_CODE BEGIN SELECT CURRENCY_CODE INTO L_INVOICE_CURRENCY_CODE FROM FND_CURRENCIES WHERE CURRENCY_CODE=I.'MESSAGE:CHECK THE LOOKUP_TYPE IN ND_LOOKUP_VALU ES TABLE'). EXCEPTION WHEN OTHERS THEN FND_FILE.INVOICE_CURRENCY_CODE.SHIP_TO_LOCATION_ID. --FOB_LOOKUP_CODE VALIDATION BEGIN SELECT LOOKUP_CODE INTO L_FOB_LOOKUP_CODE FROM FND_LOOKUP_VALUES WHERE LOOKUP_CODE= I.LOG.--TERMS_DATE_BASIS VALIDATION BEGIN SELECT LOOKUP_CODE INTO L_TERMS_DATE_BASIS FROM FND_LOOKUP_VALUES WHERE LOOKUP_CODE=I.PUT_LINE (FND_FILE. END. EXCEPTION WHEN OTHERS THEN L_TERMS_DATE_BASIS:=NULL.VENDOR_TYPE_LOOKUP_CODE.PUT_LINE (FND_FILE. END.TERMS_DATE_BASIS.'MESSAGE:CHECK THE CURRENCY_CODE IN FND_CURRENCI . END.LOG. END. EXCEPTION WHEN OTHERS THEN L_FOB_LOOKUP_CODE:=NULL. EXCEPTION WHEN OTHERS THEN L_SHIP_TO_LOCATION_CODE:=18188. EXCEPTION WHEN OTHERS THEN FND_FILE. --SHIP TO LOCATION CODE VALIDATION BEGIN SELECT LOCATION_CODE INTO L_SHIP_TO_LOCATION_CODE FROM HR_LOCATIONS_ALL WHERE LOCATION_CODE=I.FOB_LOOKUP_CODE. --VENDOR_TYPE_LOOKUP_CODE VALIDATION BEGIN SELECT DISTINCT LOOKUP_CODE INTO L_VENDOR_TYPE_LOOKUP_CODE FROM FND_LOOKUP_VALUES WHERE LOOKUP_CODE = I.

PAYMENT_METHOD_LOOKUP_CODE . STATUS) VALUES (AP_SUPPLIERS_INT_S. . VENDOR_NAME. PAY_DATE_BASIS_LOOKUP_CODE.TERMS_ID.SUMMARY_FLAG.LOG. BILL_TO_LOCATION_ID. INSERT INTO AP_SUPPLIERS_INT (VENDOR_INTERFACE_ID.SET_OF_BOOKS_ID. ENABLED_FLAG. EXCEPTION WHEN OTHERS THEN FND_FILE.'MESSAGE:CHECK THE TERM_ID IN AP_TERMS TA BLE').NEXTVAL. CUSTOMER_NUM. SET_OF_BOOKS_ID. I. --TERMS_ID VALIDATION BEGIN SELECT TERM_ID INTO L_TERMS_ID FROM AP_TERMS WHERE TERM_ID = I. INVOICE_AMOUNT_LIMIT. SHIP_VIA_LOOKUP_CODE. L_VENDOR_NAME. VENDOR_TYPE_LOOKUP_CODE. --SET_OF_BOOKS_ID VALIDATION BEGIN SELECT SET_OF_BOOKS_ID INTO L_SET_OF_BOOKS_ID FROM GL_SETS_OF_BOOKS WHERE SET_OF_BOOKS_ID=I.PUT_LINE(FND_FILE. FREIGHT_TERMS_LOOKUP_CODE.LOG. TERMS_ID.PUT_LINE(FND_FILE. L_VENDOR_TYPE_LOOKUP_CODE. SUMMARY_FLAG. END. END. INVOICE_CURRENCY_CODE. MIN_ORDER_AMOUNT. EXCEPTION WHEN OTHERS THEN FND_FILE. PAYMENT_PRIORITY. END. FOB_LOOKUP_CODE. ONE_TIME_FLAG. SHIP_TO_LOCATION_ID . L_ENABLED_FLAG. TERMS_DATE_BASIS.'MESSAGE:CHECK THE GL_SETS_OF_BOOKS TABLE ').ES TABLE'). PAYMENT_CURRENCY_CODE. PAY_GROUP_LOOKUP_CODE.

ORG_ID.PHONE . I. I.PAY_GROUP_LOOKUP_CODE.BILL_TO_LOCATION_ID. I. I.CUSTOMER_NUM.LANGUAGE . L_TERMS_DATE_BASIS. I. I.STATUS ). INSERT INTO AP_SUPPLIER_SITES_INT (VENDOR_INTERFACE_ID. LANGUAGE . FND_PROFILE. L_FOB_LOOKUP_CODE.VALUE('ORG_ID'). INSERT INTO AP_SUP_SITE_CONTACT_INT (VENDOR_SITE_CODE. I. I. L_SHIP_TO_LOCATION_CODE. I. L_SET_OF_BOOKS_ID. AREA_CODE .PAYMENT_CURRENCY_CODE. ADDRESS_LINE1. ZIP.CURRVAL. FIRST_NAME. I. I. I. ORG_ID .PAYMENT_PRIORITY.STATUS). I. I.STATE .CITY .MIN_ORDER_AMOUNT. I.SHIP_VIA_LOOKUP_CODE. I. I. STATUS) VALUES .ADDRESS_LINE1 . CITY. I.PAYMENT_METHOD_LOOKUP_CODE. OPERATING_UNIT_NAME.ONE_TIME_FLAG. COUNTRY .VENDOR_SITE_CODE. STATUS ) VALUES (AP_SUPPLIERS_INT_S.INVOICE_AMOUNT_LIMIT.ADDRESS_LINE2 . ADDRESS_LINE2 .PAY_DATE_BASIS_LOOKUP_CODE. PHONE . I.COUNTRY . L_INVOICE_CURRENCY_CODE. L_FREIGHT_TERMS_LOOKUP_CODE. I. SUPPLIER_NOTIF_METHOD. I.SUPPLIER_NOTIF_METHOD.ZIP.I. OPERATING_UNIT_NAME.OPERATING_UNIT_NAME. L_TERMS_ID. STATE. I. VENDOR_SITE_CODE.AREA_CODE . I. I.

I. I. I.FIRST_NAME. END SUPPLIER_CONV_INTF_LOAD.VENDOR_SITE_CODE.STATUS).OPERATING_UNIT_NAME. COMMIT. END LOOP. I.(I. / .ORG_ID.

Sign up to vote on this title
UsefulNot useful