cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform: trunc a number

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

karol_seman
Active Participant
0 Kudos

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

Answers (1)

Answers (1)

kesavadas_thekkillath
Active Contributor
0 Kudos

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

check this