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.

Similar Messages

  • VC  7.2 webservice multiple rows output - problem

    I found a wiki which tells about solving the problem about a webservice output.
    i am having a ws with multiple rows as output, but in VC I am getting only the first row.
    I found a solution, but I am not able see the options given to  Add fields.
    please suggest me.
    http://wiki.sdn.sap.com/wiki/display/VC/Outputfieldnotseenas+array

    solved myself
    solution:
    the output of the webservice I had like below
    --a
      ---b
    node be returns field1, field2, field3
    I was selecting a as my entry point(current node as context), so the table was showing only the first row.
    The solution is, make b node as your entry point(current node as context), it will show all rows.
    Enjoy

  • Matrix Empty row Binding Problem

    Hi ,
    i created one matrix using screen painter.. all my columns are binded
    with user defined fields.(Doc Rows Table). if my total row count is 5.
    and i deleted 2 rows using rightclick deleterow event. after adding if i see the same document  it display the 2 empty rows and 3 rows with my details.. actually its showing that deleted row also.my UDT also having empty row details..
    how to resolve this?
    Regards,
    Ganesh K

    Hi Geetha,
    i think you misunderstood my scenario. while adding no empty rows
    are displayed, even if  i deleted some added row details.After adding,
    while retriving the same document  the problem occurs.if am not clear let me know..
    As you told, beforeAction = false of Add will be new form with Add mode.so not possible to check that old matrix. otherwise we can delete the empty details from database using query..in beforeaction false pval.actionsucess true part...
    regards,
    Ganesh k.

  • Row Adding Problem In ALV Gird (OO)

    Hi Gurus,
    I am working on an OO ALV Grid , here when I am adding a row to the grid by clicking the append row button and when I am pressing F4 for input search help, the newly appended row is getting deleted and the grid remains with only the first row.
    Can anybody please tell me why this is happening or in what cases this can happen
    Thanks

    Hi Rahul ,
       Just debug the program and see that when you press F4 after the required processing is done , does it go to the module where you call SET_TABLE_FOR_FIRST_DISPLAY method , please check this.
    Actually once this method has been called use the method REFRESH_TABLE_DISPLAY.
    Regards
    Arun

  • Matrix multiple query report problem

    dear members i have serious problem regarding report as i m usin oracle 10g with developer 6i release2 and i m getting following error while executing teh report out:
    rep-1761: internal error <rgcaag-2> while processing group <g_item_code>
    plz any one hv idea regarding this error so share with me .
    thnx in advance
    Edited by: user581618 on Jul 14, 2012 1:48 AM

    Internal errors usually indicate a bug somewhere.
    What are your exact Reports version, database version and operating system? Developer 6i release2 and 10g are not the exact version numbers.

  • 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

  • DELETE MULTIPLE ROWS FROM MATRIX

    Hi all,
    I´M DESPERATED.
    I am able to delete row by row in my matrix, but ¿Could anyone post a sample to delete multiple rows?
    I´ve been trying several ways but it doesn´t work.
    My code is:
    ========================
      Dim i As Long = oMatrix.GetNextSelectedRow
                    If i > -1 Then
                        If oMatrix.IsRowSelected(i) = True Then
                            oMatrix.DeleteRow(i)
                        End If
    ========================
    Thank you in advanced,
    lorenzo

    Don´t worry, It was a problem with my loop.
    Thanks anyway
    lorenzo

  • Problem with database control returning multiple rows as Array  using Oracle

    Has anybody using Oracle gotten a Database control that
    returns multiple rows to work returning an array?
    The only way I can seem to return multiple rows is by returning
    a RowSet. Returning an array gives me a NullPointerException
    (when called within a pageFlow). When calling a database control
    that returns an array from a web service I get a
    "java.sql.SQLException: ResultSet has no more data." error.
    The samples using the pointbase database seem to work, but when I
    converted the CustomerDBClient web service to use Oracle, it starts
    failing on calling the database control that returns an array
    with: "java.sql.SQLException: ResultSet has no more data."
    Has anybody gotten this to work using Oracle?
    I'm also having some problem returning an Iterator. It seems
    to work when called from a web service, but returns nothing
    if called from a page flow.
    I'm using Oracle 8.1.7 and WebLogic 8.1.
    Eric

    Do you need a particular service pack installed to return an array of custom object?
    I am getting a ResultSet contained no data error when trying.
    Thanks,
    -Thomas
    "Robin Karlin" <[email protected]> wrote:
    >
    Eddie O'Neil <[email protected]> wrote:
    All--
    Unfortunately, returning an Iterator to a JPF (or JSP) from a
    database control is broken in WLW 8.1, though it will work inside of
    a
    JWS or JCS.
    There shouldn't be a problem with returning an array of objects out
    of Oracle to the JPF, and if you need an Iterator specifically, youcan
    wrap the array in an Iterator implementation.
    Sorry for the inconvenience.
    Eddie
    Lenny wrote:
    I have gotten it to work on Oracle using Array:)
    However, I haven't gotten it to work on Oracle using Iterator:( Itis so
    simple, but doesn't work:(
    "Eric Dokken" <[email protected]> wrote in message
    news:[email protected]...
    Has anybody using Oracle gotten a Database control that
    returns multiple rows to work returning an array?
    The only way I can seem to return multiple rows is by returning
    a RowSet. Returning an array gives me a NullPointerException
    (when called within a pageFlow). When calling a database control
    that returns an array from a web service I get a
    "java.sql.SQLException: ResultSet has no more data." error.
    The samples using the pointbase database seem to work, but when I
    converted the CustomerDBClient web service to use Oracle, it starts
    failing on calling the database control that returns an array
    with: "java.sql.SQLException: ResultSet has no more data."
    Has anybody gotten this to work using Oracle?
    I'm also having some problem returning an Iterator. It seems
    to work when called from a web service, but returns nothing
    if called from a page flow.
    I'm using Oracle 8.1.7 and WebLogic 8.1.
    Eric
    I get the same error that Eric reported when trying to return an Array
    of objects.
    It is really frustrating because I can't use much of the built-in control
    logic
    that WLW provides. All I did was create a data pool for Oracle and a
    datasource.
    I modified the sample app in C:\bea81\weblogic81\samples\workshop\SamplesApp\WebApp\callJavaControl
    to point to that datasource and I get the error that Eric reports above.
    Can
    anyone help me out????
    Thanks,
    Robin

  • Displaying Multiple Row Header for Matrix...

    Hi
           Can you please tell me, whether we can display Multiple row headers for the Matrix object same as that in the Posting Period SAP Form...
    Please check the Link: http://img198.imageshack.us/img198/3491/postingperiodform.jpg..
    Thanking you in advance...
    Thanks
    Hari

    I am extremly sorry...Please check the following link...
    Link Address : http://www.freeimagehosting.net/image.php?d499726589.jpg
    Edited by: hari angamaly on Jun 17, 2009 1:20 PM
    Edited by: hari angamaly on Jun 17, 2009 1:21 PM

  • Problems with multiple row operations in a dataTable

    Dear fellows,
    I have a strange problem, i want to do multiple row deletion in a dataTable. Can any one tell me a better way to do it. Because the way i am doing it, it is causing me strange problems. In some places it start working and in some it dont.
    The way i am doing it, it has the following code:
    <h:form>
    <h:dataTable id="list" value="#{availableRoomsList}"  var="RoomTypes" >
    <h:column>
         <f:facet name="header">
                 <h:outputText value="Select"/>
           </f:facet>
                 <h:selectBooleanCheckbox value="#{roomSelection[RoomTypes]}" >
                   </h:selectBooleanCheckbox>
    </h:column>
    <h:column>
         <f:facet name="header">
              <h:outputText value="Available Date"/>
         </f:facet>
         <h:outputText value="#{RoomTypes.availableDate}"/>
    </h:column>
    <h:column>
         <f:facet name="header">
              <h:outputText value="Available Rooms"/>
         </f:facet>
         <h:outputText value="#{RoomTypes.noOfRooms}"/>
    </h:column>
    </h:dataTable>
    <h:commandButton value="delete Selected Rooms" action="#{RoomResvAction.deleteRooms}" />
    </h:form>Now the back end code that i am using is as follows:
         private List<HotelRoomTypes> availableRoomsList;
          Map<HotelRoomTypes, Boolean> roomSelection = new HashMap<HotelRoomTypes, Boolean>();
             public String deleteRoom(){
                  System.out.println("In the delete selection method aad.");
                  try{
                       for (HotelRoomTypes item: availableRoomsList) {
                          Boolean selected = roomSelection.get(item);
                          if (selected!=null && selected) {
                               roomSelection.put(item, false);
                               //deleteRoom(item);
                  }catch(Exception e){
                       //e.printStackTrace();
                  return null;
             }The problem with the JSF code is when i click the command button it do not calls the associated action method with it. i dont know what is the problem with the code.
    And as far as the backend code is concern it should work fine.
    can anybody help me on this matter.

    thanks BalusC ,
    I will see this example and let you know, thanx for the help.
    but also please try and see my code and tell me what is wrong in it. because at some places it works and at some it simply dont . dont know why?
    well once again thanx for the help

  • Adding and Deleting Multiple Rows or Columns

    How do you add or delete more than one row or column at a time.

    Robby! wrote:
    That's a great finding!
    I just wrote a feedback requesting a shortcut like this.
    It is a pity though that they desing it to work only if you select the header of the row/column. It should be enabled to work from within any cell in the table.
    Who wrote such an error ?
    These interesting shortcuts behave flawlessly even if the cursor was in D18 for instance.
    (a) I never saw them in the delivered resources.
    (b) they aren't responding to the OP's question which was about "Adding and Deleting Multiple Rows and Columns"
    Yvan KOENIG (from FRANCE vendredi 3 octobre 2008 18:39:01)

  • Adding up Downloads excessively due to multiple rows in Tabular

    Hi All ,
    We have fact table table which has data for Products that are taken down from the  App Store ,due to different reasons like App has risky key words , App has adult content etc  ...  We get the data from the staging table as below 
    As the "reasonForTakeDown" column is having comma separated string , now we need to split this reason in to multiple rows taking Comma as the delimiter. So the first ,second and Third ProductGUIDs  have to repeated multiple
    times to each "reasonForTakeDown" as shown below 
    So in the above example if get the sum(Downloads) for the productKey 1 , then value is 300 where as the Staging value is 100.Same as with the productKey 2 , Sum(Downloads) from the fact table is 150 where as the Staging value is 50 and same case with ProductKey
    3 as well . Downloads and Revenue numbers are getting inflated due to multiple rows 
    I have a Tabular basing on the above fact table and having measures as "Downloads" and "Revenue" which are set to aggregation type as "SUM".  For the products like 1,2 and 3 we are
    getting inflated numbers from cube when compared to Staging table due to the column ReasonForRemovalkey.
    Now the problem is avoid the excess counting of downloads and Revenue by keeping multiple rows in fact table to satisfy reasonForRemovalKey Scenario . Can you help me out in writing an DAX so that anytime i will get the
    correct number of downloads and revenue which are matching with staging table.
    Approaches tried:
    1)  Tried changing the aggregation type from SUM to Avg , but this aggregation type would give avg of downloads when the user selects multiple products. Suppose if the user selects ProductKey 1 & 2  then Avg downloads measure would be (100+100+100+50+50+50)
    / 6  = 75 , where as the original downloads sum is  100+50  = 150 .So Avg aggregation wont work for me.
    2) I cannot divide the value of  downloads/NetRevenue for a product with the count of rows for that product in fact table.So that Sum(Downloads) and Sum(NetRevenue) would give me correct values.I cannot do this because , if want to get the downloads
    for a TCR and a product then i would download measure share of that TCR but not the total downloads.
    Hope i explained my scenario well. Thanks in advance

    Spliting the message as it supports only two images per message .
    Contd : 
    Now the scenarios that needs to satisfied as below :
    If user selects a product then we should get only the latest download and revenue out of the above multiple rows for a product from the tabular cube .i.e. as shown in the below snip  
    Suppose if the user selects any other column instead of Product from the tabular cube , suppose if the user selects a date as a dimension on the row labels and Downloads ,Revenue as the measure from the Tabular cube , then it should only the max downloads
    and Revenue for a product. i.e 
    Now the same case as date with Requester also .If user selects requester then we should count only the downloads and revenue only once i.e. is the max downloads and revenue for a product and a requestor as shown in the below table  
    RequestorKey Downloads Revenue 
    1                    100             50
    2                    150             40
    3                    105             55
    Hope i explained now clearly the scenarios.Thanks  you once again for your time 

  • Handle multiple rows selection on Matrix

    Hi all,
    i'd like to know if someone could help me with multiple selections on matrix via shift + left mouse button on a matrix.
    I got a matrix with one column containing a checkbox for selection. The matrix, on a UDO Form, is defined as auto selecting, so multiple selection of rows is allowed.
    I want to add the rows selected by the checkbox (using shift + left mouse button on the selection start and selection end) column to the matrix selected rows collection.
    Is there any chance to catch an event handling this situation?
    I can add the rows in the matrix selected rows collection clicking the checkboxes one by one, but when i use the multiple selection i can't get any event handling this.
    I know i couldn't use the checkbox for the selection and use instead the native function of sap b1 matrix., but this way is faster (and more clear, because you see the check when a row is selected) when you have multiple rows selected one by one
    I hope i've been clear enough, and hope somene can give me an hint.
    Thanks in advance.

    Hi Cesidio,
    if I understand you correctly you want to select one row than shift+mouseclick some rows lower and the result should be, that all rows are selected ?
    You can achieve this by catching the itempressed event and querying pVal.Modifiers.
    This is an example for Grid :
    private void Grid0_PressedAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
                if (pVal.Modifiers == SAPbouiCOM.BoModifiersEnum.mt_SHIFT)
                    int lastRowSelected =Grid0.Rows.SelectedRows.Item(Grid0.Rows.SelectedRows.Count-1,SAPbouiCOM.BoOrderType.ot_RowOrder);
                    if (lastRowSelected < pVal.Row)
                        for (int i = pVal.Row; i > lastRowSelected; i--)
                            Grid0.Rows.SelectedRows.Add(i);
    regards,
    Maik

  • Multiple Rows for Same Value in Matrix Report

    Hello
    I am trying to create a matrix report that shows different page for each Category. Report looks like follows:
    Page1( for Category '1')
    Agent |
    Calls |
    Sales
    TestAgent1 18
    3
    TestAgent1 5
    1
    Page2( for Category '2')
    Agent |
    Calls |
    Sales
    TestAgent1 26
    5
    TestAgent1 13
    2
    The issue is as you can see in above table, that i am getting repeated rows for same agents. I have tried making a parent group on Agent but it would still keep showing multiple rows. Ideally, it should show each agent only once in each page.
    Any help would be appreciated.
    PS: I am new to SSRS and this is my first time on microsoft blog, so i apologize if i wasn't able to follow the protocols/culture here.
    Thanks

    Hi M Adnan,
    According to your description, you want to show a total Calls and total Sales for same agent so that it has only one row for each agent in your category group. Right?
    In this scenario, if you only have a row group for category, it will show all “detail rows” in this groups even the agent of these rows are same one. So we can add a row group, set those detail rows group by agent and use Sum function to get the total Calls
    and Sales. It looks like below:
    If we want to display each Page in horizontal, we just need one Category column group for grouping rows and use sum function to get total Calls and Sales for each agent. It looks like below:
    Reference:
    Understanding Groups (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou
      

  • Adding multiple rows

    How do I add multiple rows at once? Thanks,
    Owen

    See page 69 of the English edition of the user guide for the basics. If you've already been there and read that, you may be saying; yes, but I want to add them in the middle of my table. That's an extension of adding rows to the end of the table. Add as many rows as you need, at the end of the table. Then select the new rows by click-dragging across the row labels. Then grab the selection by one of the labels and pull to the left to separate the new rows from the rest of the table. Without letting go, move the cursor up the table to where you want the new rows to reside, just to the right of the labels, and you will notice that insertion marks, a split line, appear along the row borders under the mouse. When you reach the destination, let go of the mouse switch and the blanks will drop in where you want them.
    Jerry

Maybe you are looking for

  • How to disable numbers in a text type or field ?

    Hi, Any option of disabling numbers in a text type or field ? For E.G. in the PO header text can we prevent users from entering number or values ? Thanks.

  • How do I correct a printer communication problem?

    How do I correct the following error when trying to print on my Macbook Pro to an epson XP-410 printer.  "rastertoescpII quit unexpectedly"  Communication is there with the printer as I can print a test page.  another Macbook pro also prints fine to

  • What happens to cached ejbs when i update records directly

    hi: i am working on a project which weblogic as app server. there's many cases in my application where we have to update large number of records(about fifty thousands) in a loop one at a time. we have tried with entity beans but it 's so slow. so in

  • CS6/CC - Brushes do not work!

    Hi there, I have photoshop 5.5 and it works totally fine with my bosto kingtee tablet. I recently tried downloading the CC trial to test it out and I can click buttons in photoshop with the pen just fine, I can draw with the mouse just fine, but it d

  • Weblogic.ejb.extensions.LockTimeOutException HELP!

    Hi, We're seeing weblogic.ejb.extensions.LockTimeOutException when we try to access some Entity Bean's data member. I'm wondering someone could help us? There is some background: WL server 5.1, SP10 (almost sure:) Running in Solaris w/ Oracle 8i The