Matrix with Items

Hi, I've added this matrix to a new folder in the Items Master Data Form. The problem seems to be when you bind the data to the form. I can't see what's wrong with it. Can anyone help?
string table = "OITM";
// getting the matrix column by the UID
oColumn = oColumns.Item( "icode" );
oColumn.DataBind.SetBound( true, table, "itemcode");
oColumn = oColumns.Item( "iname" );
oColumn.DataBind.SetBound( true, table, "itemname" );
Message was edited by:
        Costas Ioannou
Message was edited by:
        Costas Ioannou

I think it's because I'm binding Items to the Item Master Data form because it works perfectly when I use the same matrix on another form eg. business partners. Is there any way around this?

Similar Messages

  • Load System Matrix with Data

    Hi,
    I like to fill system Matrix with data; please find the code below.
    Thank you very much for your good work and support.
    Thank you,
    Rune
    CODE
    #region SalesOrderItemLine_GetDataFromDataSource
    public void SalesOrderItemLine_GetDataFromDataSource( SAPbouiCOM.Form oForm, bool Matrix77_AddRefresh )
         try
              if ( Matrix77_AddRefresh )
    oForm.DataSources.DataTables.Add("SYS_77");
              oForm.DataSources.DataTables.Item("SYS_77").ExecuteQuery("SELECT [Code],[Name],[U_Weight],[U_PoNo],[U_CoopName],[U_Consignee],[U_PalGroup],[U_Container],[U_ItemCode],[U_CheckBoxSelect] FROM [dbo].[@MyTable] WHERE [U_MatrixAorB] = 'A' AND [U_WRKsalesOrderYN] = 'N'");
              ( ( SAPbouiCOM.Matrix ) ( oForm.Items.Item("77").Specific ) ).Columns.Item("1").DataBind.Bind("SYS_77", "U_ItemCode");
              ( ( SAPbouiCOM.Matrix ) ( oForm.Items.Item("77").Specific ) ).Clear();
              ( ( SAPbouiCOM.Matrix ) ( oForm.Items.Item("77").Specific ) ).LoadFromDataSource();
              ( ( SAPbouiCOM.Matrix ) ( oForm.Items.Item("77").Specific ) ).AutoResizeColumns();
         catch ( Exception Error )
              oApplication.MessageBox("Add-On Error-3232: = " + Error.Message, 1, "Ok", "", ""); // My Error Code
    #endregion

    Hi David!
    This is a Product Development Collaboration suggestion!
    I like to load data into system matixes...that could be really nice!
    (No my problem is still out there...
    Thank you,
    Rune

  • NEED HELP IN MATRIX WITH GROUP REPORT

    Dear All,
    I need small help in MATRIX WITH GROUP REPORT In Report Builder Test Report
    In my report, having periods as rows and location as columns as shown below,
    1) LOC-A
    JAN-10 FEB-10
    ITEM-GROUP -1 1 2
    ITEM-GROUP-2 3 4
    ITEM-GROUP 3 5 6
    2) LOC- B
    MAR-10 APR-10
    ITEM-GROUP -1 7 8
    ITEM-GROUP-2 9 10
    ITEM-GROUP-3 11 12
    But comming to my requirement, the periods should be in fix in matrix as shown below
    1) JAN-10 FEB-10 MAR-10 APR-10
    LOC-A
    ITEM-GROUP -1 1 2
    ITEM-GROUP-2 3 4
    ITEM-GROUP 3 5 6
    LOC- B
    ITEM-GROUP -1 0 0 7 8
    ITEM-GROUP-2 0 0 9 10
    ITEM-GROUP-3 0 0 11 12
    I am unable to get this kind of output format
    Please kindly waiting for reply from our team....
    Regards
    krishna.P

    For the periods, create a seperate dummy query and then use it as column group in the multi query matrix.

  • 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...

  • Matrix with DataTable - GetLineData and SetLineData B1 8.8 Bug

    Hi experts,
    I have a matrix bounded to a DataTable and I succefully load the matrix with:
    DataTable dt = form.DataSources.DataTables.Item("matDT");
    dt.ExecuteQuery(sql);
    Matrix mat = form.Items.Item("mat").Specific as Matrix;
    mat.LoadFromDataSource();
    mat.AutoResizeColumns();
    Now in Event et_VALIDATE(after), i would like to change some not editable column of the matrix
    [B1Listener(BoEventTypes.et_VALIDATE, false)]
    public virtual void OnAfterValidate(ItemEvent pVal) {
              if(pVal.ItemUID!="mat")
                    return;
              Form form = B1Connections.theAppl.Forms.Item(pVal.FormUID);
              Matrix mat = form.Items.Item("mat").Specific as Matrix;
              DataTable dt = form.DataSources.DataTables.Item("matDT");
              //Pont 1)
              mat.GetLineData(pVal.Row)     
              //Point 2
              //Change Values
              int minutes = dt.GetValue("U_Minutes", pVal.Row-1);
              dt.SetValue("U_Hours",pVal.Row-1, (double) minutes / 60);
              //Point 3
              mat.SetLineData(pVal.Row);
    Now I will expain the problem:
    For simplicity assume the matrix has 2 rows after load. After the user edit a column, validate event fires and:
    -) After the call of GetLineData  in Point 1) I verified that all DataTable Rows are identical (derived from the first row in the matrix)
    -) If I substitute GetLineData   in point 1) with FlushToDataSource, DataTable became corret but after the call of SetLineData in point 3) all the matrix rows are identical (derived from the first DataTable row).
    -) If I also substitute SetLineData   in point 3) with LoadFromDataSource, all works fine but i loose focus and performances
    Is it a B1 8.8 Bug?

    Yes, but sap said that my  customer is not officially approved.
    the following is the original text.
    Please note that SAP Business One Release 8.8 has only been released for
    Ramp-Up. Because of this, only approved projects for productive usage a
    re fully supported by SAP Business One Support. However feedback on prod
    uct quality or bugs reporting from all partners - even from partners who
    are not part of the Ramp-Up - is welcome and highly appreciated.
    According to the information we have, your customer is not officially ap
    proved for Ramp-Up yet. Due to the difficulty to estimate the number of
    messages that will be submitted, SAP cannot commit itself to solving all
    issues reported about projects not officially approved for Ramp-Up, nor
    guarantee any response times.
    Kind regards,
    SAP Business One Support

  • Matrix with cfl

    hi friends,
                     i have created program which is matrix with clf. inthat program i have created 7 coloumns values as employee id, firstname,floor,desg,time,extrahour,otallowance. here i have created cfl in employee id column. when i press tab button in employee id the values like employee id,firstname,floor,desg should store in appropriate column. plz tell me how can i do that? can u tell me whats the coding?

    hi
    here is the complete coding .. it is working for me...
    Public Class Class1
        Public WithEvents SBO_Application As SAPbouiCOM.Application
        Dim oform As SAPbouiCOM.Form
        Dim oitem As SAPbouiCOM.Item
        Dim oedit, oedit1 As SAPbouiCOM.EditText
        Dim ocompany As SAPbobsCOM.Company
        Dim olinked As SAPbouiCOM.LinkedButton
        Public Sub SetApplication()
            Dim SboGuiApi As SAPbouiCOM.SboGuiApi = New SAPbouiCOM.SboGuiApi
            Dim sConnectionString As String
            sConnectionString = Environment.GetCommandLineArgs.GetValue(1)
            SboGuiApi.Connect(sConnectionString)
            SBO_Application = SboGuiApi.GetApplication()
        End Sub
        Private Function SetConnectionContext() As Short
            Dim sCookie As String
            Dim sConnectionContext As String
            ocompany = New SAPbobsCOM.Company
            sCookie = ocompany.GetContextCookie
            sConnectionContext = SBO_Application.Company.GetConnectionContext(sCookie)
            If ocompany.Connected = True Then
                ocompany.Disconnect()
            End If
            SetConnectionContext = ocompany.SetSboLoginContext(sConnectionContext)
        End Function
        Public Sub LoadFromXML(ByRef FileName As String)
            Dim oXmlDoc As Xml.XmlDocument
            oXmlDoc = New Xml.XmlDocument
            Dim sPath As String
            sPath = IO.Directory.GetParent(Application.StartupPath).ToString
            oXmlDoc.Load(sPath & "\" & FileName)
            SBO_Application.LoadBatchActions(oXmlDoc.InnerXml)
        End Sub
        Private Function ConnectToCompany() As Short
            ConnectToCompany = ocompany.Connect
        End Function
        Public Sub con()
            If Not SetConnectionContext() = 0 Then
                SBO_Application.StatusBar.SetText("Connection Failed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                End
            End If
            If Not ConnectToCompany() = 0 Then
                SBO_Application.StatusBar.SetText("Connection Failed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
                End
            End If
        End Sub
        Public Sub New()
            MyBase.New()
            SetApplication()
            con()
            LoadFromXML("manoj.srf")
            oform = SBO_Application.Forms.Item("sbo")
            oform.Visible = True
            AddChooseFromList()
            oedit = oform.Items.Item("t1").Specific
            oedit.DataBind.SetBound(True, "@INDIAN", "U_Name")
            oedit.ChooseFromListUID = "CFL1"
            oedit.ChooseFromListAlias = "DocNum"
            oitem = oform.Items.Item("l1")
            olinked = oitem.Specific
            olinked.LinkedObjectType = SAPbouiCOM.BoLinkedObject.lf_Order
        End Sub
        Public Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
            If pVal.ItemUID = "t1" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
                Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
                oCFLEvento = pVal
                Dim sCFL_ID As String
                sCFL_ID = oCFLEvento.ChooseFromListUID
                Dim oForm As SAPbouiCOM.Form
                oForm = SBO_Application.Forms.Item(FormUID)
                Dim oCFL As SAPbouiCOM.ChooseFromList
                oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
                If oCFLEvento.BeforeAction = False Then
                    Dim oDataTable As SAPbouiCOM.DataTable
                    oDataTable = oCFLEvento.SelectedObjects
                    Dim val As String
                    If pVal.ItemUID = "t1" Then
                        Try
                            oitem = oForm.Items.Item("t1")
                            oedit = oitem.Specific
                            val = oDataTable.GetValue("DocNum", 0)
                            oedit.Value = val
                        Catch ex As Exception
                        End Try
                    End If
                End If
            End If
        End Sub
        Private Sub AddChooseFromList()
            Try
                Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
                oCFLs = oForm.ChooseFromLists
                Dim oCFL As SAPbouiCOM.ChooseFromList
                Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
                oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
                oCFLCreationParams.MultiSelection = False
                oCFLCreationParams.ObjectType = "17"
                oCFLCreationParams.UniqueID = "CFL1"
                oCFL = oCFLs.Add(oCFLCreationParams)
            Catch
                MsgBox(Err.Description)
            End Try
        End Sub
    End Class

  • Matrix with ComboBox Column

    I want to make matrix with combobox column, it is not dificulte, but did somebody know is it posible with different values in each cell?
    first row ( 0, Zero ), ( 1, One )
    second row ( 0, Zero ), (2, Two ), (6, Six)
    third row ( 0, Zero), (1, One )
    .... ( Value, Description )
    I make something but all cell's have the same set of pair (Value, Description )
    P.S. Sorry for my english

    Hi Andy,
    I have been playing around with this for a while now and (seeing that Ibai actually already gave you a solution) I'm just gonna post where I am up to now. I have a matrix with two columns on it (c_1 and c_2). c_1 holds the value 1, 2 or 3. Whenever the user clicks on c_2 I repopulate the combo box according to the value selected in c_1. The only problem is that it shows the second last selected row and not the one that is currently selected. I am just posting it here so it can maybe someday put someone onto the right track.
            If pVal.FormTypeEx = "MainForm" Then
                If pVal.ItemUID = "m_List" Then 'Matrix
                    If pVal.ColUID = "c_2" Then 'Column 2
                        If pVal.BeforeAction = False Then
                            If pVal.EventType = SAPbouiCOM.BoEventTypes.et_GOT_FOCUS Then
                                Dim oForm As SAPbouiCOM.Form
                                Dim oEdit As SAPbouiCOM.EditText
                                Dim oCombo As SAPbouiCOM.ComboBox
                                Dim oMatrix As SAPbouiCOM.Matrix
                                Dim oCol As SAPbouiCOM.Column
                                Dim i As Integer
                                oForm = oApplication.Forms.ActiveForm
                                oMatrix = oForm.Items.Item("m_List").Specific
                                oCol = oMatrix.Columns.Item("c_1")
                                oEdit = oCol.Cells.Item(pVal.Row).Specific
                                oCol = oMatrix.Columns.Item("c_2")
                                oCombo = oCol.Cells.Item(pVal.Row).Specific
                                For i = oCombo.ValidValues.Count - 1 To 0 Step -1
                                    oCombo.ValidValues.Remove(i, SAPbouiCOM.BoSearchKey.psk_Index)
                                Next
                                If oEdit.Value = "1" Then
                                    oCombo.ValidValues.Add("1", "One")
                                ElseIf oEdit.Value = "2" Then
                                    oCombo.ValidValues.Add("2", "Two")
                                    oCombo.ValidValues.Add("22", "TwoTwo")
                                ElseIf oEdit.Value = "3" Then
                                    oCombo.ValidValues.Add("3", "Three")
                                    oCombo.ValidValues.Add("33", "ThreeThree")
                                    oCombo.ValidValues.Add("333", "ThreeThreeThree")
                                End If
                            End If
                        End If
                    End If
                End If
            End If
    Hope it helps,
    Adele
    PS: Ibai, why do you have a new user name? You are the same Ibai Peña right?

  • Load Matrix with Select

    When loading a table from the database in a Matrix, I like this:
    - I created the method of example "CreateFormWithMatrix."
    - OItem oForm.Items.Add = ("Matrix1" SAPbouiCOM.BoFormItemTypes.it_MATRIX);
    =-oColumns oMatrix.Columns;
    oColumns.Add-oColumn = ("Code" SAPbouiCOM.BoFormItemTypes.it_EDIT);
    oForm.DataSources.UserDataSources.Add-oUserDataSource = ("IntPhone" SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 20);
    oForm.DataSources.DBDataSources.Add-oDBDataSource = ("@ TB_TESTE");
    - OColumn oColumns.Item = ("Code");
             oColumn.DataBind.SetBound (true, "@ TB_TESTE", "Code");
    -oMatrix.Clear ();
    -oMatrix.AutoResizeColumns ();
    -oDBDataSource.Query ();
    -oUserDataSource.Value = "prefix";
    -oMatrix.LoadFromDataSource ();
    So fill the matrix with all data from my table.
    How do I show in my matrix to only the data that filter through a select?
    Example: Show the data in the matrix where the name is "Jesus."

    Hello
    You can fill matrix with a query, using datatable
    You may try this sample
    Dim oForm As SAPbouiCOM.Form = sbo_application.Forms.Add("MATRIXTEST")
            oForm.Visible = True
            oForm.Width = 300
            oForm.Height = 400
            oForm.DataSources.DataTables.Add("oMatrixDT")
            oForm.DataSources.DataTables.Item("oMatrixDT").Clear()
            Dim sSQL As String = "SELECT * FROM OQUT  WHERE Name= 'Jesus' "
            oForm.DataSources.DataTables.Item("oMatrixDT").ExecuteQuery(sSQL)
            Dim oItem As SAPbouiCOM.Item = oForm.Items.Add("oMTX", SAPbouiCOM.BoFormItemTypes.it_MATRIX)
            Dim oMatrix As SAPbouiCOM.Matrix = oItem.Specific
            Dim oColumn As SAPbouiCOM.Column = oMatrix.Columns.Add("#", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oColumn.TitleObject.Caption = "#"
            oColumn = oMatrix.Columns.Add("1", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oColumn.DataBind.Bind("oMatrixDT", "Col1")
            oColumn.TitleObject.Caption = "Customer Code"
            oColumn = oMatrix.Columns.Add("2", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oColumn.DataBind.Bind("oMatrixDT", "DocEntry")
            oColumn.TitleObject.Caption = "Quote Key"
            oColumn = oMatrix.Columns.Add("3", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oColumn.DataBind.Bind("oMatrixDT", "NumAtCard")
            oColumn.TitleObject.Caption = "Cust Ref Number"
            oColumn = oMatrix.Columns.Add("4", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oColumn.DataBind.Bind("oMatrixDT", "DocDate")
            oColumn.TitleObject.Caption = "Document Date"
            oColumn.DisplayDesc = False
            oMatrix.LoadFromDataSource()
    Regards

  • 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ñ

  • How to fill the first column '#' of matrix  with row id in user form?

    Hi All,
    I am having a user defined form in which, I m having a matrix and m populating the matrix with the output of an sql query.
    something like this:
    SQL_Str= "select col1,col2,......from.... "
    OPopDBTable.ExecuteQuery(SQL_Str)
    oMatrix.AddRow()
    oMatrix.Columns.Item("Col3").DataBind.Bind("PopTable", "col1")
    oMatrix.Columns.Item("Col2").DataBind.Bind("PopTable", "col2")
    oMatrix.LoadFromDataSource()
    Now, in this, how can I assign row number to first column ('#' column ) ??
    regards,
    Binita

    Ah...the ROW_NUMBER() was posted by Petr - also thank you (again)
    With my example-query from the other thread:
    SELECT
         CAST(
                 ROW_NUMBER() OVER (ORDER BY T1.U_LogNo ASC) AS INT
            ) AS RowCnt,
         T1.Code,
         T1.U_ParcelNo,
         T1.U_LogNo
    FROM
         [@XXX_EXAMPLE] T1
    WHERE
         T1.U_ParcelNo='132006' 
    ORDER BY
         T1.U_LogNo ASC
    ...this works for me (it's quickly copied from several subs/func. - I hope it's not too much disordered):
    DtLogs.ExecuteQuery(query)
    oMtxLogs.Columns.Item("0").DataBind.Bind("DT_LOGS", "RowCnt")
    oMtxLogs.Columns.Item("1")........
    oMtxLogs.LoadFromDataSource()

  • Event in Matrix with BOM?

    Hi expert,
    As you can see i'm new in developing and I have e lot of boring questions
    Problem is that:
    I want to copy from OITM values from UDF into the standard document "Quotation" rows.
    So, I want OITM.U_II_001 field value will be copied in field U_II_001 in the matrix of quotation document.
    Actually, i trap the event et_VALIDATE. When I insert a New ItemCode the code is executed:
    if (pVal.ItemUID == "38" & pVal.EventType == SAPbouiCOM.BoEventTypes.et_VALIDATE & pVal.Before_Action == true)
         // ColUID = 1 is "ItemCode"
         if (pVal.ColUID=="1")
              string oValore;
              oValore = ReadItemCode(pVal) ;
              AddNewValueInRow(pVal, oValore);
    This code runs well if I add manually single rows in document.
    Problem is that: If I add an Item with BOM, the code is not executed for each item in the BOM!
    How can I solve the problem? I want to execute the code to fill the UDF fields for each item in BOM too...
    Exist other event I need to trap instead of et_VALIDATE?
    Could you say me where I can to find this kind of informations?
    Thanks in advance,
    Jonny Cortonicchi

    Thanks for your Interest!
    This is the code where I inizialize connections (UI and DI).
    Finally I add an event handler to manage the change value for ItemCode in the body of document:
            public QuotationForm()
                SetApplication();
                SetConnectionContext();
                ConnectToCompany();
                SBO_Application.ItemEvent += new SAPbouiCOM._IApplicationEvents_ItemEventEventHandler( SBO_Application_ItemEvent );
    This is the code where I trap the et_VALIDATE event for ItemCode column:
    private void SBO_Application_ItemEvent( string FormUID, ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent )
           BubbleEvent = true;
           if ( ( ( pVal.FormType == 149 & pVal.EventType != SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD ) & ( pVal.Before_Action == true ) ) )
                // Item 38 = Matrix
                if (pVal.ItemUID == "38" & pVal.EventType == SAPbouiCOM.BoEventTypes.et_VALIDATE & pVal.Before_Action == true)
                     // ItemCode Column
                     if (pVal.ColUID == "1")
                          string oValore;
                          oValore = ReadItemCode(pVal);
                          AddNewValueInRow(pVal, oValore);
    Finally, the two methods.
    First to Read the ItemCode inserted in row
    The second read data from OITM and fill fields in matrix.
    This code read the ItemCode from column 1 of matrix in the quotation form:
            private string ReadItemCode( SAPbouiCOM.ItemEvent pVal )
                SAPbouiCOM.Matrix oMatrix;
                SAPbouiCOM.EditText oValore;
                try
                    oMatrix = (SAPbouiCOM.Matrix)oQuotationForm.Items.Item("38").Specific;
                    oValore = (SAPbouiCOM.EditText)oMatrix.Columns.Item("1").Cells.Item(pVal.Row).Specific;
                    return oValore.Value;
                catch (Exception ex)
                    SBO_Application.MessageBox("Impossibile leggere ItemCode: " + ex.Message);
                    throw;
    And this method read from OITM and fill fields in form:
            private void AddNewValueInRow(SAPbouiCOM.ItemEvent pVal, string oValore)
                SAPbouiCOM.Matrix oMatrix;
                try
                    string s;
                    SAPbobsCOM.Items oArticoli;
                    oMatrix = (SAPbouiCOM.Matrix)oQuotationForm.Items.Item("38").Specific;
                    oArticoli = (SAPbobsCOM.Items)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems);
                    oArticoli.GetByKey(oValore);
                    s = oArticoli.UserFields.Fields.Item("U_II_001").Value.ToString();
                    oMatrix.SetCellWithoutValidation(pVal.Row, "U_II_001", s);
                    s = oArticoli.UserFields.Fields.Item("U_II_002").Value.ToString();
                    oMatrix.SetCellWithoutValidation(pVal.Row, "U_II_002", s);
                    s = oArticoli.UserFields.Fields.Item("U_II_003").Value.ToString();
                    oMatrix.SetCellWithoutValidation(pVal.Row, "U_II_003", s);
                    s = oArticoli.UserFields.Fields.Item("U_II_004").Value.ToString();
                    oMatrix.SetCellWithoutValidation(pVal.Row, "U_II_004", s);
                    s = oArticoli.UserFields.Fields.Item("U_II_005").Value.ToString();
                    oMatrix.SetCellWithoutValidation(pVal.Row, "U_II_005", s);
                catch (Exception ex)
                    SBO_Application.MessageBox("Impossibile Impostare la colonna U_II_001: " + ex.Message);
                    throw;
    As i wrote, the event et_VALIDATE when the item inserted has a BOM of type MODEL runs only for parent item and NOT for children.
    Thanks,
    Jonny Cortonicchi

  • VPRS updated incorrectly for SO with item cat Ind PO

    Hi SAP Gurus
    We created a SO with item cat (Individual Purchase Order - Account
    Assignment M in PO).In PO we have checkd the item as free goods.
    However during billing the VPRS was not captured from PO price (which
    is 0.00) but it was updated from material master. As for normal items,
    VPRS was updated correctly from PO.
    Pls advise for free goods how can we have the VPRS updated correctly from PO instead of material master.
    Sanjay

    Hi,
    Goto VOV7, select item category-In business data tab - tick determine cost.
    check in MR21 for material price.
    Thanks,
    Mohanprabu C.
    Edited by: mohan prabu on Jul 7, 2009 9:12 AM
    Edited by: mohan prabu on Jul 7, 2009 9:12 AM

  • Problem with Item Validation

    Hello,
    I am running an advanced tutorial: http://download.oracle.com/docs/cd/E14373_01/appdev.32/e13363/issue_track_ui.htm#BGBJCGIC
    and I have a problem with item Validation.
    Tutorial offers the following:
    You must manually create another validation to ensure that the Actual End Date is the same or later then the Start Date.
    To add a validation for the Actual End Date:
    1.Under Page Processing, Validations, click the Create icon.
    2.For Level, accept the default, Item level validation, and click Next.
    3.For Item, select Project Details: 50.P3_ACTUAL_END_DATE (Actual End Date) and click Next.
    4.For Validation Method:
    a.Select PL/SQL and click Next.
    b.Accept the default, PL/SQL Expression and click Next.
    5.For Sequence and Name:
    a.Sequence - Enter 50.
    b.Validation Name - Enter P3_END_AFTER_START.
    c.Accept the remaining defaults and click Next.
    6.For Validation:
    a.Validation - Enter:
    to_date(:P3_ACTUAL_END_DATE,:APP_DATE_FORMAT) >= to_date
    (:P3_START_DATE,:APP_DATE_FORMAT)
    b.Error Message - Enter:
    Actual End Date must be same or after Start Date.
    c.Click Next.
    7.For Conditions:
    a.Condition Type - Select Value of Item in Expression 1 is NOT NULL
    b.Expression 1 - Enter P3_ACTUAL_END_DATE
    8.Click Create.
    Is there a mistake in explanation? I did it 3 times already, very carefully! I ran the page, entered the date, which is After the Start date, and get the error message: Actual End Date must be same or After Start Date!!
    Thank you for your consideration...

    I got it solved. I don't know if this is documented(or a bug) but what I did was declare an exception and then raise it and put the form_trigger_failure into the exception handler rather than raise form_trigger_failure in the body.
    declare
    alreadyExists exception;
    begin
    -- select .....
    raise alreadyExists;
    exception
    when alreadyExists then
    message('.....exists');
    raise form_trigger_failure
    end;

  • Custom pushbutton in ME21N should display a popup window with item details

    Hello,,
    The requirement is to
    1. Add a custom pushbutton in ME21N screen at header level.
    2. The user will select some PO line items and will click on this push button.
        This inturn should trigger a popup window with item details only for those selected PO line items along with schedule line qty.
    I have created the custom push button in a custom tab using the BADI ME_GUI_PO_CUST.
    Now I am not able to retrieve item details and schedule line details inside the PAI of the custom tab..
    i.e., when i click on the custom push button, I am not able to retrive the item data and schedule line data.
    Please help me to retrive PO line item data and schedule line data.
    Regards,
    Sharah

    JSF is not so relevant in this question. It's all about how the generated client side code look like. Which is usually a bunch of HTML/CSS/JS (open page in browser, rightclick and view source). If you know HTML, you should know that using target="_blank" in a <form> or <a> element would open a new window. If you know JS, you should know that using window.open() would open a new window.
    Apply this so in the JSF source code so that the generated HTML/JS output is exactly what you want.

  • Sale order with item category TAN not getting displayed in md04

    Hi,
    We have a sale order with item category TAN, Schedule line category CP, MRP type ND and availability check as 07. This is not getting reflected in md04. But item category TAB gets displayed under the PR number.
    Please let me know what checks to be made or changes to be done for the sale order with item category TAN to get displayed in md04 screen
    Thanks & Regards

    Hi all,
    I changed the MRP type to PD, and from the next sale order, line item onwards, it was getting displayed in md04 screen. The already created one anyway dint get reflected. So I had to delete the line item and create a new one.
    Thanks all for the help
    Regards,
    Jegashree

Maybe you are looking for

  • Skype won't sign in.

    When ever I try to sign in with my account with skype, it sticks at the moving circle, then it says Skype can't connect. I've tried >Re-Installing. >Resetting Internet Explorer & Updating. >Installing a old version of Skype. >Disabling fire-wall. >Re

  • Lost Project library files -   edited functional film clips  have caution d

    I have edited a number of clips from one minute to 10. I left them in the project Library. They seemed fine and I left them there for later transfer to iDVD. Now a number of the files have caution ! sign and the edited project is non functional with

  • Word2003で作成したファイルをAcrobat 9でPDF化するとリンク先ファイルが開かない

    WORD2003で作成した文章の中に.文字列をクリックすると別のPDFファイルが開くように.ハイパーリンクを設定しました. このWORDをAcrobat 9 StandardでPDFに変換し.CDに焼いた後.CDからPDFファイルを開き.文字列をクリックしても別PDFファイルが開きません. Acrobat 9 Standard がインストールされている環境は以下の通りです. このPCでPDFを作成し.開いてみました. Windows XP SP3 Adobe Reader 9.2 (最新の状態に

  • When a photo is viewed in iPhoto 9.6, why is it sharp then immediately goes out of focus?

    When viewing photos (full window), the photo initially is sharp then immediately goes a little out of focus. Thanks to some previous forum responses, a fix is to slightly shift the zoom button to the right, clearing the photo right up. When going thr

  • Can't Open domain.sites2

    I recently aquired a customer who's ex-boyfriend made her website in iWeb. Now that he is the ex, she's asked me to make some updates, however my iWeb won't open her site. I have all of her source files as well as the domain.sites2 file from her. I n