Skip to Content
0
Former Member
Jan 31, 2009 at 10:04 AM

Error while executing query in wizard

39 Views

Hi,

When I run the following query in SAP's Query Generator , I get the error 'Invalid column name 'GS09'

select DocNum,convert(varchar,T0.docdate,103) PostingDate, T1.seriesname, isnull(numatcard,'') 'Vendor Ref', CardName, sum(quantity) Qty, sum(p1.linetotal) Row_Total,  Discsum Discount, T0.Vatsum Tax, sum(isnull(p3.totalsumsy,00)) Freight , sum(isnull(p5.WTAmnt,0)) 'TDS Total',
T0.doctotalsy - T0.paidsys 'Net Amount' from opch T0 inner join pch1 p1 on T0.docentry = p1.docentry 
left outer join pch3 p3 on T0.docentry = p3.docentry 
left outer join pch5 p5 on T0.docentry = p5.Absentry 
inner join nnm1 T1 on T0.series = T1.series and T1.objectcode = 18
where T1.seriesname = case when len([%0]) > 0 then [%0] else T1.seriesname end and T0.docdate >= case  when  len([%1]) > 0 then  [%1]  else  T0.docdate end and T0.docdate <= case  when  len([%2]) > 0 then  [%2]  else  T0.docdate end  
group by docnum, numatcard, cardname, T0.docdate, Discsum,T0.Vatsum,T1.seriesname, T0.doctotalsy - T0.paidsys

I am passing 'GS09' as my series parameter. when i remove the condition

T1.seriesname = case when len([%0]) > 0 then [%0] else T1.seriesname end

it works fine.

anything wrong with this particular line? I am working on PL 44, 2005 B version.

regards,

Binita