
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Division Output Issue in ABAP with If-Then-Else Condition
The problem is that your second parameter is 0 which is an integer, so the output always comes as an integer as ifthenelse takes data type from the second parameter. So, in your case, if the answer is less than .5, it is converted to zeroes and in case more than .5, it is converted to 1. You would require to use cast for the second parameter to convert it to decimal data type as follows
ifthenelse(Query.Den= 0, cast(0, 'Decimal(16, 02)'), Query.Num / Query.Den)
Advertisements