cancel
Showing results for 
Search instead for 
Did you mean: 

Numeric fields with DataTable and Grid

Former Member
0 Kudos

Hello, i'm working with DataTables and Grids.

I Define DataTable columns in screen painter, bind grid to datatable e fill values of datatable with SetValue Method.

I define numeric columns with decimal of ft_Float type.

The problem is the number of decimals i see in these columns: i made some test and i've discovered that it corresponds to the 'Amounts' setting of the general settings form! Always..!

I need to put quantities in these columns not amounts.

I need to see quantities with 6 decimals and amounts with 2.

How can i do it if datatable only have ft_Float to work with decimals and it only 'listens' to 'Amounts' ?

Pleas help...

I'm using SAP B1 2005A SP01 PL 36.

Thank

Paolo

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Paolo

i came across the same problem and the way I solved it is by manipulating the number of decimals in the query itself, something like this ...


SELECT Field1, CAST(CAST(U_Amount AS DECIMAL(10,2)) AS VARCHAR) 'U_Amount'
FROM Table1

Notice the first CAST Function returns the amount in the decimal format desired and then the second one converts it to a string. It solve my problem.

hope it helps

Former Member
0 Kudos

Hello Neftali,

Thank you for your answer.

It Could help when displayng datas, but when i have editable grid,

i have to manually check user inputs and it could not be so simple.

Moreover, we have many forms that suffer this problem and it could take much time to implement is.

Thanks again

Paolo

Former Member
0 Kudos

Hi Paolo,

Unfortunately there is no way around this. You either have the numeric fields displaying with wrong number of decimal places or you have to validate the user input on an editable grid.

It's doesn't require a lot of coding to validate the user input.

Regards, Lita

AdKerremans
Active Contributor
0 Kudos

Hi Paolo,

We had the same problem and we solved it in the query by formatting the fields and made strings of it.