Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Editable ALV Quantity field is displaying value in 100th decimal

Former Member
0 Kudos
3,228

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

7 REPLIES 7

Former Member
0 Kudos
351

Hi Saleem,

Try defining your field of type TableField TCURC-WAERS.

I hope this will solve your problem.

Regards,

Amit.

raymond_giuseppi
Active Contributor
0 Kudos
351

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

Former Member
351

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.

sarbajitm
Contributor
0 Kudos
351

To ensure it should not take character, you can use FM 'Numeric_Check'.

Regards.

Sarbajit.

Former Member
0 Kudos
351

Here there are a solution you can reference to the table and field of SE11.

0 Kudos
351

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.

0 Kudos
351

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!