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 remove decimal point

Former Member
0 Likes
7,992

Hi Guys,

I want to remove decimal point in quantity field

e.g instead 5.0000, it should print 50000.

can any one suggest what to be done.

Thanks in advance for your help.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
3,510

Sure try this.



data: p_fld type p decimals 4.
data: c_fld(15) type c.

c_fld = p_fld.
translate c_fld using '. '.
condense c_fld no-gaps.

You could also find the number of decimals places, and then multiple by 10, 100, 1000, etc

Regards,

Rich Heilman

Hi Guys,

I want to remove decimal point in quantity field

e.g instead 5.0000, it should print 50000.

can any one suggest what to be done.

Thanks in advance for your help.

7 REPLIES 7
Read only

Former Member
0 Likes
3,510

try this...


    DATA : l_quntity(16).

    l_quntity  = itab-menge.  "quntity field 5.0000

    REPLACE ALL OCCURRENCES OF '.' IN l_quntity WITH SPACE.
    CONDENSE l_quntity.

    WRITE l_quntity.

    

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
3,511

Sure try this.



data: p_fld type p decimals 4.
data: c_fld(15) type c.

c_fld = p_fld.
translate c_fld using '. '.
condense c_fld no-gaps.

You could also find the number of decimals places, and then multiple by 10, 100, 1000, etc

Regards,

Rich Heilman

Read only

Former Member
0 Likes
3,510

Goto Menu option

System - User Profile - Own Data

Tabstrip Defaults

Change Decimal Notation to 1234567,89, that will remove the decimal point.

You might have to log out and back on before it takes effect.

Hope that helps,

Michael

Read only

Former Member
0 Likes
3,510

Hi,

Use syntax REPLACE ALL OCCURANCES OF ',' in <field Name> with ''.

CONDENCE <field name> no-gaps.

Regards,

Satish

Read only

Former Member
0 Likes
3,510

Hi

SPLIT f AT '.' INTO f1 f2.

Concatenate f1 f2 into f3.

Regards,

Mohan

Read only

Former Member
0 Likes
3,510

Hi Imran

Write that fields with "decimals 0" option in Write statement.

Cheers

~ Ranganath

Read only

0 Likes
3,510

Thanks for your kindly help.