а у тебя вот этот запрос что возвращает если артикул подставить вместо параметра :P_ARTICLE?
SELECT F.CREATEDAT,F.NAME, F.ITEMPRICE, F.DOCSTATE
FROM (SELECT A2.CREATEDAT,
B2.ARTICLE,
B2.ITEMPRICE,
A2.DOCSTATE,
L.NAME,
ROW_NUMBER() OVER (PARTITION BY A2.LOCATIONTO,B2.ARTICLE ORDER BY A2.CREATEDAT DESC,A2.ID DESC) RN
FROM SUPERMAG.SMDOCUMENTS A2, SUPERMAG.SMSPEC B2,SUPERMAG.SMSTORELOCATIONS L
WHERE A2.DOCTYPE = B2.DOCTYPE
AND L.ID=A2.LOCATIONTO
AND A2.ID = B2.DOCID
AND A2.DOCSTATE IN (2,3)
AND A2.OPCODE=0
AND A2.DOCTYPE = 'WI'
AND B2.ARTICLE=:P_ARTICLE
) F
WHERE RN =1
ORDER BY F.CREATEDAT