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: 

Floor & Ceil difference in packed

Former Member
0 Kudos

Hi guy,

Can any one explain me the difference between the following two definations for packed?(Floor & Ceil)

prod_term TYPE p, "Repair rcv ~ Prod dt (floor)

prod_term2 TYPE p, "Repair rcv ~ Prod dt (ceil)

Thanks.

4 REPLIES 4

Former Member
0 Kudos

Hi,

floor will give the highest value of the integer.

ceil will give the lowest value of the integer.

Regards,

Pavan

former_member203501
Active Contributor
0 Kudos

hi look at this ....

REPORT zceil_floor .

parameters: p_int type i ,

p_int1 type i .

data: value type p decimals 2 ,

value1 type p decimals 2 ,

value2 type p decimals 2 .

start-of-selection.

value = p_int / p_int1 .

value1 = ceil( value ) .

value2 = floor( value ) .

write:/ 'the actual value is : ' , value .

write:/ 'value using the ceil function : ' , value1 .

write:/ 'value using the floor function : ' , value2 .

Former Member
0 Kudos

hi,

Floor and ceil are the two mathematical operations performed in ABAP.

there functionality is as follows.

FLOOR(5.4) = 5 " Greatest integer lesser than the given value

CEIL(5.4) = 6. " Smallest integer greater than the given value

Regards

Sharath

Former Member
0 Kudos

Thanks