on 2024 Aug 20 4:33 PM
We are working on an Object Dependency with a VC BOM where we need the final result to round up to the nearest integer. We see that the CEIL function should do exactly that but it is not working. Our formula is as follows:
$self.TC_BOM_QTY = CEIL ( MDATA $self.TC_BOM_QTY / TC_PC_PER_BOARD )
We want to be the BOM Quantity to be equal to the BOM Quantity divided by the number of Pieces per Board.
For example:
TC_BOM_QTY = 45
TC_PC_PER_BOARD = 18
45 / 18 = 2.5
We are expecting the CEIL function to set TC_BOM_QTY result to 3, but we are constantly receiving 2.5.
We have even tried the FLOOR function to see if its just with CEIL, but we still get 2.5.
Is there an issue with our Formula or Variables? Do they need to be of a certain type for those functions (CEIL, FLOOR) to work?
Request clarification before answering.
Hi Brian,
another possibility to replace CEIL is to get the integer value after having added 0.5 to the formula result, something like this:
$self.TC_BOM_QTY = TRUNC (( MDATA $self.TC_BOM_QTY / TC_PC_PER_BOARD ) + 0.5)
Hope it will work...
Flavio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Brian,
I have just read that there is some bug with the CEIL function.
Solved: Alternative for CEIL Function, because does not wo... - SAP Community
As an alternative you can try to use the ROUND function.
$self.TC_BOM_QTY = ROUND ( MDATA $self.TC_BOM_QTY / TC_PC_PER_BOARD, 0, ROUND_CEILING )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
102 | |
16 | |
9 | |
7 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.