on 01-12-2006 5:05 AM
Hi,
I want to update the price field in the Sales Order matrix. This I want to do as soon as the user selects the Item from the choose window. I trapped the ItemEvent of the SAPSBOUIApplication. But after getting the control of the matrix I am unable to see or edit the value in it. Please guide me how to do it? More better it would be if any one can explain me with one sample on how to insert our own logic in the existing flow of any transaction and modify values as per our new logics.
Thanx in advance.
With Regards,
Ram.
Hi Ram Bilas Yadav
You want an example, an example you will get, try the following, it will work on a AR invoice, once you have selected a value in the choose from list for itemcode it will then assign a value in the price column.
If pVal.FormType = "133" Then 'And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED Then
If pVal.ColUID = 1 And pVal.EventType = SAPbouiCOM.BoEventTypes.et_LOST_FOCUS And pVal.BeforeAction = False Then
Try
Dim omatrix As SAPbouiCOM.Matrix
Dim oColumn As SAPbouiCOM.Column
Dim oColumns As SAPbouiCOM.Columns
omatrix = SBO_Application.Forms.Item(FormUID).Items.Item("38").Specific
oColumns = omatrix.Columns
Dim oEdit As SAPbouiCOM.EditText
oEdit = oColumns.Item("17").Cells.Item(pVal.Row).Specific
oEdit.Value = 12
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End If
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Louis,
Thank you so much for the code. I checked it, its working. Can this be done as soon as I have clicked the Choose button from the Choose window list. Because, currently since your code is using the lost_focus event it gets executed only after the user clicks on any other column.
With Regards,
Ram.
Hi
You most probably could, you would have to check for both the click on choose or the double click on the matrix. Could become tedious. id suggest doing it on lose focus because in my experience many users will type the code in sometimes especailly if it is something they frequently sell. So this way take care of both scenarios.
Hope this helps
I am getting the following error in VB.
Err Number = -3006
Err Description = 'Form - Invalid Form Item'
The following is the code I am using for trapping the sales order form (139)
Case et_LOST_FOCUS:
If pVal.ColUID = "1" And pVal.FormType = 139 Then
Set sMat = SBO_Application.Forms.Item(FormUID).Items.Item("38").Specific
Set sCol = sMat.Columns
Set sEdt = sCol.Item(16).Cells.Item(pVal.Row).Specific
sEdt.Value = 99
End If
-
What could be the reason? where am I going wrong ???? when I tried ur code for AR Invoice, its working fine, but when I am running the above for Sales order form its throwing error while the line sEdt.Value = 99 is being executed.
Regards,
Ram.
Ram,
Each form has a unique type
Sales Order is 139
But Invoice is 133
You have to check and apply the logic to each form you are interested in.
To check the form type go to View - Debug information in the SBO client... (the form type will be displayed in the status bar at the bottom of the screen)
User | Count |
---|---|
99 | |
9 | |
9 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.