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

how to devide

Former Member
0 Likes
528

hi,

i have facing a probleam with deviding the two values.

How to devide this two values. Because u2018,u2019 creating probleam here. because i am etting the error that its not a number

so here i have different different values there in database table .

ex:

t_konv-kbetr : 52,367.30

t_konv-kpein : 1,000

please help?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
465

Hi,

You can use below BAPI to convert the amount into desired format:

BAPI_CURRENCY_CONV_TO_INTERNAL

Regards,

Nitin.

3 REPLIES 3
Read only

Former Member
0 Likes
465

Well then just replace the commas and divide


data: result type p decimals 2.

t_konv-kbetr = 52,367.30 .

t_konv-kpein = 1,000.

replace all occurences of ',' in t_konv-kbetr with space.
replace all occurences of ',' in t_konv-kpein with space.

result = t_konv-kbetr / t_konv-kpein.

Read only

Former Member
0 Likes
465

I guess u shud not be getting any such errors.

Just define the result variable as say TYPE p decimals 2 and straight away write

result = t_konv-kbetr / t_konv-kpein.

I will recheck the results but it shud work.

Read only

Former Member
0 Likes
466

Hi,

You can use below BAPI to convert the amount into desired format:

BAPI_CURRENCY_CONV_TO_INTERNAL

Regards,

Nitin.