Application Development 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: 

regarding 0.5

Former Member
0 Kudos

hi experts,

i m dividing 1 by 2 ,but it is not wrking,

the variable which is i m using of type c is

not taking 0.5 ,plz help me to sort out this,what will

be the type of variable for storing 0.5.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

take

variable as type P decimals 2.

Regards,

Srinivas

5 REPLIES 5

former_member184657
Active Contributor
0 Kudos

i guess SAP has not yet defined such a type to store 0.5

pk

Former Member
0 Kudos

Hi,

take

variable as type P decimals 2.

Regards,

Srinivas

Former Member
0 Kudos

Hi Rajat.

Use the following code:

REPORT ZNITIN_TEST.

data: n1 type i value '1',

n2 type i value '2',

n3 type p decimals 2.

n3 = n1 / n2.

write: n3.

Hope this will help you.

Regards,

Nitin.

former_member212653
Active Contributor
0 Kudos

try this:


data: val type p length 3 decimals 1.

val = 1 / 2.

val will have 0.5

Former Member
0 Kudos

Hi Raja,

try this below code. it will work.

data: c_p type p decimals 1,

c_1 type p decimals 1 value '1',

c_2 type p decimals 1 value '2'.

start-of-selection.

c_p = c_1 / c_2.

write :/10 c_p.

Regrads,

Siva.