Hi,
There are two type of approval for Sales order. One from standard approval procedure and one from sales order-->Logistics tab. Please advice exact approval.
Try this query for second approval.
SELECT T0.[DocNum], T2.[Code] FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry left join OITT T2 on T1.[ItemCode] = T2.[Code] WHERE T2.[TreeType] = 'p' and T1.[LineStatus] = 'o' and T0.[Confirmed] = 'Y'
Thanks & Regards,
Nagarajan