cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with Checkbox as condition

Former Member
0 Kudos

Masters,

I would like to know what I am missing here (not inspired at all).

I am trying to pass a value via BAPI using a checkbox as a condition. I mean when I checkbox my numeric field woulbe multiplied by -1 (makes my number negative).

At the line between my table and my BAPI, in @numberfield assign value, I am using a condition but I am missing something.

My condition: IF(@CHECKBOX==true,@numberfield*-1,@numberfield)

Keeps saying the expression is wrong. I know but where? It has to do with Boolean of my checkbox?

Regards,

Gilson

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Gilson

You are right. It most probably has to do with the data type expected by the field receiving your condition.

I tried creating a form with three fields one bool checbox, one input field (numeric) and one expression box (also numeric).

For the expression box I used the same formula you used, but since it's a numeric field I had to wrap it in a NVAL() statement to make it numeric.

All if-then-else statements return textual values.

NVAL(IF(@BOOL1==true,@NUM2*-1,@NUM2))

It works!

Henning Strand

Former Member
0 Kudos

Thank you very much. It worked fine. I was missing NVAL.

Regards,

Gilson

Answers (0)