Matrix Row Status
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 Gomes
If 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
Similar Messages
-
Greetings All,
Does anyone know how i can check if a matrix row is enabled or disabled prior to updating the field? I need to know because my add on is throwing an exception stating invalid form item if the matrix row is disabled.
Any ideas?Hi Curtis
I'm not aware if you can make a row enabled or disabled...never seen it. I know you can make a whole matrix enabled or disabled. Also if you want an extra line in the matrix you add a extra one and that then becomes available. When you say disabled is this when you haven't said you want an extra row and it doesn't allow to add the row details?
Well, to check if a matrix is enabled you do something like
Dim item As SAPbouiCOM.Item
item = oForm.Items.Item("matrixID")
If item.Enabled = False Then item.Enabled = True
Then to see how many records are in your matrix use
oMatrix.RowCount
It will return the number of records in the matrix. But remeber if its your own matrix you should always add a line omatrix.addrow before specifying the row contents.
Hope this helps -
Restricitng activity in a Matrix row
Good Afternoon
Experts:
I have spent a 1/2 day so far trying to figure out how to restrict any activity in a row based on a value in a cell of that row. Unfortunately, it appears I have met my match on this one.
<b>Application Scenario:</b>
1)Material Requisition Line gets converted to a PO
2)Status of that Line in the Matrix for that Material Requisition gets changed
to "Conv"
<b>Required Behavior:</b>
No activity can happen in a row that has a Status = "Conv"
I went through all of the Events that appeared like they may help...Got_Focus, Validate, Combo_Select etc. Then I sat back and thought...well I cannot afford to try and account for all possible activity intiation for all the cells of a row. I need
some "big picture" way to "disable"(I know there is no official row disable) a row if the status of the row = "Conv"
I suspect I may have to do it in the ItemEvent of the screen. In English, if ItemEvent is on the Item "mtxMat" and pVal.row Status = "Conv" then don't allow any changes. I tried that for a bit and the BeforeAction True/False was giving me trouble.
Does anyone see something that I can try?
Thanks,
EdGood Morning
After coming across a few posts about diasabling rows in a Matrix, I thought perhaps I was on to an idea. However, I am interested in documentation on how SAP processes EventTypes. For example, when someone clicks a cell or tabs into a row, what order of events are processed...Focus, Validate then Click?
How can I find out?
Thanks,
Ed -
Hi,
I'm creating a custom page in OAF, and I have a question about row status. I am curious to know if there is a way to determine if a row has been committed to the database yet or if it is just sitting in the cache.
Basically, we have a 1-1 relationship between two tables. When a user tries to a new record in table B, it must be associated with an existing record in table A. When the user goes to the create page for table B, a new record is immediately created (per the examples in the toolbox tutorial) and the user can enter data and select a record from table A to associate with, via an LOV.
If a user tries to create a new record in table B using a record in table A that already has an existing association, our client would like us to move them to the already existing record in table B. If we do this, we'd need to discard the new record we originally created so that it does not get entered in the database.
I'd like to know if there's a way to tell if a row has just been created or if it is a row that was already present on the database. My concern is that a user could sequentially select any number of records from table A that may or may not have an association, so I'd like to be able to tell which rows should be discarded as they go.
I'm imagining a user goes to the create record page for table B does something like the following while deciding which record from A to associate with:
1) Select record from A with no association -> use new record for B.
2) Select another record from A that has association -> move to existing B record, check if record from step 1 is new: if so - discard it, if not - ignore it
3) Select another record from A that has association -> move to other existing B record, check if record from step 2 is new, if so - discard it, if not - ignore it
So, I just want to know if it's possible to tell whether a record is new or one that comes from the database.
Any suggestions will be greatly appreciated!
Thanks!
JohnYou can use getEntityState() on EO object to get the status of the row. It returns one of the following:
STATUS_NEW - the entity object is new in the current transaction
STATUS_DELETED - the entity object originated in the database, and has been deleted in the current transaction
STATUS_MODIFIED - the entity object originated in the database, and has been changed
STATUS_UNMODIFIED - the entity object originated in the database, and has not been changed, or it has been changed and those changes have been committed
STATUS_DEAD - the entity object is new in the current transaction and it has been deleted
STATUS_INITIALIZED - the entity object is in a "temporary" state and will not be posted or validated -
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 -
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,
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 -
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 -
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 all
How is it possible to trace Purchase Order Item row status to know the SAP User who updated to manually Close Purchase Order Item Row?
We would like to know such result at one listing to see all Purchase Orders and Item Rows affected by such Manual Closed Purchase Order.
KedaleneHi,
Try this query:
SELECT T2.DocNum,T2.[CardName],T2.[NumAtCard],T0.ItemCode,T0.Quantity
, T2.UpdateDate, T2.[DocTime], T4.[U_Name] as 'UpdatedBy'
FROM adoc T2
JOIN ado1 T0 ON T2.docentry = T0.docentry AND T2.Objtype = '22'
JOIN por1 T1 ON T1.docentry = T0.docentry AND T1.Linenum=T0.Linenum inner join OPOR t3 on t3.docentry = t1.docentry
INNER JOIN OUSR T4 ON T2.UserSign2 = T4.INTERNAL_K
WHERE T3.[DocManClsd] ='y' and T1.[TrgetEntry] is null and T1.[LineStatus] = 'c' order by T2.DocNum
Thanks & Regards,
Nagarajan -
Is there a way to check a Rows status on the client side in an ADF Swing application in JDeveloper 10.1.2? I see that you can check it in the custom EntityImpl, but that doesn't help me on the client side. In our scenario, we have a JDatePicker component that we need to restrict the available dates after the users change the year value in a bound TextField. We only want to do this on a new row, however. So once the year field is changed on a new row, we want to call a client side method that restricts the available dates. Unfortunately, the date selection model of the date picker isn't bound, so we don't see a way to handle this scenario since we can't restrict it from the EntityImpl and we can't get the Row status from the client.
Any suggestions would be appreciated.
Thanks
ErikOk. So there doesn't appear to be a clean way of doing this in ADF. I can pecemeal something that seems to work using a PanelRowSetListener and some flags, but it isn't a very clean solution. This is something that an Oracle Forms developer would probably do in most projects. It's kind of hard for you guys to lure Oracle Forms developers to ADF if it's missing common functionality such as this. May we request an enhancement to the Row interface to allow it to actually return it's status in some future JDeveloper release?
Thanks
Erik -
Hello all,
I need to che the Row Status of a table to know if has been modified a "messageLovInput" item. No PPR event fires due to the fact I have disabled the "validation" property.
Could anybody help me? Please it's very urgent and I'm getting crazy :-(
Rosanna.Any idea?????
I've tried to reset the "disable validation" to false (as default) so the LOV pops up, but when I tabbed out from the lov item, the processFormRequest of the page controller has not been called.
Does anybody know how to trace the lovItem tabbed out? I mean before the lov region pops up.
Thanks to anybody will answer me.
Rosanna. -
I have master detail setup real similar to a department employee setup. I'll use that as my example for simplicity. From the master page, user can select a button which will bring them to the associated detail row(s) page. There, the user can edit, create, delete rows. When finished, they have 2 options -- selecting OK button or selecting Cancel button. If they select the OK button, i want the changes/additions/deletions that were made to be stored temporarily until a commit is performed. However, if they choose the Cancel button, i want any changes made to these employee records undone, or reverted. I'm trying to use the framework to track the status of these rows, but it seems to come up short of the functionality i need. Here's a step by step example of the type of problem i'm having.
1) User creates a new employee record on the details page. At this point, the status of the row is STATUS_NEW.
2) User clicks OK, returning them back to the master page. The newly created row is still around.
3) User goes back in to the detail page and creates another employee record. Now, I have two employee records, both with a status of NEW. If user clicks the cancel button after creating the second employee row, what i need is for the second row only to be deleted or removed, because the first row is temporarily saved because user selected the ok button after creating it. However, the code i have behind the cancel button iterates thru all the detail (employee) records and does a refresh(Row.REFRESH_REMOVE_NEW_ROWS | Row.REFRESH_UNDO_CHANGES) to remove those rows that were just created or to undo changes made to those rows since coming in to the page. The problem with this is that the first employee record still has a status of NEW because nothing has been committed, so it gets deleted/removed along with the second row that was created. Calling postchanges() behind the OK button isn't an option because these are detail rows in a one to many relationship, so obviously there can't be an insert of a child row without the parent row being saved first. Can i use the framework and this row status stuff to accomplish what i need, or am i going to have to write a bunch of my own code to keep track of row status? Thanks.Try this
Change this in JS
vAjaxRequest.add('AI_TEMPORARY_ITEM', pThis.value);To
vAjaxRequest.add('x01', pThis.value);In the Application Process make following changes
DECLARE
NumRec number := 0;
-- New line below. enquote_literal is to prevent SQL Injection
vTemp varchar2(4000) := dbms_assert.enquote_literal(apex_application.g_x01);
BEGIN
--NumRec:=issue_tracking_pkg.issue_status_exists(:AI_TEMPORARY_ITEM);
NumRec:=issue_tracking_pkg.issue_status_exists(vTemp);
htp.p(NumRec);
-- htp.p(:AI_TEMPORARY_ITEM);
END;Regards, -
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;
Maybe you are looking for
-
My ipod is not being read, but my sister's is and we have the same ipod
I have a 2GB grey nano ipod and its not showing up on my computer or itunes, but it will still charge it. HOWEVER, my sister has the same ipod, and hers is able to be read by the same computer that i am using. I dont know what is wrong with my ipod??
-
Error in form submit through netui:anchor tag onClick event
Hello, I am working on a portal application. Below is my jsp code of a simple search screen. The search parameter is customername. <netui:form action="searchCustomer" style="form" tagId="myForm"> <netui:textBox dataSource="{actionForm.customerName}">
-
Hi, When I write code as Resultset rs = ..... rs.last(); there is no problem for MySQL JDBC Driver, but when I use this code for Oracle, I am getting error with line 2. Why ? Do you know any Oracle JDBC Driver that supports "rs.last()" ? Or is there
-
Have there been any virus reports or malware affecting the iPad or any iOS devices? Thanks
-
Hi Experts, Where can I find the Bapi Function Modules. Can u provide me the coding part of how to use BAPI in our program . Will be rewarded if helpful. Regards.