‎2006 Oct 05 4:12 PM
Hi friends,
i got formula from PLMK-Formule1 table like
C00010 * C00020 like that.
my ITAB contain values like 0010 --- 1.2
0020 --- 1.3
0030 --- space
so my reqirement is i want to read 0010 value from ITAB using formule C00010 like that
and finally that calculated result populated in ITAB.
ie 0030 --- 1.56
‎2006 Oct 05 4:25 PM
As per your definition the records in ITAB has values
0010, 0020 etc...in that case follow the below logic.
lformula -> C00010 * C00020.
condense lformula no-gap.
translate lformula with '*$+$-$/$'.
split lformula at '$' into lval1 lval2.
if lop CA '*/'.
lfval = 1.
else.
lfval = 0.
endif.
do 2 times.
if sy-index = 1.
lfield = lval1+2(4).
else.
lfield = lval2+2(4).
endif.
read table itab with key val = (lfield).
if sy-subrc = 0.
case lop. "Operator +, - , * and /.
when '*'.
lfval = itab-value * lfval.
when '/'.
lfval = itab-value / lfval.
when '+'.
lfval = itab-value + lfval.
when '-'.
lfval = itab-value - lfval.
endcase.
endif.
enddo.
move '0030' to itab-val.
move lfval to itab-value.
append itab.
Message was edited by: Anurag Bankley
Message was edited by: Anurag Bankley
‎2006 Oct 05 4:34 PM
Hi Siva
Can you explain me what are the name fields for your ITAB that contain your data
Regards,
David