Skip to Content

SAP Query to show change log for a PO#

Trying to show who when and what was changed for a PO number on the header of an invoice. Hep please!! I tried but no luck,

SELECT T0.[UpdateDate],T0.[NumAtCard], T2.[NumAtCard] as Newvalue, T1.[NumAtCard]as oldvalue, t3.[U_Name] as CreatedUser, t4.[U_Name] FROM ADOC T0 left join ADOC T1 on t1.NumAtCard = t0.NumAtCard and t1.loginstanc= t0.loginstanc-1 left join OINV T2 on t2.NumAtCard = t0.NumAtCard left join OUSR t3 on t3.userid = t2.usersign left join OUSR t4 on t4.userid =t2.usersign2 WHERE T2.[NumAtCard] <> T1.[NumAtCard] and datediff(dd,T1.[UpdateDate],getdate()) <=0 group by T0.[UpdateDate],T0.[NumAtCard], T2.[NumAtCard], T1.[NumAtCard],t3.[U_Name],t4.[U_Name] order by T0.[UpdateDate]

Add comment
10|10000 characters needed characters exceeded

0 Answers