PO CHANGE API1 S and UPDATE PO Asked by Sandeep Gandhi posted Sep 27, 2006

Replies (1)

0 Please Sign-in or Register to vote Working I know this works - I had to write this code just a few months ago (in 11.5.10) set serveroutput on declare cursor po_cur is select DISTINCT pha.segment1, pla.line_num, v.shipment_num,pha.revision_num, pla.creation_date,v.promised_date,v.need _by_d ate From po_line_locations_v v, po.po_headers_all pha, po.po_lines_all pla,mtl_system_items_b msi where shipment_type not in ('QUOTATION') and upper(v.closed_code) !='CLOSED' --and pha.segment1='852464' and pha.po_headeR_id = v.po_headeR_id and v.promised_Date is null and pla.po_line_id = v.po_line_id and pla.item_id is not null and msi.organization_id =85 and msi.inventory_item_id = pla.item_id and msi.mrp_planning_code !=6; num number; l_result number; ctr number := 0; p_out PO_API_ERRORS_REC_TYPE; begin dbms_application_info.set_client_info(85); for po_rec in po_cur loop PO_DOCUMENT_UPDATE_GRP.update_document( p_po_number =>po_rec.segment1, p_release_number =>null, p_revision_number=> po_rec.revision_num,--rev p_line_number=>po_rec.line_num,--line p_shipment_number=>po_rec.shipment_num,--shipment p_nEW_QUANTITY => null, p_NEW_PRICE => null, p_NEW_PROMISED_DATE =>po_rec.need_by_date, p_LAUNCH_APPROVALS_FLAG =>'N', p_UPDATE_SOURCE => null, p_OVERRIDE_DATE => null, p_version=>2.0, -- Version <PO_CHANGE_API FPJ> x_result=>l_result, x_api_errors => p_out, p_BUYER_NAME => null ); ctr := ctr +1; end loop;

put_line ('count=' exception when others then dbms_output.put_line ('err'). .dbms_output. end. to_char(ctr)).

Sign up to vote on this title
UsefulNot useful