cancel
Showing results for 
Search instead for 
Did you mean: 

Decimal Place in user define field

Former Member
0 Kudos
661

Hi,

While creating the table through user defined field, i need to add the field with decimal place if i give the decimal point in the editsize it is throuing the error message please let me know how i can add the field with decimal value.

Dim oUserFieldsMD As SAPbobsCOM.UserField

oUserFieldsMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)

oUserFieldsMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)

oUserFieldsMD.TableName = "@PSSIT_PMSCCOMPPOW"

oUserFieldsMD.Name = "hrswrk"

oUserFieldsMD.Description = "Hork Hours"

oUserFieldsMD.Type = SAPbobsCOM.BoFieldTypes.db_Float

oUserFieldsMD.EditSize = 8.2

lRetCode = oUserFieldsMD.Add

If lRetCode <> 0 Then

oCompany.GetLastError(lErrCode, sErrMsg)

MsgBox(sErrMsg)

Else

MsgBox("Field: '" & oUserFieldsMD.Name & "' was added successfuly to " & oUserFieldsMD.TableName & " Table")

End If

regards

Suresh S

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks

Former Member
0 Kudos

hi,

  • st_Rate --> Double format with the system's rate accuracy.

  • st_Sum --> Double format with the system's summery accuracy.

  • st_Price --> Double format with the system's price accuracy.

  • st_Quantity --> Double format with the system's quantity accuracy.

  • st_Percentage --> Double format with the system's percentage accuracy.

  • st_Measurement --> Double format with the system's measurement accuracy.

Dim oUserFieldsMD As SAPbobsCOM.UserField
oUserFieldsMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)
oUserFieldsMD.TableName = "@PSSIT_PMSCCOMPPOW"
oUserFieldsMD.Name = "hrswrk"
oUserFieldsMD.Description = "Hork Hours"
oUserFieldsMD.Type = SAPbobsCOM.BoFieldTypes.db_Float
oUserFieldsMD.SubType = SAPbobsCOM.BoFldSubTypes.st_Price
oUserFieldsMD.EditSize = 8.2 'Max is 19.6
lRetCode = oUserFieldsMD.Add
If lRetCode 0 Then
oCompany.GetLastError(lErrCode, sErrMsg)
MsgBox(sErrMsg)
Else
MsgBox("Field: '" & oUserFieldsMD.Name & "' was added successfuly to " & oUserFieldsMD.TableName & " Table")
End If

regards,

varma

Former Member
0 Kudos

Hi,

you may try

oUserFieldsMD.SubType = SAPbobsCOM.BoFldSubTypes.st_Price

The .EditSize and .Size I use only for db_Alpha and db_Numeric fields.

Former Member
0 Kudos

Hi,

Roland is right. Try to set the Suptype as required. Available supdtypes with decimal are:

- st_Rate --> Double format with the system's rate accuracy.

- st_Sum --> Double format with the system's summery accuracy.

- st_Price --> Double format with the system's price accuracy.

- st_Quantity --> Double format with the system's quantity accuracy.

- st_Percentage --> Double format with the system's percentage accuracy.

- st_Measurement --> Double format with the system's measurement accuracy.

Regards,

Friederike

SAP Business One Forums Team