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

removing the dot

Former Member
0 Likes
3,529

hi!! i have an itab which is included some amount fields.

my task is to remove the dot in the amount fields. for example:

111.99 ---> 11199

444444.88 -


> 44444488

what can i do?

Hi Antonis,

loop at itab into wa_itab.

REPLACE ALL OCCURRENCES OF '.' IN wa_itab-amnt WITH ' '.

condense wa_itab-amnt no-gaps.

modify itab from wa_itab.

endloop.

Reward if useful,

Regards,

Chitra

9 REPLIES 9
Read only

Sougata
Active Contributor
0 Likes
2,544

use FIND command to search for the dot then replace the dot with space then shrink the field using NO-GAPS addition.

Cheers,

Sougata.

Read only

Former Member
0 Likes
2,544

move them to charecter field and then use

translate charfield using '. '.

condense charfield no-gaps.

or just multiply by 100.

Regards

vasu

Read only

Former Member
0 Likes
2,544
loop at itab.
REPLACE ALL OCCURRENCES OF '.' IN itab-amount WITH ' '. 
condense itab-amount no-gaps.
modify itab.
endloop.
Read only

Former Member
0 Likes
2,544

Hi

Multiply with 100.. it will solve the problem...

Message was edited by:

Rama Jyothi

Read only

former_member188827
Active Contributor
0 Likes
2,544

move da amount to type c field.

zch = itab-amount .

replace '.' in zch with space.

condense zch.

plz reward points if dis helps

Read only

Former Member
0 Likes
2,544

hi antonis,

in any case the dot in sap represents the comma in our language that is for 10,000 in sap u will get 10.000 so u may not remove if anyway u want to remove that u need to take it as a whole string and loop it and then compare each character with a dot if it is a dot u may not append it else append it.

regards,

sohi

Read only

Former Member
0 Likes
2,544

Hi,

You the below code :

data : num1 type p DECIMALS 2 value '100.00'.

data : num2 type i.


num2 = num1 * 100.

write num2.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
2,544

Hi,

data: v1(6) type p decimals 2,
v2(6) type c.
v1 = '100.26'.
v2 = v1.
replace '.' in v2 with ''.
write v2.

<b>Reward for helpful answers</b>

Satish

Message was edited by:

Satish Panakala

Read only

Former Member
0 Likes
2,544

Hi Antonis,

loop at itab into wa_itab.

REPLACE ALL OCCURRENCES OF '.' IN wa_itab-amnt WITH ' '.

condense wa_itab-amnt no-gaps.

modify itab from wa_itab.

endloop.

Reward if useful,

Regards,

Chitra