03-31-2021 4:03 PM
Hi Experts,
I have below requirement -
All material movement types ending with an odd number, e.g. 101, 201, 221… should be positive amount number, and all movement types ending with an even number, e.g. 102, 202, 222… should Amount be negative number.
As BWART(Movement type) is char field how can i achieve this using MOD or any other way?
03-31-2021 6:37 PM
You could cast and use mod but might run into issue if BWART isn't a number.
Here's an easy thing to do.
define view ZODD_TEST as select from t156 {
key bwart as MovementType,
case right(bwart,1) when '1' then 'X' when '3' then 'X' when '5' then 'X' when '7' then 'X' when '9' then 'X' else '' end as isOdd
}
03-31-2021 6:37 PM
You could cast and use mod but might run into issue if BWART isn't a number.
Here's an easy thing to do.
define view ZODD_TEST as select from t156 {
key bwart as MovementType,
case right(bwart,1) when '1' then 'X' when '3' then 'X' when '5' then 'X' when '7' then 'X' when '9' then 'X' else '' end as isOdd
}