Filling matrix with Dummy Data

I am doing a demo screen for a client and I need to fill a matrix with hard coded data. I followed the sample code and I have the following code but it is not working for me (it throws a matrix-line exists exception):
// Now get the matrix Item.
SAPbouiCOM.Item matrixItem  = oForm.Items.Item("v33_Grid");
theMatrix = (SAPbouiCOM.Matrix) matrixItem.Specific;
Form.Freeze(true);
SAPbouiCOM.UserDataSource uds;
uds = oForm.DataSources.UserDataSources.Add("salesUds",SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 10);
theMatrix.AddRow(1, theMatrix.RowCount);
SAPbouiCOM.Column     col      = null;
// Ready Matrix to populate data
theMatrix.AutoResizeColumns();
col = theMatrix.Columns.Item("desc1");
col.DataBind.SetBound(true, "", "salesUds");
uds.Value = "Test description";
// setting the user data source data
theMatrix.LoadFromDataSource();
oForm.Freeze(false);
oForm.Update();     
I really need to get this working. ANyone got any ideas what I am doing wrong?

Hi Laura,
You should use theMatrix.SetLineData() which is the avaiable statement for user matrixes.
Here is some code that loads a form with a matrix from an XML. This way you can edit form values in the XML, instead of hard coding.
Dim oXMLDoc1 As Xml.XmlDocument = New Xml.XmlDocument
oXMLDoc1.Load("C:BaseForm.xml")
App.LoadBatchActions(oXMLDoc1.InnerXml)
Dim oForm As SAPbouiCOM.Form = App.Forms.GetForm("ITA0002", 1)
Dim oMatrix As SAPbouiCOM.Matrix = oForm.Items.Item("5").Specific()
Dim Informes As SAPbouiCOM.UserDataSource = oForm.DataSources.UserDataSources.Item("Informes")
Dim ID As SAPbouiCOM.UserDataSource = oForm.DataSources.UserDataSources.Item("ID")
Dim i As Int16 = 1
oMatrix.AddRow(ListaInformes.Length)
For Each Informe As String In NameList
   Informes.ValueEx = Informe
   ID.ValueEx = i.ToString
   oMatrix.SetLineData(i)
   i = i + 1
Next
The xml is this one:
<?xml version="1.0" encoding="UTF-16"?>
<Application>
     <forms>
          <action type="add">
               <form AutoManaged="1" BorderStyle="4" FormType="ITA0002" ObjectType="-1" SupportedModes="1" appformnumber="ITA0002" client_height="284" client_width="291" color="0" default_button="1" height="316" left="363" mode="1" pane="1" title="Informes" top="149" type="4" visible="1" width="297">
                    <datasources>
                         <userdatasources>
                              <action type="add">
                                   <datasource size="254" type="9" uid="Informes"></datasource>
                              </action>
                              <action type="add">
                                   <datasource size="10" type="9" uid="ID"></datasource>
                              </action>
                         </userdatasources>
                    </datasources>
                    <items>
                         <action type="add">
                              <item AffectsFormMode="1" backcolor="-1" description="" disp_desc="0" enabled="1" font_size="0" forecolor="0" from_pane="0" height="19" left="6" linkto="" right_just="1" supp_zeros="0" tab_order="10" text_style="0" to_pane="0" top="260" type="4" uid="1" visible="1" width="65">
                                   <AutoManagedAttribute></AutoManagedAttribute>
                                   <specific caption="OK"></specific>
                              </item>
                              <item AffectsFormMode="1" backcolor="-1" description="" disp_desc="0" enabled="1" font_size="0" forecolor="0" from_pane="0" height="19" left="77" linkto="" right_just="1" supp_zeros="0" tab_order="20" text_style="0" to_pane="0" top="260" type="4" uid="2" visible="1" width="65">
                                   <AutoManagedAttribute></AutoManagedAttribute>
                                   <specific caption="Cancelar"></specific>
                              </item>
                              <item AffectsFormMode="1" backcolor="-1" description="" disp_desc="0" enabled="1" font_size="0" forecolor="-1" from_pane="0" height="20" left="5" linkto="" right_just="0" supp_zeros="0" tab_order="0" text_style="0" to_pane="0" top="5" type="99" uid="3" visible="1" width="80">
                                   <AutoManagedAttribute></AutoManagedAttribute>
                                   <specific AffectsFormMode="1" caption="Informes" val_off="0" val_on="1">
                                        <databind alias="Informes" databound="1" table=""></databind>
                                   </specific>
                              </item>
                              <item AffectsFormMode="1" backcolor="-1" description="" disp_desc="0" enabled="1" font_size="0" forecolor="-1" from_pane="1" height="224" left="8" linkto="" right_just="0" supp_zeros="0" tab_order="60" text_style="0" to_pane="1" top="28" type="127" uid="5" visible="1" width="276">
                                   <AutoManagedAttribute></AutoManagedAttribute>
                                   <specific SelectionMode="2" layout="0" titleHeight="0">
                                        <columns>
                                             <action type="add">
                                                  <column AffectsFormMode="1" backcolor="-1" description="" disp_desc="0" editable="0" font_size="12" forecolor="-1" right_just="0" text_style="0" title="2" type="16" uid="2" val_off="N" val_on="Y" visible="1" width="20">
                                                       <databind alias="ID" databound="1" table=""></databind>
                                                       <ExtendedObject></ExtendedObject>
                                                  </column>
                                                  <column AffectsFormMode="1" backcolor="-1" description="" disp_desc="0" editable="0" font_size="12" forecolor="-1" right_just="0" text_style="0" title="Nombre" type="16" uid="1" val_off="" val_on="" visible="1" width="255">
                                                       <databind alias="Informes" databound="1" table=""></databind>
                                                       <ExtendedObject></ExtendedObject>
                                                  </column>
                                             </action>
                                        </columns>
                                   </specific>
                              </item>
                         </action>
                    </items>
                    <items>
                         <action type="group">
                              <item uid="3"></item>
                              <item uid="4"></item>
                         </action>
                    </items>
                    <FormMenu></FormMenu>
                    <DataBrowser></DataBrowser>
               </form>
          </action>
     </forms>
</Application>
Regards,
Ibai Peñ

Similar Messages

  • Idoc with dummy data

    Dear All,
    Can you please send to me an Idoc (xml format) with dummy data for one of the following masterdata (MATMAS05, CREMDM04, DEBMDM06 ...) because I have MDM but I do not have any backend system (R/3, CRM..)
    My email addres is [email protected]
    Points will be awarded.
    Kind regards,
    NL

    Hi,
    one more delivered
    did you get this one too?
    Regards,
    Michal

  • How to fill matrix with the output of recordset query?

    Hi all,
    I want a user matrix to load data when I hit a button and the data to be filled is the output of an sql query. binding the matrix columns with table columns and then load the matrix with DBDatasource attached to that table will not do in this case as the columns in the sql query are from several different tables or views. 
    writing following line to do this takes several minutes to load the data:
    For j = 0 To Reordset.RecordCount - 1
    Matrix.AddRow()
    Matrix.Columns.Item("col1").Cells.Item(i).Specific.value =  Recordset.Fields.Item("cardcode").Value
    Recordset.movenext()
    next
    Is there any other way to fill the matrix in this case, which loads the data faster?
    Regards,

    Hello Binita,
    I've tested the CFL for DataTable-Matrixes in my test-AddOn. But there's still one problem left. Maybe you find it out (I will need this in the future too...).
    The ChooseFromList must be added behind the DataTable-Bind, which is done on every MTX-Load (it's not from the sample above, so the UIDs are new ones):
                oDt = oDts.Item("dt_test")
                query = "SELECT  * FROM [@T_CONVTOOLS01]"
                oDt.ExecuteQuery(query)
                oMtx.Columns.Item("0").DataBind.Bind("dt_test", "Code")
                oMtx.Columns.Item("1").DataBind.Bind("dt_test", "U_Alpha01")
                oMtx.Columns.Item("2").DataBind.Bind("dt_test", "U_Price01")
                oMtx.Columns.Item("3").DataBind.Bind("dt_test", "U_Quant01")
                oMtx.Columns.Item("4").DataBind.Bind("dt_test", "U_Date01")
                AddChooseFromLists()
                oMtx.LoadFromDataSource()
    ...where AddChooseFromLists() is...
      Private Shared Sub AddChooseFromLists()
            Try
                Dim oCfls As SAPbouiCOM.ChooseFromListCollection
                Dim oCons As SAPbouiCOM.Conditions
                Dim oCon As SAPbouiCOM.Condition
                Dim oCfl As SAPbouiCOM.ChooseFromList
                Dim oCflCreationParams As SAPbouiCOM.ChooseFromListCreationParams
                Dim oBtn As SAPbouiCOM.Button
                Dim oMtx As SAPbouiCOM.Matrix
                Dim oCol As SAPbouiCOM.Column
                Dim oEtx As SAPbouiCOM.EditText
                oMtx = oForm.Items.Item("MTX_TEST02").Specific
                oCfls = oForm.ChooseFromLists
                oCflCreationParams = SboCon.SboUI.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
                oCflCreationParams.MultiSelection = False
                oCflCreationParams.ObjectType = SAPbouiCOM.BoLinkedObject.lf_BusinessPartner
                oCflCreationParams.UniqueID = "CFL_C1"
                oCfl = oCfls.Add(oCflCreationParams)
                '### OPTION:
                '# Shown ChooseFromList restricted by Conditions
                oCons = oCfl.GetConditions()
                oCon = oCons.Add()
                oCon.Alias = "CardType"
                oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
                oCon.CondVal = "C"
                oCfl.SetConditions(oCons)
                oCol = oMtx.Columns.Item("1")
                oCol.ChooseFromListUID = "CFL_C1"
                oCol.ChooseFromListAlias = "CardCode"
            Catch e As Exception
                Microsoft.VisualBasic.MsgBox(className & ".AddChooseFromLists()" & vbCrLf & "Exception:" & vbCrLf & e.Message.ToString)
            End Try
        End Sub
    But I'm running into problems when trying to set the MTX-Cell via DataTable at the CFL-Event (see comment):
                If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
                    Dim oMtx As SAPbouiCOM.Matrix
                    Dim oCFLEvent As SAPbouiCOM.IChooseFromListEvent
                    Dim oCFL As SAPbouiCOM.ChooseFromList
                    Dim oDataTable As SAPbouiCOM.DataTable
                    Dim cflID As String
                    Dim oDt As SAPbouiCOM.DataTable = oForm.DataSources.DataTables.Item("dt_test")
                    oCFLEvent = pVal
                    cflID = oCFLEvent.ChooseFromListUID
                    'Dim oForm As SAPbouiCOM.Form
                    'oForm = SboConnection.SboUI.Forms.Item(FormUID)
                    oCFL = oForm.ChooseFromLists.Item(cflID)
                    If Not oCFLEvent.BeforeAction Then
                        oDataTable = oCFLEvent.SelectedObjects
                        If oDataTable Is Nothing Then Exit Sub
                        '############## Matrix Test #######################################################################
                        If (oCFLEvent.ItemUID = "MTX_TEST02") Then
                            oMtx = oForm.Items.Item("MTX_TEST02").Specific
                            '### CFL Results to UserForm
                            oDt.Rows.Offset = oCFLEvent.Row - 1
                            MsgBox(oDt.GetValue("U_Alpha01", oCFLEvent.Row - 1))
                            MsgBox(oDataTable.GetValue("CardCode", 0))
                            ' PROBLEM - can't get this working - don't know at the moment:
                            ' on other forms SetValue works....
                            oDt.SetValue("U_Alpha01", oCFLEvent.Row - 1, oDataTable.GetValue("CardCode", 0))
                            ' this also gives me problems...:
                            'oMtx.Columns.Item("1").Cells.Item(oCFLEvent.Row).Specific.value = oDataTable.GetValue("CardCode", 0)
                            oForm.Update()
                        End If
                    End If
                End If
    The CFL-Form opens and returns the choosen value(s) at the CFL-event. But writing to MTX still not works with this code...
    Maybe you find the last piece. If so: please write here.
    Cheers,
    Roland
    p.s.:
    David Nussböck wrote
    LOL - ROLAND WAS FASTER ))
    ...just one minute...

  • Accounting Log filling up with useless data

    I am getting my ACS Accounting logs filled with useless data from about 12 devices. I think I have found the cause - I just don't know how to fix it.
    The accounting data has a username we have not used for months, and I stumbled upon this by looking at various show commands on the devices that are causing the problem.
    When I do a "sh aaa sessions", I see this:
    CE-WIN-IDF16-3750-Stack1#sh aaa session
    Total sessions since last reload: 189
    Session Id: 1
       Unique Id: 127
       User Name: *not available*
       IP Address: 0.0.0.0
       Idle Time: 0
       CT Call Handle: 0
    Session Id: 354
       Unique Id: 263
       User Name: cenetmgmt
       IP Address: 10.62.7.15
       Idle Time: 0
       CT Call Handle: 0
    Session Id: 626
       Unique Id: 410
       User Name: leehoyle
       IP Address: 10.62.7.15
       Idle Time: 0
       CT Call Handle: 0
    I would LOVE to get rid of that Session ID: 354 if I could. I can't seem to find a suitable "clear" command. Any help out there?
    Thansk in advance!
    Lee Hoyle

    I am not trying to access anything I keep getting the message that my cloud is full than go to it to find that is is full of things from my computer and pictures from the Sims game spent 3 hours yesterday as it kept telling me that Verizon was not available. Why is my cloud not backing up my phone but randomly backing up my computer which I do not need. This is using the desktop Icon. I have not even opened it on my desktop until I tried to delete the stuff on it it did this on its own.

  • Loading a grid or matrix with external data

    Hi, we have two SAP companies defined, from one company I need to perform a search on the second company and provide a grid or a matrix with the results.
    We are using the 2007 SDK is it possible to do this?
    Many thanks.
    Mike.

    i think you can use the Recordset object like "oRs.DoQuery("select [company2].dbo.table.....

  • DI UI : fill matrix with a query from user table data

    hello,
    I create a user table.
    I want to fill a matrix on a form with some aggregated data of this user table.
    I do :
    Public Sub SetMatrixRep()
      Dim oRecordSet As SAPbobsCOM.Recordset
      Dim oCentre As SAPbouiCOM.EditText
      Dim oCompte As SAPbouiCOM.EditText
      Dim oBudget As SAPbouiCOM.EditText
      Dim oDepense As SAPbouiCOM.EditText
      Dim oSolde As SAPbouiCOM.EditText
      Dim i As Long
      i = 0
      Set oRecordSet = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
      oRecordSet.DoQuery ("select * from [@CAP_OPRC_BUDGET]")
      While oRecordSet.EOF = False
        ' filling the matrix
        Set oCentre = oMatrixRep.Columns("clCentre").Cells.Item(i).Specific
        oCentre.String = oRecordSet.Fields.Item(0).Value
        'oMatrixRep.Columns("clCentre").Cells(1).Specific.String = oRecordSet.Fields.Item(0).Value
        'SBO_Application.MessageBox (oRecordSet.Fields.Item(0).Value)
        oMatrixRep.AddRow
        oRecordSet.MoveNext
        i = i + 1
      Wend
    End Sub
    I've got an error : Row - Index invalid.
    Could you help me please ?
    Thanks.
    Romeo.

    Hi
    This is a routine that I call from my Item Event handler
    Hope it can help you
    Public Sub PopolaMatrice(oApplicazione As SAPbouiCOM.Application, pVal As SAPbouiCOM.IItemEvent)
        Dim oForm               As SAPbouiCOM.Form
        Dim oMatrix             As SAPbouiCOM.Matrix
        Dim oDBDataSource       As SAPbouiCOM.DBDataSource
        Dim oConditions         As New SAPbouiCOM.Conditions
        Dim oCondition          As SAPbouiCOM.Condition
        Dim oDocNum             As SAPbouiCOM.EditText
        Dim lIndice             As Long
        Set oForm = oApplicazione.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
        Set oDBDataSource = oForm.DataSources.DBDataSources.Item("MyUserTableName")
        Set oMatrix = oForm.Items("MyMatrixName").Specific
        oMatrix.Clear
        'setting the condition object
        'this is equal to the following SQL statement
        'WHERE UserFieldName1 = "MyCriteria1" and UserFieldName2 = "MyCriteria2"
        Set oCondition = oConditions.Add()
        oCondition.BracketOpenNum = 2
        oCondition.Alias = "UserFieldName1"
        oCondition.Operation = co_EQUAL
        oCondition.CondVal = "MyCriteria1"
        oCondition.BracketCloseNum = 1
        oCondition.Relationship = cr_AND
        Set oCondition = oConditions.Add()
        oCondition.BracketOpenNum = 1
        oCondition.Alias = "UserFieldName2"
        oCondition.Operation = co_EQUAL
        oCondition.CondVal ="MyCriteria2"
        oCondition.BracketCloseNum = 2
        oDBDataSource.Query oConditions
        'filling the matrix
        For lIndice = 0 To oDBDataSource.Size - 1
            oDBDataSource.Offset = lIndice
            oMatrix.AddRow
        Next lIndice
    End Sub

  • Fill matrix with datasource

    Hi,
    i created an empty matrix on a form and i am trying to fill data in it with recordset ans userdatsource.
    I tested my recrdset query and it is working but my matrix want show me data when the form is loaded.
    this is my code :
    public static void FillUserDataSource()
                Globals.TestRecordSet = (SAPbobsCOM.Recordset)    Globals.company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
                Globals.TestRecordSet.DoQuery(("SELECT DocNum,ORDR.CardCode,City FROM ORDR,OCRD WHERE ORDR.CardCode=OCRD.CardCode"));
                if (Globals.TestRecordSet.RecordCount != 0)
                    Globals.TestRecordSet.MoveFirst();
                    while (!Globals.TestRecordSet.EoF)
                        for (int i = 0; i < 3; i++)
                            Globals.TestForm.DataSources.UserDataSources.Item(i).ValueEx = (string)Globals.TestRecordSet.Fields.Item(i).Value;
                        Globals.ComMatrix.AddRow(1,0);
                        Globals.TestRecordSet.MoveNext();
    Thanks for your help.

    hi,
    i tried your code and it is the same it wont display.
    i ll show you all my code .
    using System;
    using System.Collections.Generic;
    using System.Text;
    namespace FormsTest
        public class FormOp
            public FormOp(string filename, string formid)
                DrawForm(filename, formid);
                AddDatasourceToForm();
                DataBindToForm();
                FillUserDataSource();
            public static void DrawForm(string filename, string formid)
                XmlOperations.LoadFromXml(filename);
                try
                    Globals.TestForm = Globals.sboApplication.Forms.Item(formid);
                catch (Exception e)
                    Globals.sboApplication.MessageBox(e.Message, 1, "OK", "", "");
                Globals.TestItem = Globals.TestForm.Items.Item("dteliv");
                Globals.DatLivText = (SAPbouiCOM.EditText)Globals.TestItem.Specific;
                Globals.TestItem = Globals.TestForm.Items.Item("pcom");
                Globals.PoidCom = (SAPbouiCOM.EditText)Globals.TestItem.Specific;
                Globals.TestItem = Globals.TestForm.Items.Item("pcomrest");
                Globals.PoidComRestant = (SAPbouiCOM.EditText)Globals.TestItem.Specific;
                Globals.TestItem = Globals.TestForm.Items.Item("pchar");
                Globals.PoidChar = (SAPbouiCOM.EditText)Globals.TestItem.Specific;
                Globals.TestItem = Globals.TestForm.Items.Item("pcharrest");
                Globals.PoidCharRestant = (SAPbouiCOM.EditText)Globals.TestItem.Specific;
                Globals.TestItem = Globals.TestForm.Items.Item("matcom");
                Globals.ComMatrix = (SAPbouiCOM.Matrix)Globals.TestItem.Specific;
                Globals.TestItem = Globals.TestForm.Items.Item("matcom1");
                Globals.Com1Matrix = (SAPbouiCOM.Matrix)Globals.TestItem.Specific;
                Globals.TestItem = Globals.TestForm.Items.Item("matstock");
                Globals.StockMatrix = (SAPbouiCOM.Matrix)Globals.TestItem.Specific;
                Globals.TestItem = Globals.TestForm.Items.Item("matstock1");
                Globals.Stock1Matrix = (SAPbouiCOM.Matrix)Globals.TestItem.Specific;
                Globals.TestItem = Globals.TestForm.Items.Item("matveh");
                Globals.VehiculMatrix = (SAPbouiCOM.Matrix)Globals.TestItem.Specific;
                Globals.TestItem = Globals.TestForm.Items.Item("matveh1");
                Globals.Vehicul1Matrix = (SAPbouiCOM.Matrix)Globals.TestItem.Specific;
                Globals.TestItem = Globals.TestForm.Items.Item("creeliv");
                Globals.CreerLiv = (SAPbouiCOM.Button)Globals.TestItem.Specific;
                Globals.TestItem = Globals.TestForm.Items.Item("interr");
                Globals.Interr = (SAPbouiCOM.Button)Globals.TestItem.Specific;
                Globals.TestItem = Globals.TestForm.Items.Item("NComCol");
                Globals.NComCol = (SAPbouiCOM.Column)Globals.TestItem.Specific;
                Globals.TestItem = Globals.TestForm.Items.Item("NomClCol");
                Globals.NomClCol = (SAPbouiCOM.Column)Globals.TestItem.Specific;
                Globals.TestItem = Globals.TestForm.Items.Item("PoComCol");
                Globals.PoComCol = (SAPbouiCOM.Column)Globals.TestItem.Specific;
                Globals.TestItem = Globals.TestForm.Items.Item("VilLivCol");
                Globals.VilLivCol = (SAPbouiCOM.Column)Globals.TestItem.Specific;
                Globals.TestItem = Globals.TestForm.Items.Item("VolComCol");
                Globals.VolComCol = (SAPbouiCOM.Column)Globals.TestItem.Specific;
            public static void AddDatasourceToForm()
                SAPbouiCOM.UserDataSource oUserDataSource;
                oUserDataSource = Globals.TestForm.DataSources.UserDataSources.Add("ComDataSource", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 20);
            public static void DataBindToForm()
                Globals.NomClCol.DataBind.SetBound(true, "", "ComDataSource");
                Globals.NomClCol.DataBind.SetBound(true, "", "ComDataSource");
                Globals.VilLivCol.DataBind.SetBound(true, "", "ComDataSource");
                Globals.PoComCol.DataBind.SetBound(true, "", "ComDataSource");
                Globals.VolComCol.DataBind.SetBound(true, "", "ComDataSource");
            public static void FillUserDataSource()
                Globals.TestRecordSet = (SAPbobsCOM.Recordset)Globals.company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
                Globals.TestRecordSet.DoQuery(("SELECT DocNum,ORDR.CardCode,City FROM ORDR,OCRD WHERE ORDR.CardCode=OCRD.CardCode"));
                if (Globals.TestRecordSet.RecordCount != 0)
                    Globals.TestRecordSet.MoveFirst();
                    while (!Globals.TestRecordSet.EoF)
                        Globals.ComMatrix.AddRow(1, 0);
                        for (int i = 0; i < 3; i++)
                            Globals.TestForm.DataSources.UserDataSources.Item(i).ValueEx = (string)Globals.TestRecordSet.Fields.Item(i).Value;
                        Globals.ComMatrix.SetLineData(Globals.ComMatrix.RowCount);
                        Globals.TestRecordSet.MoveNext();

  • Fill matrix with query

    Hi,
    I have a query that I want to display in a matrix. The query is based on the tables: OINV, INV1, OITM, OCRD. I would like to know what is the best way to bind this query to a matrix? Should I create a recordset with the query and iterate it and fill the matrix line by line and column by columns, or can I use something like a datasource with query (even if there are more than one table) and bind it?
    And also, can I create this query using the DI API (I haven't worked with it so far) or do I have to create it myself (my own SELECT)?
    Thank you so much,
    Irina

    hi,
    create one temporary table called TEMP with all necessary fields which u r going to insert in Matrix.
    Use the following code.
    delete the existing values in @TEMP table
    RS = Nothing
                    RS = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                    RS.DoQuery("Select * from OITM,OITW,ITT1 where Conditions")
    For i as integer = 1 To RS.RecordCount
    RS1 = Nothing
    RS1 = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
    RS1.DoQuery("INSERT INTO [@TEMP](DocEntry,U_X,U_Y,U_Z)values(" & i & "," & RS.Fields.Item("ItemCode").Value & "','" & RS.Fields.Item("Quantity").Value & "','" & RS.Fields.Item("UoM").Value & "')")
    End If
                    DSource = Nothing
                    oMatrix = oForm.Items.Item("MatrixUID").Specific
                    oColumns = oMatrix.Columns
                    DSource = oForm.DataSources.DBDataSources.Add("@TEMP")
                    oColumn = oColumns.Item("0") ' # Column
                    oColumn.DataBind.SetBound(True, "@TEMP", "DocEntry")
                    oColumn = oColumns.Item("1")
                    oColumn.DataBind.SetBound(True, "@TEMP", "U_X")
                    oColumn = oColumns.Item("2")
                    oColumn.DataBind.SetBound(True, "@TEMP", "U_Y")
                    oColumn = oColumns.Item("3")
                    oColumn.DataBind.SetBound(True, "@TEMP", "U_Z")
                    oMatrix.Clear()
                    oMatrix.AutoResizeColumns()
                    DSource.Query()
                    oMatrix.LoadFromDataSource()
    or u can use a virtual data source table.this is better.
    oForm.DataSources.DataTables.Add("TEMP") 'Virtual data table. You can use as is.
    Dim SQLSTR as String  = "SELECT fields FROM tables WHERE Conditions"
    oForm.DataSources.DataTables.Item("TEMP").ExecuteQuery(SQLSTR )
                    DSource = Nothing
                    oMatrix = oForm.Items.Item("MatrixUID").Specific
                    oColumns = oMatrix.Columns
                    oColumn = oColumns.Item("1")
                    oColumn.DataBind.SetBound(True, "TEMP", "U_X")
                    oColumn = oColumns.Item("2")
                    oColumn.DataBind.SetBound(True, "TEMP", "U_Y")
                    oColumn = oColumns.Item("3")
                    oColumn.DataBind.SetBound(True, "TEMP", "U_Z")
                    oMatrix.Clear()
                    oMatrix.AutoResizeColumns()
                    DSource.Query()
                    oMatrix.LoadFromDataSource()
    regards,
    varma
    Edited by: Varma on Oct 18, 2008 9:53 AM

  • How to fill field with test data in alv grid display

    hi all,
    i m adding field TEXT to the structure for displaying grid.
    i m modifying program like this
    DATA: ALV_OUTPUT  LIKE HRPDV_EXPIRED_Q OCCURS 0 WITH HEADER LINE.
    TYPES : BEGIN OF FS_OUTPUT .
          TEXT(20) TYPE C.
            INCLUDE STRUCTURE HRPDV_EXPIRED_Q.
    TYPES       TEXT(20) TYPE C.
    TYPES    END OF FS_OUTPUT.
    DATA: fs_output like table of alv_output.
    CLEAR WA_FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'TEXT'.
      WA_FIELDCAT-seltext_l = 'Abteilungs Struktur'.
      wa_fieldcat-tabname   = 'ALV_OUTPUT'.
      WA_FIELDCAT-COL_POS  = '13'.
      APPEND WA_FIELDCAT TO P_GT_FIELDCAT.
    this is what i have write for diapalying field. but my question is how to fill test data with field TEXT.I m writing like this but not executed in the aboove grid dispaly statement.
    loop at alv_output.
    *alv_output-text(20)  = 'abcdefgh'.
    *modify alv_output.
    *endloop.
    plz tell me how to fill test data

    hI..,
    Your table declaration has to be like this..
    TYPES : BEGIN OF FS_OUTPUT .
    INCLUDE STRUCTURE HRPDV_EXPIRED_Q.
    TYPES TEXT(20) TYPE C.
    TYPES END OF FS_OUTPUT.
    DATA: ALV_OUTPUT LIKE standard table of fs_output initial size 0.
    loop at alv_output <b>into fs_output</b>.
    <b>fs</b>_output-text(20) = 'abcdefgh'.
    <b>modify alv_output index sy-tabix from fs_output transporting text.</b>
    endloop.
    Now give this table alv_output to the GRID_DISPLAY function module..
    you will get the required output !!
    Plz do remember to close the thread when ur problem is solved !!
    reward all helpful answers !!
    regards,
    sai ramesh

  • Fill fields with actual date / timestamp with button

    Hello,
    I did not find an answer for my following problem.
    I want to put a button my adobe form that fills automactically three fields with data from the PC which are:
    actual time (of the PC and of course timezone info), date and username, so the User has to press one button to fill all these data for convenience. 
    So I think it is necessary to program this in JavaScript as an "on-click" action. Since I'am not too much familiar with this, it would be great if someone can post a little sample coding for this (or has some other tipp).
    regards and happy xmas
    Jörg

    you must have target fields for your Date, Time and Username, for example you have a structure in your data view called "ZINFO" with the fields "EDATE", "ETIME","ENAME"
    in your layout you need a button where you click on
    in the click event you can fill your fields (formcalc)
    xfa.resolveNode("xfa.record.ZINFO.EDATE").value = Num2Date(Date(), "DD/MM/YYYY");  
    xfa.resolveNode("xfa.record.ZINFO.ETIME").value = Num2Time(Time(), "HH:MM:SS", "de_DE");
    so you always get time/date when clicking
    but how do you know who has opened the form?? did you realize some password protection??
    br norbert

  • Filling tables with XML data

    Hi!!
    I need help with this!! I don't know the right way to implement such a problem!
    Here is the scenario:
    I do have a number of tables (relations) created in MS Access and I do have an XML document now what I'm looking for is to fill these tables with data from the XML document!
    Here are the tables that I have (IDs are auto numbered fields)
    Table Name: datee
    Fields:
    1- datee_ID
    2- datee_day
    3- datee_month
    4- datee_year
    Table Name: paragraph
    Fields:
    1- paragraph_ID
    2- paragraph_String
    Table Name: month
    Fields:
    1- month_ID
    2- month_String
    Table Name: notee
    Fields:
    1- notee_ID
    2- notee_to
    3- notee_from
    4- notee_heading
    5- notee_datee_day
    6- notee_datee_month
    7- notee_datee_year
    Table Name: year
    Fields:
    1- year_ID
    2- year_String
    Table Name: day
    Fields:
    1- day_ID
    2- day_String
    Table Name: to
    Fields:
    1- to_ID
    2- to_String
    Table Name: from
    Fields:
    1- from_ID
    2- from_String
    Table Name: heading
    Fields:
    1- heading_ID
    2- heading_String
    Table Name: notee_paragraph
    Fields:
    1- notee_paragraph_ID
    2- notee_ParentID
    3- notee_paragraph_String
    Here is the XML document
    <notee>
    <to>Jane</to>
    <from>Tom</from>
    <heading>Reminder</heading>
    <paragraph>Hi</paragraph>
    <paragraph>Don�t be late!</paragraph>
    <datee>
    <day>13</day>
    <month>May</month>
    <year>2004</year>
    </datee>
    <to>Mark</to>
    <from>Ed</from>
    <heading>Invitation</heading>
    <paragraph>Hello</paragraph>
    <paragraph>Please come</paragraph>
    <paragraph>Take care</paragraph>
    <datee>
    <day>14</day>
    <month>March</month>
    <year>2004</year>
    </datee>
    </notee>
    I used DOM to parse the XML document but my only problem is in finding an algorithm that I should follow to fill in these tables!! so HOW!! I'm a bit confused??
    Any help or advice will be highly appreciated!

    For each of your elements, build a class representing the object. All your classes should have a method
    to create an instance of the class from an XML node (i.e. public static Object fromXML(Node)), and also
    a 'full constructor' (with parameters for all members of the class.
    Then, build utility classes to hold the table access.
    Short example for table DATEE:
    public class Datee {
       private int id;
       private byte day, month, year;
       public Datee(int id, byte day, byte month, byte year) {
          this.id = id;
          this.day = day;
          this.month = month;
          this.year = year;
       public static Object fromXML(Node node) {
          NamedNodeMap attributes = node.getAttributes();
          String strid = attributes.getNamedItem("id").getNodeValue();
          String strday = attributes.getNamedItem("day").getNodeValue();
          String strmonth = attributes.getNamedItem("month").getNodeValue();
          String stryear = attributes.getNamedItem("year").getNodeValue();
          try {
             id = Integer.parseInt(strid);
             day = Integer.parseInt(strday);
             month = Integer.parseInt(strmonth);
             year = Integer.parseInt(stryear);
          catch(Exception e) {
          return new Datee(id, day, month, year);
    }Its of course the simplest example. If instance contains other object instances, just use its fromXML() method to create it.
    Hope this helped,
    Regards.

  • Why is my SSD filling up with phantom data?

    I have a 2007 Mac Pro (2,1) (waiting on the new one) running OSX Lion 10.7.5 with 9 Gb of RAM.
    I installed an after market 240Gb SSD from OWC that I use as my boot drive.  It is about 85% full with 37.8Gb free space.  I've had the SSD and Lion installed for a long time without any problem, but in the last few days I have twice gotten a system message tell me that the boot drive is full and to close programs and delete data.  Using Get Info on the SSD, I have verified that it is full, with only about 240Mb of data free.  By the time I get this message everything is trashed and my only option is to force quit everything and restart the computer.  This has happened without any abnormal usage on my part.
    After the re-boot, my SSD was back to normal with the same 37Gb of free space available.
    I don't have Time Machine turned on.  I use SuperDuper for nightly local back up and BackBlaze for continuous offsite.
    I called Other World Computing and asked if Trim may be an issue, I don't have it turned on in Lion.  They told me that shouldn't be a problem, that they don't recommend turning on Trim in the OS; that their drives compensate for that on their own.
    Since the first time it happened, I've periodically looked at spare capacity via Get Info but have never found an odd increase.  But the last time, I was gone from the computer for an hour or two to find the 'memory full' message again displayed when I came back.
    Can anyone offer any information as to what might be going on?  I can't think of any new software that I've installed lately or any changes that I've made in my computer work habits.  About the only thing that's new is that I updated iTunes to version 11.0.5.  Can't see how that would have had any effect on this.

    Empty the Trash if you haven't already done so. If you use iPhoto, empty its internal Trash first:
    iPhoto ▹ Empty Trash
    Then reboot. That will temporarily free up some space.
    According to Apple documentation, you need at least 9 GB of available space on the startup volume (as shown in the Finder Info window) for normal operation. You also need enough space left over to allow for growth of your data. There is little or no performance advantage to having more available space than the minimum Apple recommends. Available storage space that you'll never use is wasted space.
    To locate large files, you can use Spotlight. That method may not find large folders that contain a lot of small files.
    You can more effectively use a tool such as OmniDiskSweeper (ODS) to explore your volume and find out what's taking up the space. You can also delete files with it, but don't do that unless you're sure that you know what you're deleting and that all data is safely backed up. That means you have multiple backups, not just one.
    Deleting files inside an iPhoto or Aperture library will corrupt the library. Any changes to a photo library must be made from within the application that created it. The same goes for Mail files.
    Proceed further only if the problem isn't solved by the above steps.
    ODS can't see the whole filesystem when you run it just by double-clicking; it only sees files that you have permission to read. To see everything, you have to run it as root.
    Back up all data now.
    Install ODS in the Applications folder as usual. Quit it if it's running.
    Triple-click the line of text below on this page to select it, then copy the selected text to the Clipboard (command-C):sudo /Applications/OmniDiskSweeper.app/Contents/MacOS/OmniDiskSweeper
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The application window will open, eventually showing all files in all folders. It may take some minutes for ODS to list all the files.
    I don't recommend that you make a habit of doing this. Don't delete anything while running ODS as root. If something needs to be deleted, make sure you know what it is and how it got there, and then delete it by other, safer, means. When in doubt, leave it alone or ask for guidance.
    When you're done with ODS, quit it and also quit Terminal.

  • Breakout table (fill table with matching data from another table)

    Hi
    I've been trying to study old discussions about breakout tables. I feel I'm close, but still no cigar :-)
    In plain english, I'm trying to autocreate rows with data on a table, based on matching values from another table. E.g. have a table to display all rows where type = AssetX
    I have attached a screenshot of my "master table" called Assets:
    I'm looking to prefill Asset name, Total from this table and populate a new table called e.g. Greenhouse
    Where I'd be adding more data (date, income, expense).
    Any help whould be greatly appreciated.
    Thanks!

    Hi,
    Here is a Sample Query.
    Update Emp A
    Set Sal = (Select Sal from emp b where
    a.empno = b.empno)
    where empno in (select empno from emp);
    Regards,
    Ganesh R
    null

  • Fill form with JS data; dropdown

    Looking for a way to have a drop down of people or companies. When you select a company the city, state, etc the indo will auto fill text boxes. what is my best options to go about this?
    I have been trying to use this http://acrobatusers.com/tutorials/js_list_combo_livecycle1 and change the code to get it to work for what Im tryign to do but no success.
    Any help would be awesome. Thanks.

    Here's a link to a sample form that behaves that way: https://workspaces.acrobat.com/?d=gZNDS8dQQNqvwocUufXHNQ
    The script that controls it is in the Keystroke event of the combo box. Pay attention to how the combo box is set up, particularly the export values of each item. If you have any questions, post again.

  • Data of matrix(with userdatasource columns) dissapear in  form_add mode

    Hi all,
    Why when i put the mode of my userform in ADD_mode the data of my matrix (with userdatasource data in columns,not linked to one table) disapear?.
    How i can do to not lost data? Exist any way?
    Thank you all again.
    Regards.

    Aitor,
    I guess you are using UDO, and set it  the ObjectType to form.
    It is a default behavior that B1 will clear the form for new entry, when it switchs to add mode.
    Would you specify the scenario more? Why would you like to keep the data in the form from Find / OK to Add mode?
    Kind Regards
    -Yatsea

Maybe you are looking for

  • Unzip error while installing 11.5.10 on RHEL 4

    HI I was trying to install 11.5.10 on RHEL 4. While rapidwiz is running the following command, Command: /u01/oracleDB/visldb/9.2.0/temp/VISL_applgs/adrun9i.sh It has thrown the following error, RW-20003: Error:Unzip failed: unknown reason. Check log

  • Where did my cloud go

    I replaced my macbook pro with a new hd because original crashed. I was able to restore some of my music from icloud. Now the cloud is gone from my itunes, why? Where did it go?

  • Backing up files on Disk Utility question

    So I followed this steps: Clone Yosemite, Mavericks, Lion/Mountain Lion using Restore Option of Disk Utility Boot to the Recovery HD: Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. A

  • How should a plug-in behave with multiple open documents?

    Just about all my knowledge of plug-in development has grown out of the stamper sample.  One observation of that concerns it's behaviour when there are multiple Acrobat Pro windows open.  If I click the stamper toolbar button in one window, it is the

  • Error when creating object of OTM

    Hi All, Virtual machine running Oracle Linux 2.6.18-238.el5 has been created in the Virtual Box. OTM version of 6.1.6 has been installed. Login by user DBA.ADMIN. When select the menu option : Shipment Management --> Location Manager and click button