‎2009 Jun 02 10:57 AM
Hi expert
I run the function module VB_BATCH_GET_DETAIL after running
i get the character value each material against a particular batch.
For eg: i get 177.25 %.I want remove the % since i want to find the average of these characte value.
How to solve this in ABAP
Regards
Manoj
‎2009 Jun 02 11:04 AM
Hello,
Try with replace keyword
Example
REPLACE '%' WITH ' ' INTO variable which contains the value i.e 17.25%
CONDENSE variable which contains the value NO-GAPS.
‎2009 Jun 02 11:15 AM
refer program.. move your number 17.25% to character variable .. make the changes and move it back to numeric variable.. do the changes to it like taking avg.
data v_var(10) type c value ' 17.25%'.
data l_number(10) type N.
REPLACE '%' WITH ' ' INTO v_var IN CHARACTER MODE.
CONDENSE v_var.
write v_var to l_number.
WRITE v_var.
WRITE l_number.
‎2009 Jun 02 11:18 AM
try this........
data: l_amount(15) type c.
move amount to l_amount.
replace all occurrences of '%' from l_amount with ' '.