Documente Academic
Documente Profesional
Documente Cultură
===============================================================================
========================
Name : Create Blanket Purchase Agreement
Purpose : This plsql program is used to create BPA through PDOI : Import price
catalog concurrent
program
===============================================================================
========================
*/
DECLARE
------------------------------------------------------------------------------------Define Mandatory column variables to insert into interface tables. Values to a
ll
-- Variables need to be intialized with required data before running the script.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------Header level information
---------------------------------------------------------------------------------This provides batch id which is used to run particular set of data
l_batch_id
po_headers_interface.batch_id%TYPE := 100;
--Contains Organization ID
l_org_id
po_headers_interface.org_id%TYPE := 204;
--Contains Agent ID for which PO is created
l_agent_id
po_headers_interface.agent_id%TYPE := 25;
--Contains Vendor ID
l_vendor_id
po_headers_interface.vendor_id%TYPE := 21;
po_lines_interface.uom_code%TYPE := 'Ea';
l_progress := '002';
--- Inserting into Lines interface table
Insert into PO.PO_LINES_INTERFACE
(INTERFACE_LINE_ID,
INTERFACE_HEADER_ID,
ACTION,
LINE_NUM,
LINE_TYPE,
ITEM,
UOM_CODE,
UNIT_PRICE,
SHIP_TO_ORGANIZATION_ID,
SHIP_TO_LOCATION_ID,
NEED_BY_DATE,
PROMISED_DATE,
CREATION_DATE,
LINE_LOC_POPULATED_FLAG)
Values
(po_lines_interface_s.nextval, --- INTERFACE_LINE_ID,
po_headers_interface_s.currval, --- INTERFACE_HEADER_ID,
'ADD', --ACTION,
line_cnt,
l_line_type,
l_item,
l_uom_code,
l_unit_price,
l_ship_to_location_id, --SHIP_TO_ORGANIZATION_ID,
l_ship_to_location_id, --SHIP_TO_LOCATION_ID,
SYSDATE, --NEED_BY_DATE,
SYSDATE, --PROMISED_DATE,
SYSDATE, --CREATION_DATE,
'Y'); --- LINE_LOC_POPULATED_FLAG,
END LOOP;---End of Line Loop
END LOOP;---End of Header Loop
COMMIT;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Error while inserting data at :'||l_progress||SQLCODE||SQL
ERRM);
END;