Skip to Content
author's profile photo Former Member
Former Member

How to Change Datatype in Existing UDF in System Table


I am creating UDF's in OIBT Table.Now i want to change the Datatype SUM to QUANTITY Without removing the Field .(Because Enduser already entered some data's)

Its possible through Coding ?

If yes means pls give some tips to do this.




Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Oct 24, 2006 at 05:30 AM

    Hi senthilkumar B

    Yes you can, here is a sample function below which does that.

    'to call the function

    UpdateExistingUDFField("@FRT_OQUT", "U_QTY", "", SAPbobsCOM.BoFieldTypes.db_Float, SAPbobsCOM.BoFldSubTypes.st_Quantity, 11)

    'function to update fields

    Private Function UpdateExistingUDFField(ByVal TableName As String, _

    ByVal FieldName As String, _

    ByVal Description As String, _

    ByVal Type As SAPbobsCOM.BoFieldTypes, _

    ByVal SubType As SAPbobsCOM.BoFldSubTypes, _

    ByVal Size As Integer)

    Dim oUserFieldsMD As SAPbobsCOM.UserFieldsMD

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


    If oUserFieldsMD.GetByKey(TableName, 1) Then


    oUserFieldsMD.Type = Type

    oUserFieldsMD.EditSize = Size

    oUserFieldsMD.SubType = SubType

    Dim lRetCode As Integer = oUserFieldsMD.Update

    '// Check for errors

    If lRetCode <> 0 Then

    oCompany.GetLastError(lRetCode, sErrMsg)


    End If

    End If

    Catch ex As Exception


    'Log.WriteLog("Exception (AddField): " & ex.Message, EventLogEntryType.Error)



    oUserFieldsMD = Nothing


    End Try

    End Function

    hope this helps

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.