how can we achieve REDUCE like the below logic inside an AMDP method.
lv_total = reduce tslxx9( init x type tslxx9 for lwa_out in lt_out
where ( companycode = <lf_wa>-bukrs and
ryear = <lf_wa>-year and
currency = <lf_wa>-currency
)
next x = x + lwa_out-amount ).