Dear all,
I have written following query to fetch the correct tax code based on the control account set at Business partner and tax code set at item master. when i am executing this query in sql it fetches write data. but in SAP when i am using this query as FMS then it does not fetch the data. the query is as follows
Select distinct
(case
when T0.debpayacct = '_SYS00000000043' and T3.VatGourpSa = 'S1-LB' then 'S1-LB'
when T0.debpayacct = '_SYS00000000043' and T3.VatGourpSa = 'S2-LB' then 'S2-LB'
when T0.debpayacct = '_SYS00000000043' and T3.VatGourpSa = 'S1-LD' then 'S1-LB'
when T0.debpayacct = '_SYS00000000043' and T3.VatGourpSa = 'S2-LD' then 'S2-LB'
when T0.debpayacct = '_SYS00000000044' and T3.VatGourpSa = 'S1-LB' then 'S1-LD'
when T0.debpayacct = '_SYS00000000044' and T3.VatGourpSa = 'S2-LB' then 'S2-LD'
when T0.debpayacct = '_SYS00000000044' and T3.VatGourpSa = 'S1-LD' then 'S1-LD'
when T0.debpayacct = '_SYS00000000044' and T3.VatGourpSa = 'S2-LB' then 'S2-LD'
end)
FROM dbo.OCRD T0 JOIN ORDR T1 ON T0.CardCode = (select $[T1.cardcode])
INNER JOIN RDR1 T2 ON T1.DocEntry = T2.DocEntry
INNER JOIN OITM T3 ON (select $[$38.1.11]) = T3.ItemCode
thanks & Regards
Tavargeri Ganesh