cancel
Showing results for 
Search instead for 
Did you mean: 

Variant Configuration - Object Dependencies - CEIL Function not Working

BrianStrickler
Explorer
0 Kudos
663

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? 

 

 

Accepted Solutions (0)

Answers (2)

Answers (2)

Flavio
Active Contributor
0 Kudos

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

Dusan90
Discoverer
0 Kudos

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 )

BrianStrickler
Explorer
0 Kudos

I saw this thread and found that it applies to DataSphere. I tried to do this in the Object Dependency and it does not work.

It does not recognize ROUND as a function.  

E28085 Invalid variable name ROUND (Line 4)
E28152 Function Round is not declared (Line 4)

Dusan90
Discoverer
0 Kudos
Did you create the function via T.Code CU66?