Skip to Content
-2
Sep 30, 2020 at 01:14 PM

How to apply a formula for to the whole column of an internal table?

50 Views

I created an internal table where it can hold the Values of the material and I need to use the formula that I came up with the values that are in the internal table. I want to apply the formula for all the entries in the w_amt table. I have a separate select statement for the w_amt/internal table for it.

DATA: w_amt TYPE mbew-verpr.
l_curr LIKE tcurx-currdec.

SELECT SINGLE currdec
FROM tcurx
INTO l_curr
WHERE currdec NE ' '.

CHECK sy-subrc = 0.

IF sy-subrc EQ 0.
w_amt = w_amt / ( 10 ** ( 2 - l_curr ) ).
ENDIF.
ENDFORM.