Thursday 1 March 2012

How Can Used Function Multiple Data

One Function Can Used Multiple Data:

/* One Purchase Order Number Can Multiple Time Receipt and Multiple Invoice Generated . */
Function CF_rcp_noFormula return Char
is
vrcp varchar2(200);
begin
for i in (
Select Ad.Invoice_number rcp_no ----
From Rcv_shipment_headers rh,
Rcv_shipment_lines rl,
Po_distributions_all pd,
Ap_invoice_distributions_all ad
Where
pd.PO_DISTRIBUTION_ID = ad.po_distribution_id and
pd.PO_HEADER_ID = rl.PO_HEADER_ID and
pd.PO_LINE_ID = rl.PO_LINE_ID and
rh.SHIPMENT_HEADER_ID = rl.SHIPMENT_HEADER_ID
pd.PO_HEADER_ID = (Select Po_Header_id
From Po_Headers_all
Where Segment1 = :Po_Num ---Put any Purchase Order Number ))
loop
vrcp := i.rcp_no ||','||vrcp;
end loop ;
return substr(vrcp,1,instr(vrcp,',',1)-1); ------All Invoice Number Insert
exception
when no_data_found then
return null;
end;

OUTPUT:
10001, 10002, 1003, 1004,




No comments:

Post a Comment