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

Convert amount ...

Former Member
0 Likes
790

Hi all,

Pls help me !!! I want to convert amount,.

Ex: I have amount filed wa-PSWBT, currrency wa-PSWSL.

When debug, I saw wa-PSWBT = 1,423,680

wa-PSWSL = 'VND'

How can I change wa-PSWBT = 1423680 ???? Which 1,423,680 is format number of system.

Thanks !

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
759

Try this

data: a(20) type c.

a = '14,23,680'.

*Replace ',' in a with space.

replace all OCCURRENCES of ',' in a with space.

condense a.

write:/ a.

If usefull rewards points helpfull

6 REPLIES 6
Read only

Former Member
0 Likes
759

Hi,

Well probably u can declare the field wa-PSWBT as character of required size and then u can use write statement

For ex :

DATA :L_PSWBT(10).

*U can capture the amount in L_PSWBT.

WRITE L_PSWBT to wa-PSWBT .

Well try it like this if it solves ur problem or incase of any use

reward good points.

Thanks ,

Rahul

Read only

Former Member
0 Likes
759

Hi,

Replace ',' in wa-PSWBT with space.

condense wa-PSWBT.

Regards,

Rama.Pammi

Read only

0 Likes
759

Thanks Rama,

I also thought about this, but if we use REPLACE ',' when we set FM number in system is '.' it will be wrong, right !? How !?

Read only

Former Member
0 Likes
759

Hi

Copy the currency value to a char variable v_char

replace all OCCURRENCES of ',' in v_char with ' '.

Read only

Former Member
0 Likes
760

Try this

data: a(20) type c.

a = '14,23,680'.

*Replace ',' in a with space.

replace all OCCURRENCES of ',' in a with space.

condense a.

write:/ a.

If usefull rewards points helpfull

Read only

0 Likes
759

Raj, thanks so much, but pls tell me how to do if I change FM number in my own data. Change FM eq : 1,245.23 = 1.245,23 ....