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

Floor & Ceil difference in packed

Former Member
0 Likes
9,245

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.

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
Read only

Former Member
0 Likes
5,698

Hi,

floor will give the highest value of the integer.

ceil will give the lowest value of the integer.

Regards,

Pavan

Read only

former_member203501
Active Contributor
0 Likes
5,698

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 .

Read only

Former Member
0 Likes
5,698

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

Read only

Former Member
0 Likes
5,698

Thanks