Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

Former Member
Former Member replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question