Skip to Content
author's profile photo Former Member
Former Member

how to remove .000 in the filed

Hi,

Can any one please let me know i have a filed having 13 characters.in that 3 are decimals.

now my requirement is that i need to remove dot as well as 3 decimals from the value.

For ex: user is giving the width as 50 but while displaying it is showing 50.000.

and another possibility is that user may give 50.50 then 50.50 only to be displayed in the output.

Please any one suggest me the solution.

Regards,

Koti

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Posted on Feb 26, 2009 at 12:45 PM

    HI Koti

    if it's classical output then use

    WRITE <value> NO ZERO.

    If alv then put no_zero in field catalog as 'X'

    Pushpraj

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 26, 2009 at 12:49 PM

    Hi,

    Check this logic:

    data: val type p decimals 3.
    data: val1 type i.
    
    val = '234.000'.
    
    move val to val1.
    
    write:/ val1.

    thanks\

    Mahesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 26, 2009 at 12:49 PM

    Hi Koti Reddy

    Refer this link somebody faced same issue

    hi-removing-the-leading-zero's-before-the-particul

    Thanks

    Syfulla

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 26, 2009 at 12:51 PM

    Hi Kotireddy,

    You can use round if its a packed number and give your decimal places as 2.

    Much Regards,

    Amuktha.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 26, 2009 at 01:50 PM

    Hi,

    This works for sure.

    Try this.

    DATA w_p TYPE p DECIMALS 2 VALUE '123.00'.( take ur packed with ur decimals needed )

    DATA w_c(30) TYPE c.

    DATA w_temp TYPE i.

    w_c = w_p.

    CONDENSE w_c.

    SEARCH w_c FOR '...'.

    IF sy-subrc EQ 0.

    w_temp = sy-fdpos.

    ENDIF.

    ADD 1 TO w_temp.

    IF w_c+w_temp EQ 0.

    subtract 1 from w_temp.

    WRITE :/ w_c+0(w_temp).

    ELSE.

    WRITE :/ w_c.

    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.