Skip to Content
avatar image
Former Member

Userdefined tables

Hi

I have created a table in DI SBO 6.5 by using the 'meta data samples'. I use C# for programming.

Tablename "DKKYBORGSLUKOD".

I want the table to have these two datafields:

Nr (numeric - my unique key)

Tekst (alfanumeric)

When I browse the tabel "@DKKYBORGSLUKOD" in the Entreprise Manager I find two extra fields "Code" and "Name". None of the fields are accepting null-values and "Code" is marked as key. The field I wanted to be a unique key is not marked!

What is the purpose of these fields?

Can anyone tell me how to insert data into this table, please ?

Can I use DI for inserting data or do I have to connect directly to the databaseserver?

Thanks,

Kim Kjaersulf

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jun 08, 2004 at 09:13 AM

    The DI API has a UserTables collection / UserTable object which can be used to access your table.

    Dim sboUserTable As SAPbobsCOM.UserTable

    Set sboUserTable = sboCompany.UserTables.("DKKYBORGSLUKOD")

    sboUserTable.Code = "1"

    sboUserTable.Name = "1"

    sboUserTable.UserFields.Fields("U_YOURFIELD").value = "XXX"

    sboUserTable.Add

    The Code and Name field are always present when you create user tables, and have to be populated with a unique value. If my key isn't logically an 8 character field, I usually stick a sequentially generated number in these fields and ignore them.

    Regards,

    John.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      > sboUserTable.Code = "1"

      > sboUserTable.Name = "1"

      > sboUserTable.Add

      When i use this code, nothing is inserted into my user table, although GetLastError() retrieves no error?

      Regards

      Clemens