Tuesday, April 22, 2008

RTV_By Org,by Buyer(xml)

Report Query
select a.quantity,a.po_line_id,a.employee_id,b.full_name,a.organization_id, d.organization_code, d.organization_name,c.item_description,a.vendor_id, a.vendor_site_id,e.vendor_name from rcv_transactions a, po_buyers_all_v b ,po_lines_all c, org_organization_definitions d, ap_vendors_v e where a.po_line_id=c.po_line_id and a.employee_id=b.employee_id and a.vendor_id = e.vendor_id and a.organization_id=d.organization_id and a.transaction_type='RETURN TO VENDOR' &p_where_clause

Report Triggers
1) After Parameter Form Trigger :
function AfterPForm return boolean is
begin
if :P_Organization is null and :P_BuyerName is null then
:p_where_clause:='';
elsif :P_BuyerName is null and :P_Organization is not null then
:p_where_clause:= 'and d.organization_id = :P_Organization';
elsif :P_BuyerName is not null and :P_Organization is null then
:p_where_clause:= 'and b.full_name=:P_BuyerName';
else
:p_where_clause:= 'and d.organization_id = :P_Organization and b.full_name=:P_BuyerName';

end If;
return (TRUE);
end;

No comments: