- SAP Community
- Groups
- Interest Groups
- Application Development
- Discussions
- Floor & Ceil difference in packed

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.

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Floor & Ceil difference in packed

Former Member

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

03-31-2009 9:26 AM

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.

- SAP Managed Tags:
- ABAP Development

4 REPLIES 4

Former Member

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

03-31-2009 9:29 AM

Hi,

floor will give the highest value of the integer.

ceil will give the lowest value of the integer.

Regards,

Pavan

- SAP Managed Tags:
- ABAP Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

03-31-2009 9:29 AM

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 .

- SAP Managed Tags:
- ABAP Development

Former Member

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

03-31-2009 9:29 AM

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

- SAP Managed Tags:
- ABAP Development

Former Member

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

03-31-2009 9:42 AM