Add row invoice matrix
Dear all
I owe add row in matrix woth different information.
How ican do?
Sorry for my english
Thank's
First, in sap business one open the 'Fattura in uscita' form, then in menu 'View' set 'Informazioni di debug'.
Here you can see the column number corresponding to the fields you want to add in the row.
In your code use this information to insert records in the grid. Here's an example in VB6.
For i = 1 to 10
'Codice
Set c = m.Columns("1").Cells(i).Specific
c.Value = "Cod" & i
'Quantità
Set c = m.Columns("11").Cells(i).Specific
c.String = "10"
Next i
(c is a EditBox, m is the Fattura detail matrix)
Hope this helps
Ciao
Similar Messages
-
hello expert
i want to know how to add row in matrix as like in SAP b1.i create the code to add row in matrix by button but this is so many time consuming for end user due to this i want to add row functionality automatic as like SAP B1.so pls help me sir for this
thanx a lotHi
you can add row in matrix on lost focus of a column
Regards -
Hi All,
I want to add a row in matrix by clicking the Add Row option by right clicking on the matrix. If the form has one matrix means its working well. But if the form has more than one matrix if i activate the Add Row menu and write the code in the MenuEvent i am not able to give the ItemUID so if i add row in any of the matrix one row is added in all the matrix. How can i solve the problem.
Thanks in Advance.
Regards,
Madhavi.Hi Madhavi,
save the position and and the itemuid in a variable.
use the et_GOT_FOCUS event for this - than you know always in which matrix
and position you're standing.
use the variables in the et_MENU_EVENT to add the row in correct matrix and position
lg David -
Add Row in Matrix by pressing "Alt" button in last cell of matrix
Hello All,
I want to enable the rows of the matrix by pressing "Alt" in the last column so that the next row get enabled instead of
pressing the "Add Line" Button every time.
I have done it by pressing "Tab" using pval.charpressed="9"
But i want to do it by pressing "Alt" key is this posible.
Please share the code or suggest any way to do it .
Thanks & Regards,
AmitHi Amit,
Only Tab, Enter, Escape, Delete and Back Space are available to charpressed. Alt button has no equivalent coding.
Thanks,
Gordon -
Hey All
I hava problem with AddRow to Matrix because after add row to Matrix, added row is copy of previous
I use this code:
Matryca.AddRow(1, -1)
Matryca.Columns.Item(1).Cells.Item(i + 1).Click SAPbouiCOM.BoCellClickType.ct_Regular)
Thanks very much for answers
regards
Krzysztof SalaThanks
it run
I use:
i = pVal.Row()
DBDS1.InsertRecord(i)
Matryca.LoadFromDataSource()
Matryca.Columns.Item(1).Cells.Item(i + 1).Click SAPbouiCOM.BoCellClickType.ct_Regular)
regards
Krzysztof Sala -
Hi,
I have a Form having matrix, and it is bind with 2 UDT Tables. One of 'Master Type' and Other is 'Master Data Lines'.
All the operation 'ADD,UPDATE,FIND,DELETE, ADD ROW' and the operation for Navigation Buttons are working fine.
But when I navigate to any previous record,following problem arises :
1. When i add row to matrix it copies data from the previous row.
2. Now after 1st operation i change the newly added row , due to this form goes in Update mode.It is also fine.But when i press the Update Button i get the message records updated successfully, but the problem is newly added row in the matrix does not inserted in DataBase
I need the solution for both problems.
Thanks in advance.Here some sample I used to test it:
Case SAPbouiCOM.BoEventTypes.et_KEY_DOWN
Dim l_Mat As SAPbouiCOM.Matrix
l_Mat = oForm.Items.Item("Matrix2").Specific
If pVal.CharPressed = 13 And (pVal.Row = l_Mat.RowCount) Then
Dim _UDSS As SAPbouiCOM.UserDataSources
' Clear the UDS before adding a new line
_UDSS = oForm.DataSources.UserDataSources
UDSS.Item("UDSCode").ValueEx = ""
UDSS.Item("UDSName").ValueEx = ""
UDSS.Item("UDSPhone").ValueEx = ""
l_Mat.AddRow()
End If
If you are using DBDatasources is easier (1st post)
Regards,
Felipe -
hello expert
i want to create add row functionality by right click event like in SAP B1 when we click on matrix colum it give menu for Remove,copy,add row in matrix how i do it by in my userdefiend form matrixHello,
If you enable the menu on your form Add row (menu id: 1292), Del Row (menu id: 1293 )it will automatically appear in right click .
copy should be added indivudally, and developed the functionality for each
enable them:
oForm.EnableMenu("1292", True)
oForm.EnableMenu("1293", True)
You can use MenuEvent to add/del/copy rows in the matrix or RightClickEvent
Regards,
J. -
hi guys,
I created one form in screen painter and used this form in VB.net. In this form one grid is available.
In the menuevent of this form I write the code for open the form when user click on menu. I also write the code for add row in the matrix.
When I open the form first time both opening the form as well as adding row into the matrix works fine.
After closing the form and open the form second time menuevent occur more than 2 times.
Due to this many rows are added in the matrix only one click of add row.
What would be reason for occuring menuevents more than 2 times?
Can anyone help me?
thanks in advance.hi kamil,
this function is called when click on Menu event.
when form is loaded.
// code when form is loaded from XML File.
Public Sub LoadForm1()
Dim oXmlDoc As Xml.XmlDocument
oXmlDoc = New Xml.XmlDocument
Dim sPath As String
Try
sPath = IO.Directory.GetParent(Application.StartupPath).ToString & "\"
oXmlDoc.Load(sPath & "NewInvoicePO.srf")
Dim cp As SAPbouiCOM.FormCreationParams
cp = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)
cp.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Fixed
cp.FormType = "Invoice"
cp.XmlData = oXmlDoc.InnerXml
cp.UniqueID = "IndentPO"
cp.ObjectType = "POHeader"
oForm1 = SBO_Application.Forms.AddEx(cp)
oForm1.Title = "Indent PO"
oForm1.AutoManaged = True
oForm1.SupportedModes = -1
'oForm1.DataBrowser.BrowseBy = oForm1.Items.Item("33").Specific().value
oForm1.Freeze(True)
oForm1.EnableMenu("1281", True) '// Add Find Mode
'oForm1.EnableMenu("1282", True) '// Add New Record
oForm1.EnableMenu("1288", True) '// Next Record
oForm1.EnableMenu("1289", True) '// Pevious Record
oForm1.EnableMenu("1290", True) '// First Record
oForm1.EnableMenu("1291", True) '// Last record
oForm1.EnableMenu("1292", True) '// Add Row
oForm1.EnableMenu("1293", True) '// Delete Row
oForm1.EnableMenu("1294", True) '// Duplicate Row
AddDataBindToMainForm()
CreateMatrixForForm1()
oDBDataSource4 = oForm1.DataSources.DBDataSources.Add("@INDENTPOMASTER")
oDBDataSource5 = oForm1.DataSources.DBDataSources.Add("@INDENTPOCHILD")
oForm1.DataBrowser.BrowseBy = "31"
GetMaxPONo()
oForm1.Freeze(False)
oForm1.Visible = True
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
I write the following code in the item event when click on close button.
// code when click on close button
If pVal.FormUID = "IndentPO" And pVal.ItemUID = "2" And pVal.BeforeAction = True Then
Try
oForm1.EnableMenu("1288", False) '// Next Record
oForm1.EnableMenu("1289", False) '// Pevious Record
oForm1.EnableMenu("1290", False) '// First Record
oForm1.EnableMenu("1291", False) '// Last record
oForm1.EnableMenu("1292", False) '// Add Row
oForm1.EnableMenu("1293", False) '// Delete Row
oForm1.EnableMenu("1294", False) '// Duplicate Row
Exit Sub
Catch ex As Exception
'MsgBox(ex.Message)
End Try
End If
In the first line of the try block I got the error.
Error : object reference not set to an instance of an object. -
How to add data through matrix from sales order row level to
user defined document type table ...
i created matrix in user defined form, i placed one edit text box on that form
when i entered docnum of sales order the data of sales order row level should have to
upload to matrix , after fill up the some data in matrix that data should have to add to the user defined document type table
any one have code pls post it
thanqHi rajeshwar
Here is a sample function related to ur senario. just check it out and use the concepts.
Here I have used a CFL to get the itemcode and I have used a query to add data to matrix.
This is a function used.
Private Sub AddValuesInMatrix(ByRef name As String)
Try
'Dim quantemp As Double
oForm = SBO_Application.Forms.Item("itemdts")
oMatrix = oForm.Items.Item("matrix").Specific
Dim rs As SAPbobsCOM.Recordset = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
'//gitemdesc = "SELECT T0.[ItemName] FROM OITM T0 WHERE T0.[ItemCode] ='" & name & "'"
oMatrix.Clear()
rs.DoQuery("SELECT T0.[DocEntry], T0.[ItemCode], T0.[Dscription], T0.[Quantity], T0.[Price], T0.[TaxCode] FROM dbo.[POR1] T0 WHERE T0.[ItemCode] ='" & name & "'")
rscount = rs.RecordCount
If (rscount < 1) Then
SBO_Application.StatusBar.SetText("No Items Found", SAPbouiCOM.BoMessageTime.bmt_Short)
Else
oForm.Freeze(True)
ITE = True
For i As Integer = 1 To rs.RecordCount
oMatrix.AddRow()
oMatrix.Columns.Item("V_5").Cells.Item(i).Specific.Value = rs.Fields.Item("DocEntry").Value
oMatrix.Columns.Item("V_4").Cells.Item(i).Specific.Value = rs.Fields.Item("ItemCode").Value
oMatrix.Columns.Item("V_3").Cells.Item(i).Specific.Value = rs.Fields.Item("Dscription").Value
oMatrix.Columns.Item("V_2").Cells.Item(i).Specific.Value = rs.Fields.Item("Quantity").Value
'quansum = quansum + rs.Fields.Item("Quantity").Value
oMatrix.Columns.Item("V_1").Cells.Item(i).Specific.Value = rs.Fields.Item("Price").Value
'pricesum = pricesum + rs.Fields.Item("Price").Value
oMatrix.Columns.Item("V_0").Cells.Item(i).Specific.Value = rs.Fields.Item("TaxCode").Value
SBO_Application.SetStatusBarMessage("Data Loading In Progress Please Wait.....>>> " & i & " / " & rs.RecordCount, SAPbouiCOM.BoMessageTime.bmt_Short, False)
rs.MoveNext()
Next
ITE = False
oMatrix.AutoResizeColumns()
SBO_Application.StatusBar.SetText("Data Loading Completed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success)
oForm.Freeze(False)
oForm.Refresh()
End If
Catch ex As Exception
SBO_Application.MessageBox("Matrix Load Function : " & ex.Message)
ITE = False
End Try
End Sub
-Anto -
How to add data to A/R Invoice Matrix via DI API ?
Hello everyone,
Could you please answer to my question?
I insert new button on SAP system form (A/R Invoice). I want to add new line with item code at Invoice Matrix when I click the button.
Thanks,
KZTHi Kyaw,
If you want to update an Existing Sales Invoice Document then I am sorry but it is not possible.
But if you want to create a whole New Document with DIAPI then try this:
Dim oInvoice As SAPbobsCOM.Documents
oInvoice = ocompany.GetBusinessObject(BoObjectTypes.oInvoices)
oInvoice .CardCode = "C001"
oInvoice .DocDate = "Date"
oInvoice .DocDueDate = "Date"
oInvoice .Lines.ItemCode = "ItemCode"
oInvoice .Lines.Quantity = 1
oInvoice .Lines.Price = 100
oInvoice .Lines.DiscountPercent = 2
oInvoice .Lines.TaxCode = Tax
oInvoice .Lines.Add()
Finally try to add using oInvoice .Add()
Hope it helps.
Thanks & Regards
Ankit Chauhan -
Changing column value on every row in invoice matrix
Hi,
I'm trying to change the value of the GLaccount column for every row in the invoice matrix when the user changes the document owner. The code seems to work for the first row but then on other rows I get a message that says the item can't be changed because it can't get focus. I know there are similar posts on the forum already, but nothing that solves this problem that I can see.
My code follows:
<B1Listener(BoEventTypes.et_CHOOSE_FROM_LIST, False)> _
Public Overridable Sub OnAfterChooseFromList(ByVal pVal As ItemEvent)
Dim ActionSuccess As Boolean = pVal.ActionSuccess
Dim form As Form = B1Connections.theAppl.Forms.Item(pVal.FormUID)
Dim item As Item = form.Items.Item("222") 'document owner
Dim item2 As Item = form.Items.Item("38")
Dim Matrix As Matrix = CType(item2.Specific, Matrix)
Dim userID As String
userID = ChooseFromList_Value(pVal)
If ActionSuccess And pVal.InnerEvent Then
ChangeMatrixAccounts(Matrix, userID)
End If
End Sub
Friend Function ChangeMatrixAccounts(ByVal zMatrix As SAPbouiCOM.Matrix, ByVal zDocOwner As String) As ReturnStatus
For x = 1 To zMatrix.RowCount
Dim cell As SAPbouiCOM.Cell = zMatrix.Columns.Item("159").Cells.Item(x)
Dim oedit As SAPbouiCOM.EditText = zMatrix.Columns.Item("159").Cells.Item(x).Specific
cell.Click(SAPbouiCOM.BoCellClickType.ct_Regular) 'force focus, I hope
ChangeRevenueAccountInCell(oedit, WhseGLLocCode)
Next
end function
Private Function ChangeRevenueAccountInCell(ByVal zGLAcct As SAPbouiCOM.EditText, ByVal zWhseGLLocCode As String) As ReturnStatus
Dim tempwork(2) As String
'change the value of the matrix cell passed in to the new gl acct
tempwork = zGLAcct.Value.Split("-")
<b>zGLAcct.Value = tempwork(0) & "-" & tempwork(1) & "-" & zWhseGLLocCode</b>
Console.Write(" Changed GL value")
End Function
Is there more to it than that? -- THANKS!Hi John,
I don't know if this is of use, but here's the code I used to set the project code value on each row of a marketing document through the UI (which is similar to what you are looking to do). The Project Code column needs to be visible and editable for this to work:
Private Function SetProjectCodeOnRows(ByVal oForm As SAPbouiCOM.Form, ByVal oMatrix As SAPbouiCOM.Matrix, ByVal sProjectCode As String) As Boolean
Dim bSuccess As Boolean = True
Dim sItemCode As String
Dim sExistingProjCode
Dim i As Int32
Dim oCol As SAPbouiCOM.Column
Dim oEdit As SAPbouiCOM.EditText
Dim oFolder As SAPbouiCOM.Folder
'Select the Contents folder before updating any project codes
oFolder = oForm.Items.Item("112").Specific
oFolder.Select()
For i = 1 To oMatrix.RowCount
Try
' Check to see if an item code has been entered (last line will always be empty)
oCol = oMatrix.Columns.Item("1")
oEdit = oCol.Cells.Item(i).Specific
sItemCode = oEdit.String
' Read the project code from the row
oCol = oMatrix.Columns.Item("31")
oEdit = oCol.Cells.Item(i).Specific
sExistingProjCode = oEdit.String
If sExistingProjCode = "" And sItemCode <> "" Then
oEdit.Value = sProjectCode
End If
Catch ex As Exception
m_sboApp.SetStatusBarMessage(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Medium, True)
bSuccess = False
End Try
Next i
SetProjectCodeOnRows = bSuccess
End Function
Kind Regards,
Owen -
In Matrix Value is duplicating while giving add row
In matrix i have given add row but the value is duplicating from the previous row in update mode.in add mode its ok
and while clicking update = error is coming "This entry already exists in the following tables "
plz help
its UrgentHi Nikhil k,
This is a kind of behavior of matrix.
So what you can do is that after calling the AddRow () Method put the blank values in the newly added row. Use this as follows:
oMatrix.AddRow();
oMatrix.FlushToDataSource();
this.oForm.DataSources.DBDataSources.Item("@DETAILTABLE").SetValue("U_Code", oMatrix.VisualRowCount - 1, "");
this.oForm.DataSources.DBDataSources.Item("@DETAILTABLE").SetValue("U_Name", oMatrix.VisualRowCount - 1, "");
oMatrix.LoadFromDataSource();
Hope it helps.
Thanks & Regards
Ankit Chauhan -
Matrix Add Row and Duplicate Row
Hi All,
Can anybody suggest me how to work on Add row and duplicate row in any document table.
Lets take one example
Sales order document
In this doc we have table format where we specify item no, item description etc. In this table when we right click on particluar row we have option for add, delete, duplicate rows..etc.
wht i would like to know is that when we click add row .....one row is added and number is incremented under # column. Hw to perform and display this auto increment/ decrement of number for these rows under this # column
thanks
harishHi,
I tried following both code, but in that i am geting value. Means i am getting .Value Why i not getting value.
matrix.Columns.Item("V_-1").Cells.Item(pVal.Row).Specific.value = matrix.RowCount
and i also tried for "AddRow",
If pVal.BeforeAction = False Then
Select Case pVal.ItemUID
Case "AddRow"
matrix = form.Items.Item("mtr").Specific
If matrix.RowCount > 0 Then
If Trim(matrix.Columns.Item("V_-1").Cells.Item(matrix.RowCount).Specific.value) = "" Then
End If
End If
End Select
End If
In both example i not getting .Value.
Plz tell y ?
Thanks -
ADD SIGNATURE IN MATRIX REPORT FOR EACH ROW
i want add field( signature)in the last of row in matrix report
Put the signature image in the intersection area of the crosstab. In the image format trigger return true only for the row/column you wish the signature to show up.
-
Hai,
As soon i click add row button it is displaying following error message.
DataSource- Out of boundaries [66000-29]. Please let me know how i can correct this error message
<b>Code below</b>
Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
Try
' Events of the Blanket Agreement form
If (FormUID = "UidFrmMatrix") Then
If (pVal.Before_Action = False) Then
' Click on Add Row
If (pVal.ItemUID = "4") 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("Matrix1").Specific
f.DataSources.DBDataSources.Item(1).Clear()
oMatrix.AddRow(1)
End If
End If
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End SubYou should preferably use string IDs when accessing items in a collection - like a single DBDataSource in the DBDataSources collection!
I.e. use ...Item("UDT_FROM_SURESH") instead of ...Item(1).
Thus you can e.g. forget to remember whether the colection was 0-based (what they usually are) or not...
Another very basic suggestion:
Check the count before you try to access a member through its index; that will help you to avoid programming errors too.
Regards,
Frank
Maybe you are looking for
-
Keyboard/Trackpad/External Mouse Not Responding
I turned my computer on this morning to find the cursor stuck in the top left corner of the screen. I've tried resetting the PRAM, and the smc, and putting minor pressure on the ribbon under the battery all to no avail. It seems like this is a softwa
-
Updated software and drivers to use HP ScanJet 4300C with Windows 8.1
HP ScanJet 4300C scanner connected via USB to new HP 500-210qe desktop computer running Windows 8.1. Would like to update software, drivers, etc. for optimum performance. HP does not support this scanner for anything newer than Windows XP. Thank
-
Until I installed an Adobe update, my firefox worked fine, I have had to restore my computer and restart firefox due to advertising which was installed along with the update. Now each time I click on a webpage, a new tab opens and I can no longer vie
-
CANNOT Print with Adobe Acrobat 9
I am running Microsoft Vista with Adobe Acrobat 9 Standard. When trying to print to a printer I get an error message that I need to install/select a printer. I can print from any other application. Just now Adobe Acrobat 9 Standard. I installed the f
-
How do I keep the data on a line graph from overlapping?
The numeric data on points on the graph that are close is overlapping, so you see two numbers in the same place. We can't figure out how to fix this.