‎2008 Dec 08 5:57 AM
Dear all,
I want to display a variable 'X' in smartform with some value.
i want to display this variable in smartform with five digits with decimals.
for example x = 0.12345 (in this fashion x must be displayed in smartforms)
With Regards,
Prasad
‎2008 Dec 08 6:01 AM
Hi,
Declare the variable as follows :
data : l_value type p decimals 5.When you pass the necessary value, it will be displayed in 5 digits.
Best regards,
Prashant
‎2008 Dec 08 6:05 AM
Hi prasad,
You can declare the variable x as
DATA : x(6) TYPE p DECIMALS 5,
y(6) TYPE c.
x = '0.12345'.
y = x.
IF y CS ','.
REPLACE ',' IN y WITH '.'.
ENDIF.
WRITE : x, y.
Hope this will help you.
Regards,
Anand.
‎2008 Dec 08 6:05 AM
Hi,
Just you define variable X as DATA : X(6) TYPE P DECIMALS 5 .
Assign value as x = "0.12345". in print program. & Use this X where ever you want to display.
Regards,
BBR.
Edited by: BBR on Dec 8, 2008 11:35 AM
‎2008 Dec 08 6:08 AM
Hello Prasad,
You cannot directly declare a variable of TYPE p DECIMALS 5 in SFs.
For this declare a Global TYPES (Global Definitions-->Types) as.
TYPES: ty_dec5 TYPE p DECIMALS 5 in SFs.
And use this in the Global Data tab to declare X.
E.g., X TYPE ty_dec5.
Hope this is clear.
BR,
Suhas