Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

child value is not updated?

Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent

Dim i As Integer

Dim sumdepth As Decimal = 0

Dim oForm As SAPbouiCOM.Form

Dim Matrix As SAPbouiCOM.Matrix

oForm = SBO_Application.Forms.Item(FormUID)

Select Case pVal.EventType

Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED

'//************************************************************

'// Check if the event was raised by one of the Folder items

'// and change the form's pane level

'//************************************************************

Case SAPbouiCOM.BoEventTypes.et_CLICK

If pVal.ItemUID = "1" And pVal.BeforeAction = True Then

If oForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE Or oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE Then

'If Validation() = False Then

If oForm.Items.Item("OrdrVal").Specific().Value = "" Then

BubbleEvent = False

'SBO_Application.MessageBox(" Please Enter The Order No ")

SBO_Application.StatusBar.SetText("Enter The Order No- 3029 Item Is Not Selectable ", SAPbouiCOM.BoMessageTime.bmt_Long, SAPbouiCOM.BoStatusBarMessageType.smt_Error)

oForm.Items.Item("OrdrVal").Click(SAPbouiCOM.BoCellClickType.ct_Regular)

Exit Sub

End If

If oForm.Items.Item("LocVal").Specific().Value = "" Then

BubbleEvent = False

' SBO_Application.MessageBox(" Please Enter The Location ")

SBO_Application.StatusBar.SetText("Enter The Location - 3029 Item Is Not Selectable ", SAPbouiCOM.BoMessageTime.bmt_Long, SAPbouiCOM.BoStatusBarMessageType.smt_Error)

oForm.Items.Item("LocVal").Click(SAPbouiCOM.BoCellClickType.ct_Regular)

Exit Sub

End If

If oForm.Items.Item("SupVal").Specific().Value = "" Then

BubbleEvent = False

' SBO_Application.MessageBox(" Please Enter The Location ")

SBO_Application.StatusBar.SetText("Enter The Supervisor - 3029 Item Is Not Selectable ", SAPbouiCOM.BoMessageTime.bmt_Long, SAPbouiCOM.BoStatusBarMessageType.smt_Error)

oForm.Items.Item("SupVal").Click(SAPbouiCOM.BoCellClickType.ct_Regular)

Exit Sub

End If

Matrix = oForm.Items.Item("Matrix1").Specific

If Matrix.Columns.Item("Depth").Cells.Item(1).Specific.Value = "" Then

BubbleEvent = False

' SBO_Application.MessageBox(" Please Enter The Location ")

SBO_Application.StatusBar.SetText("Enter The Depth - 3029 Item Is Not Selectable ", SAPbouiCOM.BoMessageTime.bmt_Long, SAPbouiCOM.BoStatusBarMessageType.smt_Error)

' oForm.Items.Item("Depth").Click(SAPbouiCOM.BoCellClickType.ct_Regular)

Exit Sub

End If

'Dim sSQL As String

'Dim logno As Integer

''sSQL = "SELECT COUNT(DocEntry)AS count FROM [@OOBR]"

'sSQL = "SELECT Max(DocEntry)AS count FROM [@OOBR]"

'oLineRec = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

'oLineRec.DoQuery(sSQL)

'logno = CInt(oLineRec.Fields.Item(0).Value) + 1

'oForm.Items.Item("LogVal").Specific().Value = logno

End If

End If

End Select

If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then

Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent

oCFLEvento = pVal

Dim sCFL_ID As String

sCFL_ID = oCFLEvento.ChooseFromListUID

Dim oCFL As SAPbouiCOM.ChooseFromList

oCFL = oForm.ChooseFromLists.Item(sCFL_ID)

'SBO_Application.MessageBox(oCFL)

If oCFLEvento.BeforeAction = False Then

Dim oDataTable As SAPbouiCOM.DataTable

oDataTable = oCFLEvento.SelectedObjects

ShowValue(pVal, oDataTable, oForm)

End If

End If

Matrix = oForm.Items.Item("Matrix1").Specific

If ((pVal.ItemUID = "Matrix1") And (pVal.Row = Matrix.RowCount) And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_KEY_DOWN)) Then

Matrix.AddRow(1, -1)

Matrix.Columns.Item("#").Cells.Item(Matrix.RowCount).Specific.Value = Matrix.RowCount

End If

If ((pVal.FormUID = "SM_OBRFM") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Or (pVal.EventType = SAPbouiCOM.BoEventTypes.et_KEY_DOWN)) Then

For i = 1 To Matrix.RowCount

sumdepth += Matrix.Columns.Item("Depth").Cells.Item(i).Specific.Value

oForm.Items.Item("DepthVal").Specific().value = sumdepth

Dim oDocRec As SAPbobsCOM.Recordset

Dim sSQL As String

If oDocRec.RecordCount > 0 Then

sSQL = ""

Dim UpdateRec As SAPbobsCOM.Recordset

UpdateRec = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

UpdateRec.DoQuery(sSQL)

End If

Next

End If

If (FormUID = "SM_OBRFM") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_UNLOAD) Then

Windows.Forms.Application.Exit()

End If

End Sub

Private Sub SalesOrdrCFL(ByVal oForm As SAPbouiCOM.Form)

Try

Dim oCFLs As SAPbouiCOM.ChooseFromListCollection

'Dim oCons As SAPbouiCOM.Conditions

'Dim oCon As SAPbouiCOM.Condition

oCFLs = oForm.ChooseFromLists

Dim oCFL As SAPbouiCOM.ChooseFromList

Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams

oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)

' Adding 2 CFL, one for the button and one for the edit text.

oCFLCreationParams.MultiSelection = False

oCFLCreationParams.ObjectType = "17"

oCFLCreationParams.UniqueID = "CFL1"

oCFL = oCFLs.Add(oCFLCreationParams)

oCFLCreationParams.UniqueID = "CFL2"

oCFL = oCFLs.Add(oCFLCreationParams)

Catch

MsgBox(Err.Description)

End Try

End Sub

error data already exist in child table

Not what you were looking for? View more on this topic or Ask a question