02-03-2009 6:41 AM
Hi,
I am working on a requirement with ALV grid, it has a Quantity field. Currently I am having the field type to QUAN, however during runtime when the user enters value on the quantity field, it displays the value divided by 100 or sometimes by 1000.
For example : If I enter 10 in the quantity field, it displays after refresh as .01
Please help as to how I can set this field to accept and retain the quantity in decimals and not to convert it into divide by 100. Also it should not accept characters.
Thank you in advance,
SAC
02-03-2009 7:04 AM
Hi Saleem,
Try defining your field of type TableField TCURC-WAERS.
I hope this will solve your problem.
Regards,
Amit.
02-03-2009 7:07 AM
Did you assign correctly a unit of measure field to this field in the field catalog, this unit will be used by the program to determine the format of the quantity field.
field catalog :
- fieldname = 'MENGE' datatype = 'QUAN' qfieldname = 'MEINS'
- fieldname = 'MEINS' datatype = 'UNIT'
Regards
04-03-2009 11:12 AM
Hi,
Hope you have found a solution to this. If not, then here it is. Set the attribute 'datatype' of that particular field in your fieldcatalogue to a value 'DECIMAL'. It will then work.
Regards,
Srinivas.
04-06-2009 6:52 AM
To ensure it should not take character, you can use FM 'Numeric_Check'.
Regards.
Sarbajit.
08-24-2016 2:51 PM
05-04-2022 1:46 AM
I tried all the above, and many many other things, and and finally did just this and it worked.
set:
fieldcat-DECIMALS = '3'.
fieldcat-DECIMALS_O = '0'.
Remove all other special fieldcat stuff.
Regards, Ralph.
08-01-2023 5:53 PM
Thank you very much friend! I went through the same problem in ALV with editable quantity field, when adding the instruction
"DECIMALS = '3'." now accepts input with a comma correctly!