Following on from Solution 1 and your comment to it...
The first thing to do is to get the results into the format you require for the fixed data you have shown in your example.
One way of doing that would be to UNPIVOT your data first and then PIVOT using a dummy column for the qty and price for each ItemName e.g.
;with CTE as
(
SELECT * FROM
(SELECT [Date], qty, price, itemname
FROM yourTable) p
UNPIVOT
(value FOR what IN (qty, price)
)AS unpvt
)
select [Date], ABCqty,ABCprice,
PQRqty,PQRprice,
XYZqty,XYZprice
from
(
select [Date],value, ItemName + what as itemwhat
from CTE
) qry
pivot
(
max(value)
for itemwhat in ([ABCqty],[PQRqty],[XYZqty],[ABCprice],[PQRprice],[XYZprice])
) as pvt
order by [Date]
Once you know that is working then use the technique you have already used in the "What I have tried" section of your question - generate the SQL dynamically based on the actual data content of the table instead of the hard-coded column names - here is a snippet of that (I'll leave the rest to you)
select @cols = STUFF((SELECT ',' + QUOTENAME(ItemName + 'qty') + ',' + QUOTENAME(ItemName + 'price')
from yourtable
group by ItemName
FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)') ,1,1,'')
If you want it displayed precisely as you have in your expected results then you should do that in your presentation layer, not the query itself