Skip to Content
avatar image
Former Member

Uploading data into User defined tables of SAP Business One

Hi,

Is it possible to programmatically (using DIAPI) populate a User Defined Table ?

Or since it is a User Defined Table, is it "legal" as far as SAP is concerned to populate it using SQL update/insert statements?

Any help on this os greatly apprecated.

Thanks in advance,

Sudha

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Mar 19, 2008 at 05:54 AM

    Hi,

    you`ll have to use direct insert or update sql statement.

    Petr

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi ,

      Try this code,

      Dim ouserTable As SAPbobsCOM.UserTable

      ouserTable = objSBOAPI.oCompany.UserTables.Item("Userdefined table name")

      ouserTable.Code = "Get the Max(code) of the UDT plus one"

      ouserTable.Name = "Get the Max(code) of the UDT plus one"

      ouserTable.UserFields.Fields.Item("User deifned Field's Name(U_Cardcode) Case sensitive").Value = "The Value"

      'Adding new Value

      If ouserTable.Add() <> 0 Then

      MsgBox(oCompany.GetLastErrorDescription)

      End If

      ,Updating the existing record

      If ouserTable.Update() <> 0 Then

      MsgBox(oCompany.GetLastErrorDescription)

      End If

      Regards,

      Tom.

      Edited by: Tom C on Mar 19, 2008 10:47 AM