Application Development and Automation 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: 
Read only

Remove % from Character

Former Member
0 Likes
539

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
Read only

Former Member
0 Likes
513

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.

Read only

gautam_totekar
Active Participant
0 Likes
513

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.

Read only

Former Member
0 Likes
513

try this........

data: l_amount(15) type c.

move amount to l_amount.

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