How to insert records in user defined tables through DI Server API

Hi All,
I have created a UDO using some userdefined tables .I am able to insert records in the user defined tables using DI API but problem is that now I want to insert records in those tables using DI Server API but I dont know how to do that please give me some way to do that
Thanks and Regards
Utpal

The AddObject message is :
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
  <env:Header>
    <SessionID>...</SessionID>
  </env:Header>
  <env:Body>
    <dis:AddObject xmlns:dis="http://www.sap.com/SBO/DIS">
      <BOM>
        <BO>
          <AdmInfo>
            <Object>...</Object>
          </AdmInfo>
        </BO>
      </BOM>
    </dis:AddObject>
  </env:Body>
</env:Envelope>
How to use it with a user defined table ?

Similar Messages

  • Error while  adding records in user defined table

    Dear all,
                    I am adding a record in user defined table using   .add() method. the code is given below. while adding it raises the following error
    "-1[Microsoft]  [SQL Native Client] [SQL Server] Conversion failed when converting the nvarchar value '-3 @BG_MAILSETTINGS'  to data type int. (CINF).  "
    All the fields are varchar date type.  
                Dim oUDT As SAPbobsCOM.UserTable
                oUDT = oCompany.UserTables.Item("BG_MAILSETTINGS")
                With oForm.DataSources.UserDataSources           
                        oUDT.Code = "1"
                        oUDT.Name = "SMTPSERVER"
                        oUDT.UserFields.Fields.Item("U_SERVER").Value = .Item("EDTSMTPSVR").ValueEx
                        oUDT.UserFields.Fields.Item("U_EMAIL").Value = .Item("EDTFEMAIL").ValueEx
                        oUDT.UserFields.Fields.Item("U_PORT").Value = .Item("EDTSMTPPRT").ValueEx
                        oUDT.UserFields.Fields.Item("U_USERNAME").Value = .Item("EDTSMTPUSR").ValueEx
                        oUDT.UserFields.Fields.Item("U_PASSWORD").Value = .Item("EDTSMTPPWD").ValueEx
                        oUDT.UserFields.Fields.Item("U_AUTHENT").Value = .Item("CMBSMTPAUT").ValueEx
                        K = oUDT.Add
                        If K <> 0 Then
                            oCompany.GetLastError(iErrCode, sErrMsg)
                            MsgBox(CStr(iErrCode) & "-" & sErrMsg, vbCritical, "Error")
                            Exit Sub
                        End If
                 End with
    Could any one please say the solution for this.
    Many thanks,
    Manikandan.
    Edited by: Rui Pereira on Dec 23, 2008 3:49 PM

    Dear Manikandan P,
    Is there any change and check in stored procedure SBO_SP_TransactionNotification?
    Best Regards
    Jane Jing
    SAP Business One Forums team
    Edited by: Rui Pereira on Dec 23, 2008 3:56 PM

  • Import data in user define table through DTW.

    Hi experts,
    Can any one tell me how can i import data from excle in User define tables through DTW. Is any other way/tool avaliable to
    import data from excel sheet to User define tables
    BR,
    Hari

    Hi Hari,
    I suppose u did not do the following..
    1. Open DTW, in the menu click on advanced and clik on maintain interface...
    2. Now here select the UDT which u want to impot the data.
    3. right click on the UDT and click on Create template for structure
    4. NOw u use this tempalte and try.
    Please inform of the outcome  so that i can think of another soluton.
    Hope it helps,
    Vasu Natari.

  • How do i declare a user defined table type sproc parameter as a local variable?

    I have a procedure that uses a user defined table type.
    I am trying to redeclare the @accountList parameter into a local variable but it's not working and says that i must declare the scalar variable @accountList.this is the line that is having the issue: must declare the scalar variable @accountListSET @local_accountList = @accountListALTER PROCEDURE [dbo].[sp_DynamicNumberVisits] @accountList AS integer_list_tbltype READONLY
    ,@startDate NVARCHAR(50)
    ,@endDate NVARCHAR(50)
    AS
    BEGIN
    DECLARE @local_accountList AS integer_list_tbltype
    DECLARE @local_startDate AS NVARCHAR(50)
    DECLARE @local_endDate AS NVARCHAR(50)
    SET @local_accountList = @accountList
    SET @local_startDate = @startDate
    SET @local_endDate = @endDate
    CREATE TYPE [dbo].[integer_list_tbltype] AS TABLE(
    [n] [int] NOT NULL,
    PRIMARY KEY CLUSTERED
    [n] ASC
    )WITH (IGNORE_DUP_KEY = OFF)
    GO

    Why are you asking how to be an awful SQL programmer??  Your whole approach to SQL is wrong.
    We have a DATE data type so your insanely long NVARCHAR(50) of Chinese Unicode strings is absurd. Perhaps you can post your careful research on this? Can you post one example of a fifty character date in any language? 
    The use of the "sp_" prefix has special meaning in T-SQL dialect. Good SQL programmers do not use CREATE TYPE for anything. It is dialect and useless. It is how OO programmers fake it in SQL. 
    The design flaw of using a "tbl-" prefix on town names is called "tibbling" and we laugh at it. 
    There are no lists in RDBMS; all values are shown as scalar values. First Normal Form (1NF)? This looks like a set, which would have a name. 
    In any -- repeat any -- declarative programming language, we do not use local variables. You have done nothing right at any level. You need more help than forum kludges. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • How to insert record inside the internal table in below code

    Hi all,
    My requirement is to find the sub-total and need to insert in between the internal table.
    You can see the output ....where I want the sub-total F2 when 1 & 2 combindely , 3 , 4& 5 combindely .Please check it and let me know is it possible
    when i am using modification  it is not creating extra row inside the table instead it is modifying one row and putting the total there.
    For ex: the origianl output is
    F1   F2       F3
    A      1          1
    B      1          1
    F      2          1
    D      3          1
    E      4          1
    C      5          1
    We want to display all the total of f2 of 1-2 , 3 , 4-5
    so expcected output is
    F1   F2       F3
    A      1          1
    B      1          1
    F      2          1
         *              3  ->This is the sub-total of 1& 2 of f2
    D      3          1
            *           1 ->this is the sub-total of 3
    E      4          1
    C      5          1
          *             2 -> this is the sub-total of 4 & 5
    = space
    But coming output is
    A 1          1
    B 1          1
    *             3 -> it is modifying the F row and inserting the total .Total is comong correct but is shoule insert  instead of modifying the record!!
      *           1
    E  4          1
    *             2
    Please help how to insert the row total at the end of the chage of field
    Please find the below code ..Due to space problem i am attaching below
    Sas

    Here is the solution ....i Got the answer Thanks for your helping hands friends
    REPORT  YTEST_MODIFY.
    DATA: BEGIN OF ITAB OCCURS 1,
    TOT TYPE C,
    F1 TYPE C,
    F2 TYPE C,
    F3 TYPE I ,
    END OF ITAB.
    DATA: BEGIN OF JTAB OCCURS 1,
    F1 TYPE C,
    F2 TYPE C,
    F3 TYPE I ,
    END OF JTAB.
    START-OF-SELECTION.
      ITAB-F1 = 'A'.
      ITAB-F2 =  1.
      ITAB-F3 =  1.
      APPEND ITAB.
      ITAB-F1 = 'B'.
      ITAB-F2 =  1.
      ITAB-F3 =  1.
      APPEND ITAB.
      ITAB-F1 = 'C'.
      ITAB-F2 =  5.
      ITAB-F3 =  1.
      APPEND ITAB.
      ITAB-F1 = 'D'.
      ITAB-F2 =  3.
      ITAB-F3 =  1.
      APPEND ITAB.
      ITAB-F1 = 'E'.
      ITAB-F2 =  4.
      ITAB-F3 =  1.
      APPEND ITAB.
      ITAB-F1 = 'F'.
      ITAB-F2 =  2.
      ITAB-F3 =  1.
      APPEND ITAB.
      SORT ITAB BY F2.
      LOOP AT ITAB.
        WRITE:/1 ITAB-F1 ,
              8 ITAB-F2 ,
              10 ITAB-F3 .
      ENDLOOP.
      LOOP AT ITAB.
        IF ITAB-F2 = 1 OR ITAB-F2 = 2.
          ITAB-TOT = 1.
          MODIFY ITAB.
        ELSEIF ITAB-F2 = 3.
          ITAB-TOT = 3.
          MODIFY ITAB.
        ELSEIF ITAB-F2 = 4 OR ITAB-F2 = 5.
          ITAB-TOT = 4.
          MODIFY ITAB.
        ENDIF.
      ENDLOOP.
      SKIP 2.
      SORT ITAB BY TOT.
      DATA : L_SUM(2) TYPE C,
             L_ROW(2) TYPE C.
      LOOP AT ITAB.
        MOVE-CORRESPONDING ITAB TO JTAB.
        APPEND JTAB.
        L_SUM = L_SUM + ITAB-F3 .
        AT END OF TOT.
          CLEAR JTAB.
          JTAB-F3 = L_SUM .
          APPEND JTAB.
          CLEAR L_SUM.
        ENDAT.
      ENDLOOP.
      LOOP AT JTAB.
        WRITE:/1 JTAB-F1 ,
              8 JTAB-F2 ,
              10 JTAB-F3 .
      ENDLOOP.
    *  DATA: a TYPE i , b .
    *  LOOP AT itab.
    *    IF b = 0.
    *      a = a + itab-f3.
    *    ENDIF.
    *    AT END OF tot.
    *      MOVE space TO itab-f1.
    *      MOVE space TO itab-f2.
    *      MOVE a TO itab-f3.
    *      MODIFY itab .
    *      CLEAR a.
    *      b = 1.
    *    ENDAT.
    *    b = 0.
    *  ENDLOOP.
    *  LOOP AT itab.
    *    MOVE-CORRESPONDING itab TO jtab.
    *    APPEND jtab.
    *  ENDLOOP.
    *  ULINE.
    *  LOOP AT jtab.
    *    WRITE: / jtab-f1 , jtab-f2 , jtab-f3.
    *  ENDLOOP.

  • How to insert records dynamically in a table at run time

    hi, all
      please help me out,
      my problum is how can i insert records from on table to another table at  run time dynamically. Initally the records are coming  from R/3 backend.
    regards

    Hi,
    One way is to first create a Value node (NewNode) with structure binding of that of the model node. Then iterate through the model node, create NewNode elements and set the value from model node elements into it.
    IPrivate<view>.I<model node> mele;
    IPrivate<view>.I<NewNode> nele;
    for(int=0;i<wdContext.node<output>().node<record>().size();i++)
    mele = wdContext.node<output>().node<record>().get<record>ElementAt(i);
    nele = wdContext.node<NewNode>().create<NewNode>Element();
    wdContext.node<NewNode>().addElement(nele);
    nele.set<attr>(mele.get<attr>());
    Second way is to create that NewNode inside the model node and create a supply function.
    Regards,
    Piyush.

  • Dump when Inserting records in Info type Tables through PA30

    Hi Experts,
    I am facing a issue in the transaction PA30 where in any changes made and saved leads to Runtime error (Inserting records in Infotype tables ).
    Error Line : insert (dbname) from  <prel_db>
    The Structure is the same but the data mismatch with the data types like
    Field NUMC(4) is filled with 00 instead of 0000
    Field DATE and TIME are Blank instead of 00000000 or 000000.
    Similarly facing the same issue in few other fields.
    The issue is same as the below thread and tried the solution given by Taher kanchwala by changing the data in the debugger and it worked.
    DBIF_RSQL_INVALID_REQUEST error while inserting records in infotype tables
    BUT i am not sure about the changes that needs to be done for fixing this issue permanently as it is mentioned to change at the configuration level.
    Any suggestions or solutions to this issue??
    Regards,
    AyyamPerumal

    Hi Nabheet,
    Thanks for your time. No enhancements are done.
    The issue is in the below statement where dbname is PA2001 and the field symbol <prel_db> has the structure of PA2001.
    insert (dbname) from  <prel_db>
    But the data is not matching with the data types like NUMC, DATE, TIME..
    Even the DOCSY and DOCNR which should been generated at this point is also not generated.
    On correcting this and giving dummy doc values, records are inserted.
    Attaching screen shots for your reference. Any solutions to this??
    Thanks and regards,
    Ayyamperumal

  • How to Create CFL to user defined table

    Hi all,
    I have a user table with four fields. How to create a CFL for these fields?
    Regards,
    Fabio Ferreira.

    this is sub fn required for registration
    Here i mentioned heder level table and child table
    Fields are mentioned will be displayed on CFL
    If u want assign this CFL to any text field assign normal way but object id is:VEDA_PRN_WR_DOC
    Public Function UDOExists(ByVal code As String) As Boolean
            GC.Collect()
            Dim v_UDOMD As SAPbobsCOM.UserObjectsMD
            Dim v_ReturnCode As Boolean
            v_UDOMD = objMain.objUtilities.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)
            v_ReturnCode = v_UDOMD.GetByKey(code)
            System.Runtime.InteropServices.Marshal.ReleaseComObject(v_UDOMD)
            v_UDOMD = Nothing
            Return v_ReturnCode
        End Function
    'Second fn
    Function registerUDO(ByVal UDOCode As String, ByVal UDOName As String, ByVal UDOType As SAPbobsCOM.BoUDOObjType, ByVal findAliasNDescription As String(,), ByVal parentTableName As String, Optional ByVal childTable1 As String = "", Optional ByVal childTable2 As String = "", Optional ByVal childTable3 As String = "", Optional ByVal LogOption As SAPbobsCOM.BoYesNoEnum = SAPbobsCOM.BoYesNoEnum.tNO) As Boolean
            Dim actionSuccess As Boolean = False
            Try
                registerUDO = False
                Dim v_udoMD As SAPbobsCOM.UserObjectsMD
                v_udoMD = objMain.objUtilities.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)
                v_udoMD.CanCancel = SAPbobsCOM.BoYesNoEnum.tNO
                v_udoMD.CanClose = SAPbobsCOM.BoYesNoEnum.tNO
                v_udoMD.CanCreateDefaultForm = SAPbobsCOM.BoYesNoEnum.tNO
                v_udoMD.CanDelete = SAPbobsCOM.BoYesNoEnum.tYES
                v_udoMD.CanFind = SAPbobsCOM.BoYesNoEnum.tYES
                v_udoMD.CanLog = LogOption
                v_udoMD.CanYearTransfer = SAPbobsCOM.BoYesNoEnum.tYES
                v_udoMD.ManageSeries = SAPbobsCOM.BoYesNoEnum.tYES
                v_udoMD.Code = UDOCode
                v_udoMD.Name = UDOName
                v_udoMD.TableName = parentTableName
                If LogOption = SAPbobsCOM.BoYesNoEnum.tYES Then
                    v_udoMD.LogTableName = "A" & parentTableName
                End If
                v_udoMD.ObjectType = UDOType
                For i As Int16 = 0 To findAliasNDescription.GetLength(0) - 1
                    If i > 0 Then v_udoMD.FindColumns.Add()
                    v_udoMD.FindColumns.ColumnAlias = findAliasNDescription(i, 0)
                    v_udoMD.FindColumns.ColumnDescription = findAliasNDescription(i, 1)
                Next
                If childTable1 <> "" Then
                    v_udoMD.ChildTables.TableName = childTable1
                    v_udoMD.ChildTables.Add()
                End If
                If childTable2 <> "" Then
                    v_udoMD.ChildTables.TableName = childTable2
                    v_udoMD.ChildTables.Add()
                End If
                If childTable3 <> "" Then
                    v_udoMD.ChildTables.TableName = childTable3
                    v_udoMD.ChildTables.Add()
                End If
                If v_udoMD.Add() = 0 Then
                    registerUDO = True
                    objMain.objApplication.StatusBar.SetText("Successfully Registered UDO >" & UDOCode & ">" & UDOName & " >" & objMain.objCompany.GetLastErrorDescription, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success)
                Else
                    objMain.objApplication.StatusBar.SetText("Failed to Register UDO >" & UDOCode & ">" & UDOName & " >" & objMain.objCompany.GetLastErrorDescription, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                    registerUDO = False
                End If
                System.Runtime.InteropServices.Marshal.ReleaseComObject(v_udoMD)
                v_udoMD = Nothing
                GC.Collect()
            Catch ex As Exception
            End Try
        End Function
    This is a code for registration of table that will create CFL with mentioned fields.
    Hope help this
    By
    firos.C
    Edited by: firoz101 on Aug 18, 2009 6:07 AM
    Edited by: firoz101 on Aug 18, 2009 6:08 AM
    Edited by: firoz101 on Aug 18, 2009 6:08 AM

  • How to add data in User Defined table

    Hello Experts,
    I have design form in screen painter , 3 text boxes and labels, 2 add buttons with uid 1 and 2 , and
    i have created tables and fields maually and registered new object i have also mentioned table name and alias in property box with fields i have created with userdefined fields as   ex: U_age etc and table @EMP in property box 
    I am loading this form as xml file to SAP B1 every thing works fine but when i click add button no data is added to table what is the problem
    Please suggest

    Hi,
    Are you using UDO or not?
    If not you have to write code by hand for manage data insert, update, search, and so on...
    Regards.
    Diego

  • How to fill the records from a User Define Table to PO item Grid

    Hi To all,
    I need to fill data from User Define table records into Purchase Order Item Grid.
    I created an UDF Filed in PO - Header Part - "PRS"(Filed Name)
    By using Formatted Search in itemcode column, i called a query,
    "Select itemcode, qty from (@user define tablename) where PRS = $http://OPOR.U_PRS"
    For eg:
    Output from querry
    ItemCode Qty
    ABC 1
    DEF 2
    DFG 7
    SDGD 9
    By using formatted search it is filling only first data in to itemcode column in PO Grid.
    Please help, how can i fill ALL the data in to my PO Grid?
    Thanks in Advance
    SAGAR

    The easisest way is to create datasource and the result bind to grid.
    Datasource:
               oDBDataSource = oForm.DataSources.DBDataSources.Add("@usertablename")
                Dim xoConditions As SAPbouiCOM.Conditions
                Dim xoCondition As SAPbouiCOM.Condition
                xoConditions = New SAPbouiCOM.Conditions
                xoCondition = xoConditions.Add
                xoCondition.BracketOpenNum = 1
                xoCondition.Alias = "u_zn"
                xoCondition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
                xoCondition.CondVal = "cond"
                xoCondition.BracketCloseNum = 1
                oDBDataSource.Query(xoConditions)
    binding (example for matrix, in grid is simillar)
                oMatrix.Clear()
                Dim cols As SAPbouiCOM.Columns
                Dim column As SAPbouiCOM.Column
                cols = oMatrix.Columns
                column = cols.Item("colX")
                column.DataBind.SetBound(True, "@usertable", "u_x")
    oMatrix.LoadFromDataSource()
    hoep it helps
    Petr

  • HOW TO TRANSFER USER DEFINED TABLE DATA IN NEW DATABASE

    Dear all , I am trying to transfer user defined table data,in new database ,can you please tell how i can do it

    Thanks for Quick responce
    I have Following databases
    1) Targate Database EOU TEST
    2) Source database  STI_BLANK
    Table @MACHINE
    I tried But it has some error
    INSERT INTO EOU TEST.@MACHINE
    SELECT STI_BLANK.@MACHINE* FROM STI_BLANK.@MACHINE
    Edited by: Abhijit Bhise on Apr 1, 2010 3:27 PM
    Edited by: Abhijit Bhise on Apr 1, 2010 3:28 PM

  • Insert to User Defined Table

    Guys.. How can i insert my data to my user defined table (Master Document), i have write code:
    Set oUserTable = oCompany.UserTables.Item("TR_MD_FAKPAJAK")
    oUserTable.Code = "1"
    oUserTable.Name = "TORO"
    oUserTable.UserFields("U_field1").Value = "toro"
    oUserTable.UserFields("U_field2").Value = "toro"
    oUserTable.UserFields("U_field3").Value = "toro"
    oUserTable.UserFields("U_field4").Value = "toro"
    oUserTable.UserFields("U_field5").Value = "toro"
    Dim retval As Long
    retval = oUserTable.Add
    If retval <> 0 Then
        oCompany.GetLastError lErrCode, sErrMsg
        MsgBox lErrCode & " " & sErrMsg
    Else
        MsgBox "Masuk"
    End If
    my question is, when i run always display error "-4002 To Generate This Document, first defined the numbering series in Administration Module",
    any idea guys ??
    Thx

    Hi Ria,
    Unfortunately you cannot insert data in to a UDO table using the DI API (by marking your table as a 'Master Document' table you have made your UDT part of a UDO). It is one of the current limitations with working with UDOs. All data must be entered through the UI (ie manually).
    If you just want to store data in a UDT then it is best to create the table as 'No object'. You can then use the DI API to read and write data to your table. However, you do lose the UDO functionality (eg no automatic saving or searching etc).
    Kind Regards,
    Owen

  • How to add a DataBase Field in PLD from a User Defined Table

    Hi All,
    Please tell me how should i add a database field in PLD from User Defined Field...
    The DropDown for tables in the Property window does not shows the User Define tables...How should i see them...
    Thanx in Advance
    Manish

    In PLD choose object Database. Then press Alt + table combobox, this will show the UDT. Then choose the column.

  • Can BO Enterprize SDK inserts records into user table

    From Infostore can we create a jsp script using Java SDK to inserts records into user table??
    Thanks
    Amar

    Hi Amar,
    I want to retrieve data/records from Infostore and insert into a user table using JSP script. Is it possible to do this?
    Infostore is a database used by BO Server. so any changes made in infostore through BO enterprise session is valid.
    Say u want to retrive on of report present in folder <my folder>.
    The you have to query for that. for eg.
    boinfostore.query("select * from ci_infoobjects where si_kind ='report' and si_foldername='my folder'");
    Create/add/insert any new information in infostore is done by functionalities provide by SDK.
    like adding the user or scheduling a report will add new object to infostore.
    If you directly access cms database and make any changes then , I am afraid you will end up with nightmare.
    So it is always recommneded to access infostore/ cms database only from bo session.
    For more information refer below link
    [http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/devsuite.htm]
    then under Contents
    BusinessObjects Enterprise SDK >>  COM developer guide and API reference >> Query Language Reference
    do revert if any queries
    Thanks,
    Praveen.

  • How to read and write data to a user defined table?

    I have created a srf with 2 edit box and a ok buttin, I want to insert data to the user defined table i created using sql query while i press OK button..
    Please provide the complete code to insert and select da from the user defined table.

    Hi,
    You can use the code below.
    Dim ret As Long
    d
    Private Sub Add_Table_Click()
        Dim oUserTablesMD As SAPbobsCOM.UserTablesMD
        Set oUserTablesMD = oCompany.GetBusinessObject(oUserTables)
        ' When adding user tables or fields, use a prefix
        ' identifying your partner name space. This will
        ' prevent collisions from different partner add-ons
        ' SAP's name space prefix is "BE_"
        'Set the two mandatory fields
        oUserTablesMD.TableName = "T1"
        oUserTablesMD.TableDescription = "Table1"
        'Add the table (which contains 2 default, mandatory fields, 'Code' and 'Name')
        ret = oUserTablesMD.Add
        If ret <> 0 Then
            oCompany.GetLastError ret, Str
            MsgBox Str
        Else
            MsgBox "Table: " & oUserTablesMD.TableName & " was added successfully"
        End If
    End Sub
    Private Sub Add_UDF_Click()
        Dim oUserFieldsMD As SAPbobsCOM.UserFieldsMD
        Set oUserFieldsMD = oCompany.GetBusinessObject(oUserFields)
        oUserFieldsMD.TableName = "T1"
        oUserFieldsMD.Name = "AlbUDF"
        oUserFieldsMD.Description = "Albert UDF"
        'Add the field to the table
        lRetCode = oUserFieldsMD.Add
        If lRetCode <> 0 Then
            oCompany.GetLastError ret, Str
            MsgBox Str
        Else
            MsgBox "Field: '" & oUserFieldsMD.Name & "' was added successfuly to " & oUserFieldsMD.TableName & " Table"
        End If
    End Sub
    Private Sub Add_Data_Click()
        Dim oUserTable As SAPbobsCOM.UserTable
        Set oUserTable = oCompany.UserTables.Item(1)
        oUserTable.GetByKey ("T1")
        '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,
    Noor

Maybe you are looking for