Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Remove % from Character

Former Member
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

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.

gautam_totekar
Active Participant
0 Kudos

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.

Former Member
0 Kudos

try this........

data: l_amount(15) type c.

move amount to l_amount.

replace all occurrences of '%' from l_amount with ' '.