Adding a DBDataSource

hiii all,
i m facing a prob. to add a dbdatasource to a form created by screen painter???
in sdk,it is given by addinga statement-
             oform.DataSource.DBDataSource.add(...)
but in my case i m not creating a object "oform" of type "SAPbouiCOM.Form"
so how can i add DBDataSource
thanxs
Nirdesh

Consider that you are adding a edittext box to the screen painter form.
Then click on the edittext box and in the properties on the left hand side you will get a table name property = The actual table name in SAP B1, Alias property = the Field name which you want to bind the edittext to and set databound property = true.
This should solve your issue.
Regards:
Vivek

Similar Messages

  • Adding dbDataSources to Deliveries Form

    Hi!, i have one question: am trying to add a dbDataSource to the Deliveries Form (FormUID 140), this dbDS refers to a user table that i have created (@SERIES), the problem is that when i run the program and switch to find mode, the SBO crashes... is this a bug? the A/R Invoices form works ok with this, this is my code:
    Private Sub applic_ItemEvent(ByVal FormUID As String, pVal As SAPbouiCOM.IItemEvent, BubbleEvent As Boolean)
        Dim oFrm As SAPbouiCOM.Form
        Dim oDBDataSource As SAPbouiCOM.DBDataSource
        If pVal.FormType = 140 And pVal.EventType = et_FORM_LOAD Then
            Set oFrm = applic.Forms.Item(FormUID)
            oFrm.DataSources.DBDataSources.Add ("@SERIES")
            Set oDBDataSource = oFrm.DataSources.DBDataSources.Item("@SERIES")
        End If
    End Sub
    Thanks

    Hi,
    I think, there's problem with getting the form object. Try this:
    Set oFrm = applic.Forms.GetFormByTypeAndCount(140, 1)
    Best regards,
    Mark

  • Adding data from one matrix to another

    Hay guys.I'm having trouble with adding data, that is situated in a Matrix on form A and bound to a userdatasource,
    to a Matrix on form B that is bound to a dbdatasource.
    For some reason the data either does not display at all, or it only displays the last records' data as many times
    as there are records in the original matrix from form A.
    Here's the code I've tried: (Displays only last record x times)
    For i = 1 To oMatrixSync.RowCount
    oFormTime.DataSources.DBDataSources.Item("@TB_TIMEDET").SetValue("U_Activity", _
                              oMatrixTime.RowCount, _
                              oFormSync.DataSources.UserDataSources.Item("U_Act").ValueEx)
    oMatrixTime.AddRow()
    next
    And this code displays zip:
    For i = 1 To oMatrixSync.RowCount
      oCheckBox = oMatrixSync.Columns.Item("c_Check").Cells.Item(i).Specific
      If oCheckBox.Checked = True Then
        oEditS = oMatrixSync.Columns.Item("c_Activity").Cells.Item(i).Specific
        oFormTime.DataSources.DBDataSources.Item("@TB_TIMEDET").SetValue("U_Activity", _
                   oMatrixTime.RowCount, _
                   oEditS.Value)
      oMatrixTime.AddRow()
      oMatrixTime.LoadFromDataSource()
    next
    Any help would be greatly appreciated, thanx all!
    Message was edited by: Tjaard Du Plessis

    Thanks, Jaro!
    You are right. The code should look like this:
    Dim oDBDSTime As DBDataSource = oFormTime.DataSources.DBDataSources.Item("@TB_TIMEDET")
    Dim oUDSSync As UserDataSource = oFormSync.DataSources.UserDataSources.Item("U_Act")
    For i = 1 To oMatrixSync.RowCount
    oMatrixSync.GetLineData(i)
    oDBDSTime.InsertRecord(i)
    oDBDSTime.SetValue("U_Activity", _
                        i, _
                        oUDSSync.ValueEx)
    Next
    oMatrixTime.LoadFromDataSource()
    Regards,
    Frank

  • Problems adding new rows to a simple user defined table manually

    Hi
    I have just created a user defined table ( SAP 2007 SP01 PL9 ) but when I try to add a line using tools ->userdefined tables I get the following error -
    conversion failed when converting the nvarchar value '-3 @GLMAP to data type int ( CINF )
    The table is called GLMAP and I simply added 3 alpha fields
    I  put 1 into all the fields on screen
    Can anyone suggest anything please as ideally I would like the end user to be able to update this simple table
    Many thanks
    Regards Andy

    Andy
    I think in your case you have used  DBDataSource to display data from UDT on your form. 
    Easyier to use UDO than User Defined Table, because you do not have to programming at UDO based forms.
    What István tried to say:
    Check your sp_transactionnotification procedure, maybe you have used @object_type variable as integer instead of nvarchar
    Regards
    J

  • How to avoid Flickaring  When Adding data in Addon User Matrix

    Experts,
    I am  Adding Query Result in User Matrix  one by one. but there is lots of Flicker.
    how to Avoid this Flickering.
    Bomiitems = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                                    If Bomtyp = "U" And BomNo = "0" Then
                                        BOMItem = "SELECT Distinct T0.[Code], T1.[ItemName] , ( 1 / Isnull(T2.[Qauntity],0))* Isnull((T0.[Quantity]),0),('" & Quanti & "'/ Isnull(T2.[Qauntity],0))* Isnull((T0.[Quantity]),0) as "
                                        BOMItem = BOMItem + " 'Quanti',T1.[Excisable],'N' as U_Rec , T1.[InvntryUom],T0.[Warehouse] 'Warehouse',T0.[IssueMthd]'IssMthd' FROM ITT1 T0  INNER JOIN OITM T1 "
                                        BOMItem = BOMItem + " ON T0.Code = T1.ItemCode  INNER JOIN OITT T2 ON T0.Father = T2.Code "
                                        BOMItem = BOMItem + " WHERE T0.[Father] ='" & Icode & "'"
                                        Bomiitems.DoQuery(BOMItem)
                                    ElseIf Bomtyp = "U" And BomNo <> "0" Then
                                        'BOMItem = "SELECT T0.[Code], T1.[ItemName] , ((T0.[Quantity]/ T2.[Qauntity])*'" & Quanti & "') as 'Quanti',T1.[Excisable],'N' as U_Rec FROM ITT1 T0  INNER JOIN OITM T1 ON T0.Code = T1.ItemCode  INNER JOIN OITT T2 ON T0.Father = T2.Code WHERE T0.[Father] ='" & Icode & "'"
                                        BOMItem = "SELECT T1.[U_Icode], T1.[U_IName],(1 / Isnull(Cast( T0.[U_Bqty]  as Float) ,0)) * Isnull(Cast(T1.[U_Quanti]  As Float),0) ,('" & Quanti & "' / Isnull(Cast( T0.[U_Bqty]  as Float) ,0)) * Isnull(Cast(T1.[U_Quanti]  As Float),0)  as 'Quanti',T2.[Excisable], T0.[U_Rec],T2.[InvntryUom] ,T1.[U_Whs] 'Warehouse','B' AS 'IssMthd' "
                                        BOMItem = BOMItem + "FROM [dbo].[@OITTA]  T0 inner join  [dbo].[@ITTA1]  "
                                        BOMItem = BOMItem + "T1 on t0.cODE = t1.Code INNER JOIN OITM T2 ON  T1.[U_Icode] = T2.[ItemCode]"
                                        BOMItem = BOMItem + " WHERE T0.[U_Icode] = '" & Icode & "' AND   T0.[U_AltBom] ='" & BomNo & "' AND T0.U_Btyp = 'U'  "
                                        Bomiitems.DoQuery(BOMItem)
                                    ElseIf Bomtyp = "P" Then
                                        BOMItem = "SELECT T1.[U_Icode], T1.[U_IName],(1 / Isnull(Cast( T0.[U_Bqty]  as Float) ,0)) * Isnull(Cast(T1.[U_Quanti]  As Float),0),('" & Quanti & "' / Isnull(Cast( T0.[U_Bqty]  as Float) ,0)) * Isnull(Cast(T1.[U_Quanti]  As Float),0)  as 'Quanti',T2.[Excisable], T0.[U_Rec] ,T2.[InvntryUom],T1.[U_Whs] 'Warehouse','B' AS 'IssMthd' "
                                        BOMItem = BOMItem + "FROM [dbo].[@OITTA]  T0 inner join  [dbo].[@ITTA1]  "
                                        BOMItem = BOMItem + "T1 on t0.cODE = t1.Code INNER JOIN OITM T2 ON  T1.[U_Icode] = T2.[ItemCode]"
                                        BOMItem = BOMItem + " WHERE T0.[U_Icode] = '" & Icode & "' AND   T0.[U_AltBom] ='" & BomNo & "' AND T0.U_Btyp = 'P' "
                                        Bomiitems.DoQuery(BOMItem)
                                    End If
                                        Bomiitems.DoQuery(BOMItem)
                                    If Bomiitems.RecordCount > 0 Then
                                        'RecCount1 = RecSet1.RecordCount
                                        Bomiitems.MoveFirst()
                                        i = 0
                                        'osubForm   .Freeze(True)
                                        oMatrix = oForm.Items.Item("1000001").Specific
                                        oMatrix.FlushToDataSource()
                                        While Not (Bomiitems.EoF)
                                            If i = 0 Then
                                                oMatrix.AddRow()
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("LineId", 0, i + 1)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_ItemCode", 0, Bomiitems.Fields.Item(0).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_ItemName", 0, Bomiitems.Fields.Item(1).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_BaseQty", 0, Bomiitems.Fields.Item(2).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_PlanQty", 0, Bomiitems.Fields.Item(3).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_IssueQty", 0, Bomiitems.Fields.Item(3).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_Whs", 0, Bomiitems.Fields.Item("Warehouse").Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_IsueType", 0, Bomiitems.Fields.Item("IssMthd").Value)
                                                Dim orsWhsDetails As SAPbobsCOM.Recordset
                                                Dim strWhsDetails As String
                                                orsWhsDetails = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                                                strWhsDetails = "SELECT T0.[OnHand], T0.[IsCommited], T0.[OnOrder],T1.[OnHand] FROM OITW T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode WHERE T0.[ItemCode] ='" & Bomiitems.Fields.Item(0).Value & "' AND   T0.[WhsCode] ='" & Bomiitems.Fields.Item("Warehouse").Value & "' "
                                                orsWhsDetails.DoQuery(strWhsDetails)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_Whsestk", 0, orsWhsDetails.Fields.Item(0).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_AVILSTK", 0, (orsWhsDetails.Fields.Item(0).Value - Bomiitems.Fields.Item(3).Value))
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_PLANTSTK", 0, orsWhsDetails.Fields.Item(3).Value)
                                                oMatrix.LoadFromDataSource()
                                            Else
                                                oMatrix.FlushToDataSource()
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").InsertRecord(i)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("LineId", i, i + 1)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_ItemCode", i, Bomiitems.Fields.Item(0).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_ItemName", i, Bomiitems.Fields.Item(1).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_BaseQty", i, Bomiitems.Fields.Item(2).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_PlanQty", i, Bomiitems.Fields.Item(3).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_IssueQty", i, Bomiitems.Fields.Item(3).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_Whs", i, Bomiitems.Fields.Item("Warehouse").Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_IsueType", i, Bomiitems.Fields.Item("IssMthd").Value)
                                                Dim orsWhsDetails As SAPbobsCOM.Recordset
                                                Dim strWhsDetails As String
                                                orsWhsDetails = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                                                strWhsDetails = "SELECT T0.[OnHand], T0.[IsCommited], T0.[OnOrder],T1.[OnHand] FROM OITW T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode WHERE T0.[ItemCode] ='" & Bomiitems.Fields.Item(0).Value & "' AND   T0.[WhsCode] ='" & Bomiitems.Fields.Item("Warehouse").Value & "' "
                                                orsWhsDetails.DoQuery(strWhsDetails)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_Whsestk", i, orsWhsDetails.Fields.Item(0).Value)
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_AVILSTK", i, (orsWhsDetails.Fields.Item(0).Value - Bomiitems.Fields.Item(3).Value))
                                                oForm.DataSources.DBDataSources.Item("@TPROD1").SetValue("U_PLANTSTK", i, orsWhsDetails.Fields.Item(3).Value)
                                                oMatrix.LoadFromDataSource()
                                            End If
                                            i = i + 1
                                            Bomiitems.MoveNext()
                                            oMatrix.LoadFromDataSource()
                                        End While
                                        oMatrix.LoadFromDataSource()
                                    End If
    Regards,
    Pravin Baji

    follow steps
    1)     Execute query so we can get data set
    2)     Clear matrix and data source (omatrix.clear(), oDBS.Clear())
    3)     Open loop
    4)     Insert record to oDBS using oDBS.InsertRecords(oDBS.Offset)
    5)     Then set value using oDBS.Setvalue(u2026u2026
    6)     Move next record
    7)     Finally close the loop
    8)     Matrix load from record set using oMatrix.LoadfromData()
    it will be work

  • DbDataSources and Form modes

    Hi, I have a little problem, i was reading in the forum, but nobody has the same problem, so, i have a form, with 2 dbdatasources, one to OITM, and the other to OITW, in the form load i use the query method over the oitm dbdatasource and oitw dbdatasource and works fine, but by default the form opens in Find Mode and it's fine, when I change to Add Mode, all the dbdatasources disappers, and the update method doesn't work, does anybody has the solution of that?
    i change the form mode to open in Add Mode but when I change to Find mode and the form works in the same way, dropping all the dbdatasources.
    Message was edited by: Rodmmy Ortiz

    Hey Rodmmy,
    By default Business one resets the dbdatasources when changing to add mode as it assumes a new record is being added.
    can you change the forms mode to add or OK mode first instead of find? and then populate the dbdatasource

  • Adding a row in matrix[Update Mode]

    Hi All,
    I am using a document type table, which has a matrix and i have created the UDO for dis. in Add mode its working properly. In update mode also its working properly but when i add a new row in the matrix its displaying the previous rows data n if i empty the fields and i tried to update then its showing the error like "This entry already exists in the following tables (ODBC -2035)  [Message 131-183]" .pls provide a solution for this.
    Regards,
    Vijay Kumar.

    Hi Vijay,
    You Can try this Code:
    oDBDataSource.Clear();
                                oMatrix.AddRow(1, oMatrix.RowCount);
    Here I am assuming that the matrix is bind with the DBDatasource.
    The whole point is that you have to Clear the Datasource before adding the new row, otherwise it will pickup the last supplied value from the Datasource.
    HTH
    Prashant Bansal

  • HOW TO use DBDataSource in this situation?

    hi all,
      I add a Matrix on system Form(eg:BOM Form),then I want to use Matrix.LoadFromDataSource() to load data.
    the simple code is :
    SAPbobsCOM.Recordset oRecordset = (SAPbobsCOM.Recordset)SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
                oRecordset.DoQuery("select ItemCode,ItemName from OITM ");
                SAPbouiCOM.Matrix oMatrix = (SAPbouiCOM.Matrix)m_SboForm.Items.Item("MatrixFormUID").Specific;
                    SAPbouiCOM.DBDataSource oDBData = m_SboForm.DataSources.DBDataSources.Item("tablename");//this dbdatasource is added before
                    oDBData.Clear();//error occur in this code:Operation is not supported in system Form
                    oRecordset.MoveFirst();
                    while (!oRecordset.EoF)
    oMatrix.LoadFromDataSource();
    how to use LoadFromDataSource() in this situation?if evaluate every control,the speed is too slow.
    thanks

    The quick way is as I wrote you - bind it to datasource (you fill it cell by cell). The code is something like:
    omatrix.Clear()
    oColumn = oColumns.Item("Column name 1")
    oColumn.DataBind.SetBound(True, "table name", "itemcode")
    oColumn = oColumns.Item("Column name 2")
    oColumn.DataBind.SetBound(True, "table name", "itemname")
    oMatrix.LoadFromDataSource();
    There isn`t necessary the while (!oRecordset.EoF) cycle

  • Problem to update UDO-recordsets using a matrix with DBDataSource

    Hello,
    I've got a problem with updating recordsets in an UDO-Table using DBDataSource.SetValue().
    Special szenario: I use a matrix bounded with DBDataSources. Adding new records and loading them via DBDataSource.Query() with conditions works fine. The UDO object type is "Document" without lines.
    In the simple way now I load just one record and after this I was trying to set an "message" to an simple, editable edittext-column via calling:
    oDBDataSource.SetValue("U_Message", 0, "Hello world");
    oMatrix.LoadFromDataSource();
    Now it's visible in the matrix.
    But when I call update via clicking the update-button, B1 do say, everything was ok (green status-message). Reloading this recordset you can see: it was not stored in the database
    Even not after:
    oMatrix.FlushToDataSource();
    As a workaround I do write the "message" via using Cell.Specific.
    Can anybody help me?
    I'am using SBO 2005 A SP 01 PL 39
    Edited by: Christian Bührig on Mar 18, 2008 4:48 PM

    look at
    New Row in Matrix is a Duplicate and Cannot update Object with new Row
    the next way is do it with recordset and directly insert to table.
    hope it helps
    Petr

  • Adding a row in Matrix

    Hi,
    I have a Form having matrix, and it is bind with 2 UDT Tables. One of 'Master Type' and Other is 'Master Data Lines'.
    All the operation 'ADD,UPDATE,FIND,DELETE, ADD ROW' and the operation for Navigation Buttons are working fine.
    But when I navigate to any previous record,following problem arises :
    1. When i add row to matrix it copies data from the previous row.
    2. Now after 1st operation i change the newly added row , due to this form goes in Update mode.It is also fine.But when i press the Update Button i get the message records updated successfully, but the problem is newly added row in the matrix does not inserted in DataBase
    I need the solution for both problems.
    Thanks in advance.

    Here some sample I used to test it:
    Case SAPbouiCOM.BoEventTypes.et_KEY_DOWN
                            Dim l_Mat As SAPbouiCOM.Matrix
                            l_Mat = oForm.Items.Item("Matrix2").Specific
                            If pVal.CharPressed = 13 And (pVal.Row = l_Mat.RowCount) Then
                                Dim _UDSS As SAPbouiCOM.UserDataSources
                                ' Clear the UDS before adding a new line
                                _UDSS = oForm.DataSources.UserDataSources
                                UDSS.Item("UDSCode").ValueEx = ""
                                UDSS.Item("UDSName").ValueEx = ""
                                UDSS.Item("UDSPhone").ValueEx = ""
                                l_Mat.AddRow()
                            End If
    If you are using DBDatasources is easier (1st post)
    Regards,
    Felipe

  • Matrix multiple rows adding problem

    Hi all,
    In a SDK developed form, have a button "Add Row". When press Add Row a new row has to be added in the matrix.
    I' ve written the set of codes as
    Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
            Dim oitem As SAPbouiCOM.Item
            Try
                If (FormUID = "Frm_itemsupplier") Then
                    If (pVal.Before_Action = False) Then
                        'Add Row
                        If (pVal.ItemUID = "AddRow") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Then
                            Dim f As SAPbouiCOM.Form
                            Dim oMatrix As SAPbouiCOM.Matrix
                            f = SBO_Application.Forms.Item(FormUID)
                            oMatrix = f.Items.Item("mat1").Specific
                            f.DataSources.DBDataSources.Item(1).Clear()
                            oMatrix.AddRow(1)
                        End If
    But at run time, when press Add row button first time this will add one row.  Then I cancel the form, open the same form then press add row Button, 1+1 rows are adding in the matrix. If I do the above(cancel and open the form again), keep on increasing rows additionally on every time.
    Let me get a solution how to solve the issue and I will be appreciated.
    Thanks & regards,
    Venkatesan g.

    try it as
    Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
    Dim oitem As SAPbouiCOM.Item
    Try
    If (FormUID = "Frm_itemsupplier") Then
    If (pVal.Before_Action = False) Then
    'Add Row
    If (pVal.ItemUID = "AddRow") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Then
    Dim f As SAPbouiCOM.Form
    Dim oMatrix As SAPbouiCOM.Matrix
    f = SBO_Application.Forms.Item(FormUID)
    oMatrix = f.Items.Item("mat1").Specific
    f.DataSources.DBDataSources.Item(1).Clear()
                        Dim cell As SAPbouiCOM.Cell
                        Dim col As SAPbouiCOM.Column
                        Dim ed As SAPbouiCOM.EditText
                        col = omatrix1.Columns.Item(1)
                        cell = col.Cells.Item(1)
                        ed = cell.Specific
                        if ed.String <> "" then
    oMatrix.AddRow(1,0)
    end if
    End If
    this will test before addrow if there exist blank first row and in case that no, it will add new row. The sample test for column index 1 and first row.
    Hope it`s what you need.

  • Problem with adding a mak to image

    im having problems adding a mask to an image and am following
    the instructions from
    http://www.adobe.com/support/dreamweaver/programs/mx_banner/mx_banner04.html
    when holding shift to drag over the picture nothing happens,
    although i can drag the marker across the image without holding
    shift but once i let go of the mouse button the image dissapears
    and the background is made into a gradiant. any help would be
    greatly apreciated?

    This is a good question and unfortunately one that I don't think has an easy answer.
    Your best bet is to hide the current matrix, and create a new matrix with your new column and then copy the information in the original matrix into the new matrix.
    Hopefully in the future we will be able to
    matrix.clear()
    and then when we have added our new column
    then we can go
    dbDataSource.query()
    and the system matrix will be refilled from the dbDataSource.
    Hope this has helped,
    Cormac

  • Invalid Column Error while Adding Matrix

    Hi,
    I am getting an error Invalid Column 66000-16 while adding line to my matrix, can you tell what i am doing wrong here...
    Private Sub Addline(ByVal oMatrix As SAPbouiCOM.Matrix) 'ByVal strTab As String
            Try
                If (oForm.Mode <> SAPbouiCOM.BoFormMode.fm_FIND_MODE) Then
                    'Adding a row to the matrix
                    oForm.Freeze(True)
                    oMatrix.AddRow(1, oMatrix.RowCount)
                    oMatrix.Columns.Item("Col_Coderg").Cells.Item(oMatrix.RowCount).Click(SAPbouiCOM.BoCellClickType.ct_Regular)
                    intLineIdRG = IIf(oMatrix.RowCount = 0, 1, oMatrix.RowCount)
                    oEditTextf = oMatrix.Columns.Item("Col_frgp").Cells.Item(oMatrix.RowCount).Specific
                    oEditTextf.Value = intLineIdRG
                    oMatrix.Columns.Item("Col_Descrg").Cells.Item(oMatrix.RowCount).Specific.value = ""
                    oMatrix.Columns.Item("Col_Qtyrg").Cells.Item(oMatrix.RowCount).Specific.value = ""
                    oMatrix.Columns.Item("Col_edt").Cells.Item(oMatrix.RowCount).Specific.value = ""
                    oMatrix.Columns.Item("Col_adt").Cells.Item(oMatrix.RowCount).Specific.value = ""
                    oMatrix.Columns.Item("Col_Remrg").Cells.Item(oMatrix.RowCount).Specific.value = ""
                    oForm.Freeze(False)
                End If
            Catch ex As Exception
                ShowErrorMsg(ex.ToString)
            End Try
        End Sub
    Regards
    John

    HI,
    try to set values in matrix as below
    objMatrix = objForm.Items.Item("matrixID").Specific
    Dim oDBs_Detail As SAPbouiCOM.DBDataSource
    oDBs_Detail = objForm.DataSources.DBDataSources.Item("TABLENAME")
    oDBs_Detail.Offset = pVal.Row - 1
    oDBs_Detail.SetValue("COLUMN_UDF1", oDBs_Detail.Offset, VALUE_TO_SET)
    oDBs_Detail.SetValue("COLUMN_UDF2", oDBs_Detail.Offset, VALUE_TO_SET)
    oDBs_Detail.SetValue("COLUMN_UDF3", oDBs_Detail.Offset, VALUE_TO_SET)
    objMatrix.SetLineData(pVal.Row)
    objMatrix.FlushToDataSource()
    regards:
    Sandy

  • Adding a Multiple Rows Without Clearing Previous Row Details

    Dear All,
    I want to Add multiple rows at the same time in a matrix at the same time .My problem here is When i add the New rows to the matrix already added data need to remail in the matrix , I cant put Matrix.Clear or Datasource.clear.
    When   i add multiple rows previous row details is duplicated to next rows how to avoid thus
    Mohamed

    Hi,
    try this,
    If (pVal.ItemUID = "BTNUID") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Then
                            Dim fr As SAPbouiCOM.Form
                            Dim sel As Integer
                            Dim oMatrix1 As SAPbouiCOM.Matrix
                            fr = SBO_Application.Forms.Item(FormUID)
                            oMatrix1 = fr.Items.Item("mtx_136").Specific
                            fr.DataSources.DBDataSources.Item(2).Clear()
                            sel = oMatrix1.GetNextSelectedRow
                            oMatrix1.AddRow(1, sel)
                        End If
    "mtx_136" is your matrix ID
    and "BTNUID" is your button ID

  • DBDataSources not up to date in system form

    Hi guys,
    I really need you help on a issue.
    I'm trying to read all records in the matrix of the Sales Order (System Form)
    Now i'm using the datasource (DBDataSource) of this form to get the values, because this is faster then getting the values from the matrix.
    I run the following code on the before et_CLICK event on the Update Button. And i get this message:
    Data Source - Bad Data Source Offset at SAPbouiCOM.DBDataSourceClass.GetValue(Objext Index, Int32 RecorNumber)
    This issue seems to occure when i duplicate or add some lines and hit the Update Button. The amount of lines in the datasource is still the same as when i opened the Sales Order. But the number of records in the matrix is larger. So it seems that the datasource has not been updated when i added the lines.
    Does anyone has a solution for this?
    //Cache the document matrix
          SalesOrderCached salesOrderCached = new SalesOrderCached();
          ui.Matrix mtx = (ui.Matrix)form.Items.Item(SBO_FormTypes.Document.ItemMatrix.VALUE).Specific;
          ui.DBDataSource dataSource = form.DataSources.DBDataSources.Item("ORDR");
          ui.DBDataSource dataSourceLines = form.DataSources.DBDataSources.Item("RDR1");
          salesOrderCached.DocNum = dataSource.GetValue("DocNum", 0);
          salesOrderCached.CardCode = dataSource.GetValue("CardCode", 0);
          for (int i = 1; i < mtx.RowCount; i++)
            mtx.GetLineData(i);
            SalesOrderLineCached salesOrderLine = new SalesOrderLineCached();
            salesOrderLine.LineNum = i;
            salesOrderLine.ItemCode = dataSourceLines.GetValue("ItemCode", i -1).Trim();
            salesOrderLine.WarehouseCode = dataSourceLines.GetValue("WhsCode", i -1).Trim();
            salesOrderLine.LineTotal = Convert.ToDouble(dataSourceLines.GetValue("LineTotal", i -1).Trim(), NumberFormatInfo.InvariantInfo);
            salesOrderCached.SalesOrderLinesCached.Add(salesOrderLine);
          return salesOrderCached;

    Unfortunately not.
    the only thing I can think of trying is using the GetCellSpecific method of the matrix object. I have never used it but I see in the helpfile SAP say "This is the recommended way to get the contents of a cell."
    Worth a try but highly unlikely to work would be to use matrix.FlushToDataSouce().... but I would bet it won't work unless it's a user defined item. A similar method would be "GetLineData()"
    So I think it will be either GetCellSpecific to see if it improves performance or some sort of workaround
    EDIT: Actually, maybe try SerializeAsXML. It will be extra development time but bound to be faster.

Maybe you are looking for

  • SSRS 2012 Subscription Error in Test Environment

    Hi All, I was trying to set-up Email Subscription for SSRS in my Test Environment using "Reporting Services Configuration Manager" and after providing SMTP server details. I was getting error "Failed to sent Email to [email protected]" What could be

  • Strange bug: Acrobat 9 deletes words upon conversion from Word doc

    Situation: converting from MS Word 2007 (SP2) to Acrobat 9 Standard (v 9.2.0) in WinXP. I've tried this repeatedly. The first word in multiple headings disappear when converted to PDF (they remain in the Word doc, but don't exist in the PDF that was

  • How to use the dynamical or static variable for ESSBASE cube name?

    Hi Experts, When I import ESSBASE Cube into physical layer, the cube name from ESSBASE is created automatically, such as H_Sales. I want to use the the static or dynamical variable for replacing the external name. So I try to create the static variab

  • Dynamic dropdown in Acrobat?

    Small business owner. Trying to create dynamic dropdowns in pdf that I open and fill with an ipad for on-site estimates. I know nothing about java, but I need a dropdown box that repopulates after a different one has a value selected: ie, Box one is

  • Finder log files?

    Hi, a few days ago I read something about Finder logging everything you do (such as creating new folders, renaming them, selecting them and so on). I was (and still am) wondering if this is true? I've tried to find this log file with the Console but