i do this select with while loop.
the logic is that the select is running until i get in ukurs data ,
otherwise it add 1 to datecur and and try to find ukurs.
the problem is that in prod it run to long there is a way to improve this performance?
ukurs = ''.
WHILE ukurs = ''.
SELECT SINGLE ukurs
WHERE kurst = '1002' AND
fcurr = wa_dp-currency AND
tcurr = 'USD0' AND
gdatu = datecur.
datecur = datecur + 1.
Eric Cartman replied
sorry, what i wrote aboe is not correct, it still selects all lines. I think you have to go for array select:
SELECT gdatu ukurs FROM tcurr INTO TABLE ... WHERE ... gdatu GE decdate
this will select all possible entries in one go
SORT itab BY gdatu. READ TABLE itab INTO ... INDEX 1.
internal table will be sorted with date, which means, the first line is what you'll finally need.
hope this helps (finally)