04-07-2016 11:40 AM
Hello gurus,
I have a custom code in infoset that should get the max billing amount from a certain billing plan. The code is:
data: lv_max TYPE FPLT-FAKWR.
SELECT SINGLE MAX( FAKWR )
FROM FPLT
INTO lv_max
WHERE FPLNR = FPLA-FPLNR.
if sy-subrc = 0.
RENTAL_FEE = lv_max.
endif.
clear lv_max.
It works fine in dev, but after transport to Quality, it gets the first (usualy the mininum) amount instead of the MAX amount.
Is there any reason you can think of?
Raly
04-07-2016 2:31 PM
Hi,
Use SELECT instead of SELECT SINGLE.
try the following .
data: lv_max TYPE FPLT-FAKWR.
SELECT MAX( FAKWR )
FROM FPLT
INTO lv_max
WHERE FPLNR = FPLA-FPLNR.
if sy-subrc = 0.
RENTAL_FEE = lv_max.
endif.
clear lv_max.
Regards,
NP