Udo matrix rows saving problem
Hi,
i am creating a form by using UDO form generator.
in that documet and doucument rows are existed. if user select the combobox value from the form, by taking that value and i am generating a query, i am generating a recordset. by using Userdatasources i am binding each column in matrix.
i binded all values to the matrix successfully. but
but when i press Add button, this matrix rows are not getting saved. and also if i have two rows, when i press add, in database only one row is adding with NULL values. how to save that matrix data?
i am sending my code here. plz help me
ds = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
ds.DoQuery("select a.code as Code,b.Itemname as Desc1,a.quantity as Quantity from itt1 a,oitm b where a.code=b.Itemcode and a.code=' " & oComboBox.Selected.Value & ' "")
'User datasources creation
oForm = SBO_Application.Forms.Item("TBL_JOBWORK_")
oUserDataSource = oForm.DataSources.UserDataSources.Add("dsItemcode", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 40)
oUserDataSource = oForm.DataSources.UserDataSources.Add("dsItemdesc", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 40)
oUserDataSource = oForm.DataSources.UserDataSources.Add("dsQuantity", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 40)
ds.MoveFirst()
oForm = SBO_Application.Forms.Item("TBL_JOBWORK_")
oItem = oForm.Items.Item("mtx_0")
oMatrix = oItem.Specific
oColumns = oMatrix.Columns
Dim oColumn1 As SAPbouiCOM.Column
Dim oColumn2 As SAPbouiCOM.Column
Dim oColumn3 As SAPbouiCOM.Column
' Dim oColumn4 As SAPbouiCOM.Column
oColumn1 = oColumns.Item("col_0")
oColumn2 = oColumns.Item("col_1")
oColumn3 = oColumns.Item("col_2")
' oColumn3 = oColumns.Item("col_3")
While Not ds.EoF
oMatrix.FlushToDataSource()
oForm.DataSources.UserDataSources.Item("dsItemcode").Value = ds.Fields.Item("Code").Value
oColumn1.DataBind.SetBound(True, "", "dsItemcode")
oForm.DataSources.UserDataSources.Item("dsItemdesc").Value = ds.Fields.Item("Desc1").Value
oColumn2.DataBind.SetBound(True, "", "dsItemdesc")
oForm.DataSources.UserDataSources.Item("dsquantity").Value = ds.Fields.Item("Quantity").Value
oColumn3.DataBind.SetBound(True, "", "dsQuantity")
oMatrix.AddRow()
ds.MoveNext()
End While
plz help me any suggesions. in that. i want to save that matrix data in to tables. plz help me urgent asap
regards,
nagababu.
Hi,
UDOs don't save data from UserDataSources (UDS) (and BTW: your code is wrong: you mustn't bind the UDSs to to columns time after time in the loop; that's just wrong). YOu have to handle such data in your code.
Regards,
Frank
Similar Messages
-
Hi,
i am creating a form by using UDO form generator.
in that documet and doucument rows are existed. if user select the combobox value from the form, by taking that value and i am generating a query, i am generating a recordset. by using Userdatasources i am binding each column in matrix.
i binded all values to the matrix successfully. but
but when i press Add button, this matrix rows are not getting saved. and also if i have two rows, when i press add, in database only one row is adding with NULL values. how to save that matrix data?
please help me urgent
asap
regards,
nagababuI believe this is a duplicate of
Udo matrix rows saving problem
Pls read the guidelines. Don't duplicate requests, this just cause confusion and
inefficiency in the forum. And pls remember that this is a community of very very
busy developers, each of them with his/her "urgencies" .... -
Can't delete matrix row in UDO form
Hi all,
i have a problem. I've already searched the forum and found a couple of solutions, but they didn't work.
I can't delete a matrix row. I'm on patch level 39, i've read that patches from 32 to 38 gave some problems with matrix row delete.
Any one has notice regarding same problems with patch 39?
I post the code i'm using for the delete.
matrix.FlushToDataSource()
dbDataSource.RemoveRecord(row - 1)
matrix.LoadFromDataSource()
UIForm.Update()
'Removes the change trace row
changeTrace.RemoveAt(row - 1)
UIForm.Mode = BoFormMode.fm_UPDATE_MODE
Thanks in advanceHi,
I'm using PL39 and I can delete rows in matrix (you are right in previous patch there was an error, and it´s imposible to delete rows). I saw the code you put and I doesn´t undestand what you are trying to do. I explain what I do:
- I enable the menu 1293 to delete row in a matrix, in the menu event i put the following code
Dim oMtx As SAPbouiCOM.Matrix =
oMtx.FlushToDataSource()
This works for me. -
Can't catch the matrix row for Deleting Rows
Hi,
I've already read related topics but couldn't solve the problem.
I catch the Delete Row menu event 1293, but then I can't save the deleted row in an array since it's no longer listed as a selected row.
All the matrix rows return
oMatrix.IsRowSelected(i) = False after catching that 1293 event.
Trying BeforeAction True or false didn't solve that problem.
What am I missing ?
Güit sounds like a bug.
here is workaround: in oMatrix-itempress event try to store selected rowIndex in your variable - so, when you catch 1293-menuEvent you'll know which row you should save - it'll be value of your variable. -
Hello All:
Currently have a UDO that user users, as it get larger there is a need to have the matrix value sorted by a different way (default of course is alphabetically against code column).
Aside from write a new form and handle data source of the matrix myself. Any easier I can resort the exist UDO matrix?
Thank you for any help you can give me.
Also.
I am having a weired problem that when I change viewpanel, element does not change.
I set the item's frompanel and topanel.. And I have the handling script that does "form.PaneLevel = " thing. I know it is something stupid as I done something like this before and stuck on this a bits before and fixed before. But that was several years ago. Can't remember what I did. Any obvious suggestion would be greatly appreciated. First part of this message is more important!
Thank You!Matrix columns can be sort using this code
yourmatrix.Columns.Item("yourcolumn").TitleObject.Sortable = true;
when you click on matrix column header the column will sort automatically -
Get matrix row data and put it into header field with formatted search ???
Hi All,
I ask your help concerning the following:
On an invoice matrix I want to check all Itemgroup Codes of all items in the rows, if there are some rows' items with ItemGroupcode 101 and some others with anything else, then header field should be Y, otherwise N.
My main problem is: how do I put a matrix row data to a header data with checking all rows in the matrix?
A minor problem is that I can't get the formatted search to work on all rows when the formatted search is assigned to the user field in header.
If I put the formatted search to a row field then the row field is filled with the proper value, but the same query assigned to the user field in header works only on the first row.
What am I doing wrong?
SELECT USEDPROD= CASE T0.ItmsGrpCod WHEN 101 THEN Y ELSE N END FROM .[OITM] T0 WHERE T0.ItemCode = $[$38.1.0]
(SBO 7.6)
Any suggestions are welcome.
Thanks.
BálintDear Adele,
Thanks for the answer. The major one cannot be solved. OK, I'll try to get a workaround.
However I still do not understand why my query does not work in all selected rows, just in the first row, i.e. if I assign the query to a header field and I'm positioned in the first row it's OK, but when I add a new item to the second row or any of the next rows, the header field is not updated at all.
Why is that so? Do you have any idea?
Bálint -
Another Delete matrix row thread
I have read some threads with Q&A on the delete matrix row subject but I cant make it work properly. Deleted rows have a tendency to return.
I first tried to make my own:
If pVal.MenuUID = "RmLine" And pVal.BeforeAction = True Then
Set oMatrix = m_oForm.Items("MatrixM").Specific
i = 1
While i <= oMatrix.RowCount
If oMatrix.IsRowSelected(i) Then
If oMatrix.RowCount = 1 Then
oMatrix.AddRow
End If
oMatrix.DeleteRow i
m_oForm.DataSources.DBDataSources("@ITCCR_DM").Clear
oMatrix.LoadFromDataSource
m_oForm.Mode = fm_UPDATE_MODE
End If
i = i + 1
Wend
End If
Problem here is that I cant remove last row without having it return right after.(Thats why I tried the addrow)
Then I tried using SAP's function:
m_oForm.EnableMenu "1293", True
But as soon I hit "Update" the row returns so what do I need to add to the menu event to make it work?I use the two following standard methods for add and delete of rows... so far no problems with them (½ a year)
(Please not that I've have wrapped the entire UI for faster use, so not every method in here are core SDK, but hope you get the idea for the approach)
public int Add(B1ItemEvent pVal,B1DBDatasource Dbds, bool SwitchToUpdateMode, string ColumnToSelect) {
InnerMatrix.FlushToDataSource();
if(Dbds.GetValue_String(0,0)!="" || InnerMatrix.RowCount!=0) {
Dbds.InsertRecord(Dbds.Size);
Dbds.SetValue_String(0,Dbds.Size-1,"");
InnerMatrix.LoadFromDataSource();
InnerMatrix.Update();
if(SwitchToUpdateMode) {
if(pVal.IsFormModeOK) {
InnerForm.SwitchToUpdate();
InnerMatrix.Columns[ColumnToSelect].Focus (InnerMatrix.RowCount);
return Dbds.Size-1;
public bool RemoveSelected(B1ItemEvent pVal, B1DBDatasource Dbds, bool SwitchToUpdateMode, string WarningIfNoRowsSelected) {
InnerMatrix.FlushToDataSource();
int row = InnerMatrix.GetNextSelectedRow(0,BoOrderType.ot_RowOrder);
if(row!=-1) {
InnerForm.Freeze(true);
while(row != -1) {
InnerMatrix.DeleteRow(row);
if(InnerMatrix.RowCount==0) {
Dbds.BlankRecord(0);
row = InnerMatrix.GetNextSelectedRow(0,BoOrderType.ot_RowOrder);
InnerForm.Freeze(false);
InnerMatrix.FlushToDataSource();
InnerMatrix.Update();
if(SwitchToUpdateMode) {
if(pVal.IsFormModeOK) {
InnerForm.SwitchToUpdate();
return true;
else {
Notification.Statusbar_Warning (WarningIfNoRowsSelected);
return false; -
Master Data row delete problem
Hi.
I have an UDO(master data with details) form, I use code below to remove single detail line and to keep row numbering correct, for which UserDatasource is used, "row" is a currently selected matrix row number.
form.DataSources.DBDataSources.Item("@MYDETAILS").RemoveRecord(row - 1);
for (int i = row - 1; i < form.DataSources.DBDataSources.Item("@MYDETAILS").Size; i++)
form.DataSources.UserDataSources.Item("udsRowNo").Value = (i + 1).ToString();
form.DataSources.DBDataSources.Item("@MYDETAILS").Offset = i;
matrix.SetLineData(i + 1);
matrix.DeleteRow(matrix.RowCount);
if (form.Mode == BoFormMode.fm_OK_MODE) form.Mode = BoFormMode.fm_UPDATE_MODE;
This code work fine, but when datasource(so matrix too) contains just one line and after RemoveRecord(row-1) form.DataSources.DBDataSources.Item("@MYDETAILS").Size returns 0, after forms Update (Update button click) form.DataSources.DBDataSources.Item("@MYDETAILS").Size again returns 1.
Can anybody help me?
Thanks.
Edited by: Rui Pereira on Dec 23, 2008 11:23 AMhi
try this code
oDBDataSource.Clear();
oMatrix.DeleteRow(i);
oMatrix.FlushToDataSource();
may be it helps you
rajesh saini -
Mail attachment saving problem
Hi,
When I tried to save a Mail attachment today I got the following warning:
Mail was unable to save the attachment “File.numbers” to disk. Please verify your downloads folder exists and is writable.
The warning must be wrong because other attachments, even of the same kind, can be saved without problems. I observed that only such files are effected which contain subdirectories like numbers, keynote, etc. and my suspicion is, that the saving problems may come from wrong file reading/writing rights within these subdirectories, that the sender of the Mail may have imposed to prevent unwanted changes to his/her file. May this be so? Otherwise, what else?
(MacOs X 10.5.6, Mail.app 3.5 and, in this particular case, Numbers08)
Thanks for for help in advace!
Joe.Hi Kappy,
Nothing at all. No error message but no copying either, and no change in the curser appearance when dragging to the Desktop.
When I go to Mail --> Message --> Forward as Attachment, the attachment in the composer window can be saved like a normal file and has an appropriate size, eg. the desired original file seems to be contained in there. However, I have no Idea how to extract the original .numbers file from that.
Strange, isn't it?
Thanks,
Joe. -
Microsoft word notebook layout Saving Problems
Hi
I'm having problems with my microsoft word where in notebook layout it won't allow me to save when the ending is docx, which is the usual saving ending. It allows me to save publisher and normal blank word documents, however not the notebook layout. I'm using Snow Leopard and word 2011, have done the updates, and it's the update version of 14.2.3. When i took it to Apple they couldn't help me besides telling me that maybe i have a corrupted file on my laptop and that i should make a new user and transfer my files over. However, if there is a corrupted file then it would just go onto the new user and it also doesn't allow me to prevent it, if the saving problems happen again.
Has anyone seen this or does anyone know how to fix this problem? Could it be a virus or a corrupted file? And if it's a corrupted file how do i find it to delete it?
Thanks if anyone could help.http://answers.microsoft.com/en-us/mac/forum/macword
-
Photoshop CS4 file saving problem...
Photoshop CS4 file saving problem: When no file name is specified, Photoshop saves file to the root directory of the drive instead of the current folder. It auto names the image with the name of the folder that was active. Can this be fixed?
BTW: I was using "save for web"--not sure if it that matters.Bug reports should go in the main forum.
And yes, SFW has it's own file code so that is a very important detail. -
Hi
I have been observing that my matrix row deleted before executing my code for delete the matrix row. I write my code in BeforeAction=False and I use the menu id to delete the row in matrix.
Some code snap
If pval.BeforeAction = False Then
Select Case pval.MenuUID
Case MenuID.Add_Row
BubbleEvent = Me.AddRow
Case MenuID.Delete_Row
BubbleEvent = Me.DeleteRow
Case MenuID.Duplicate_Record
'oForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE
End Select
Else
And My Delete Row logic is
Private Function DeleteRow() As Boolean
If iRow <= 0 Then
Return False 'If no row selected
End If
'oSIONMstDtl = oForm.DataSources.DBDataSources.Item("@INCM_SIONDTL")
oExeMatDtl.Clear()
Try
oMatrix = oForm.Items.Item("MtxExeMat").Specific
oMatrix.DeleteRow(iRow)
' oForm.DataSources.DBDataSources.Item("@INCM_SIONDTL").RemoveRecord(iRow)
Catch ex As Exception
MsgBox(ex.Message)
End Try
For i As Integer = oMatrix.RowCount To 1 Step -1
oEdit = oMatrix.Columns.Item("ColSr").Cells.Item(i).Specific
oEdit.Value = i
oMatrix.GetLineData(i)
Next
If oForm.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE Then
oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
End If
Return False
End Function
Edited by: Manmath Das on Feb 10, 2010 1:26 PM
Edited by: Manmath Das on Feb 10, 2010 1:28 PMI use this code in deleting row. and it works fine in all may addon. I use C# in my development.
public virtual void menuevent(string FormUID, ref SAPbouiCOM.MenuEvent pVal, ref bool BubbleEvent)
if (pVal.BeforeAction)
switch (pVal.MenuUID)
case "1293": // deleterow
ondeleterow(is_CurrentMatrixUID, il_CurrentMatrixRow, ref BubbleEvent, false);
break;
public override void ondeleterow(string matrixuid, int row, ref bool BubbleEvent, bool innerevent)
base.ondeleterow(matrixuid, row, ref BubbleEvent, innerevent);
int li_rowcount;
SAPbouiCOM.Matrix oMatrix;
GC.Collect();
oForm.Freeze(true);
oMatrix = (SAPbouiCOM.Matrix)oForm.Items.Item(matrixuid).Specific;
oForm.DataSources.DBDataSources.Item("@FAIAC1").RemoveRecord(row - 1);
oMatrix.DeleteRow(row);
li_rowcount = oMatrix.RowCount;
for (int li_row = 1; li_row <= li_rowcount; li_row++)
setColumnString(matrixuid, "LineId", li_row, li_row.ToString());
oForm.Freeze(false);
BubbleEvent = false;
Hope this will help you.
Regards
John Wilson de los Santos -
Hello,
My form is in ADD Mode and i'm deleting some rows from it thru my code using the following code:
matItems = SBO_Application.Forms.ActiveForm.Items.Item("38").Specific
matItems.DeleteRow(intMatRow)
Now,
This deletes the row at intMatRow, but the matrix row numbers do not reset as they do when we select and delete a row manually.
For. eg.: if there are 3 rows in my matrix and i delete the first row, then the row numbers remain 2 and 3 for the remaining rows.
I want them to change to 1 and 2 as there are only 2 rows now.
Please help me with this.Hi Rohan
try This
in menu event pval before action false
If pVal.MenuUID = "1293" Then
If objForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE Then
For intCurrentRow = 1 To objMatrix.VisualRowCount
objMatrix.Columns.Item("V_-1").Cells.Item(intCurrentRow).Specific.Value = intCurrentRow
Next
End If
End If
in item event for any validation regarding matrix use visualrowcount
ex code:
If objMatrix.Columns.Item(1).Cells.Item(objMatrix.VisualRowCount).Specific.Value = "" Then
Call objMain.objUtilities.MatrixDeleteRow(FormUID, "11", objMatrix.VisualRowCount)
End If
Rgds
Micheal
Edited by: micheal willis on Aug 11, 2009 8:06 PM -
Hi Expert, Matrix row enable false
Hi ,
I Want to enable false matrix row for my some condition.
If u have any idea share with me.
thanks in adva.
Regards
Rajkumar GuptaHi Rujkumar,
You need to catch the GotFocus ItemEvent, for the matrix, and in the pVal.BeforeAction, check if the row should be enable or not. If it should not be enabled, you cancel the event (GotFocus) by setting BubbleEvent = False.
Regards,
Vítor Vieira -
Hi
I have a UDForm whith a Matrix in it.
And i need to close the matrix row's as sales order
are generated for the row data 1 sale order per row
like for example a sales order when it is pratialy ivoiced
Can i dataBind the row status to a UDF in a UDT
some thing like the LineStatus in the RDR1 system table 'Sales Order lines'
Thanks for any help you can provied
Pedro GomesIf you mean that you want to gray out (disable) a line in a matrix, then I would say that it is not possible. But you can catch events on the matrix and prevent editing of your closed lines (if you forsee a 'state' field in your UDT).
Maybe you can do something with the grid object, and use the collapselevel to visualize the difference between closed and open lines.
regards,
Jurgen
Maybe you are looking for
-
Difference between XI 3.0 and PI 7.0
Hi, What is difference between XI 3.0 and PI 7.0 Is this way we check version: System-- Staus -- Component Information -- PI_BASIS -- 2005_1_700 So the above system is PI 7.0 -- right? Regards
-
Setting up Java 3D in linux for Eclipse programming...
I'm trying to start programming with Java 3D, but I think I'm having problems with the initial setup. I installed Java3D using the amd64 bin script into the active jre: /usr/lib/jvm/java-6-sun/jre/. I'm working in Eclipse and have included j3dcore.ja
-
NW 7.3 and roles from backend instances
Hi I'm trying to find out more information about roles from backend instances in NW 7.3. In particular how the roles are synchronised with changes that may occur to the roles in the backend (ie role changes or users allocated to the role). I haven't
-
I have been using iCal for some time, and have numerous Calendars I wish to "import" into Entourage. I have tried synching with .mac but no joy. I seem unable to "copy" the calendars over. Is there a easy way of doing this? Justin
-
How to install driver for Intel Pro 1000 PCI Network-card
Hello, I just bought the a.m. Intel Pro 1000 Network adapter, but I don't know at all how to install the driver for Solaris 10. The installation instructions delivered from Intel didn't help me at all, because I can't uncompress the INTCGigae.pkg and