Skip to Content
avatar image
Former Member

Smartform: trunc a number

Hi, I've a smartform where i'm using a field like LIPS-LFIMG, at my output i've for example 123,000. I need "trunc" result, i try to use trunc function at line code in my window of form, but TRUNC are not acessible in smartforms abap line code.

I need to create a function and then call her at smartform ? ...or there's another way to do this ?

Can someone help me ?

Thanks,

<MOVED BY MODERATOR TO THE CORRECT FORUM>

Edited by: Alvaro Tejada Galindo on Dec 29, 2009 2:03 PM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Dec 29, 2009 at 07:02 PM

    Hi,

    just declare local variable of type p decimals 0 and then put the original value there and print out new variable. When you have variable without decimals, the value will be truncated automatically.

    Regards,

    Karol

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 29, 2009 at 07:05 PM

    Try moving it to a string type varaible and print using offset position.

    check this

    Add comment
    10|10000 characters needed characters exceeded