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

regarding to display variable in smartforms

Former Member
0 Likes
1,045

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

4 REPLIES 4
Read only

Former Member
0 Likes
679

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

Read only

Former Member
0 Likes
679

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.

Read only

Former Member
0 Likes
679

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

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
679

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