Skip to Content
0

How to add data in database using user Table in sapb1 sdk

Dec 27, 2016 at 09:44 PM

84

avatar image
Former Member

I am trying to save data in database using user table but i am unable to catch fields for storing data.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Edy Simon Dec 28, 2016 at 01:26 AM
0

Hi,

Quoted from SAP Business One Help File RefDI.chm

Private Sub Add_Data_Click()
    Dim oUserTable As SAPbobsCOM.UserTable
    Set oUserTable = oCompany.UserTables.Item(1)

    'Set default, mandatory fields
    oUserTable.Code = "A"
    oUserTable.Name = "Albert"
    'Set user field
    oUserTable.UserFields.Fields.Item("U_AlbUDF").Value = "1"

    oUserTable.Add

    If ret <> 0 Then
        oCompany.GetLastError ret, Str
        MsgBox Str
    Else
        MsgBox "Value to field: '" & oUserTable.UserFields.Fields.Item("U_AlbUDF").Name & "' was updated successfuly to "  & oUserTable.TableName & " Table"
    End If
End Sub

Regards
Edy

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Dec 28, 2016 at 07:25 PM
0

Thanks Edy Simon .Yes i use this, Actually i found. it my table is master data type and solution is to create a table with SAPbobsCOM.BoUTBTableType.bott_NoObject.

Share
10 |10000 characters needed characters left characters exceeded
Edy Simon Dec 29, 2016 at 01:16 AM
0

I see, master data type needs to be bound to UDO and add the values from General Data Service.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Dec 30, 2016 at 07:29 AM
0

I am Creating Form Without UDO and add() ,Update() data using userTable. and know i try to navigate data?

Share
10 |10000 characters needed characters left characters exceeded