Skip to Content
0
Former Member
Jan 10, 2008 at 05:25 PM

Matrix-Column ist not filled even an exisiting running autoformatted search

19 Views

If pVal.EventType = SAPbouiCOM.BoEventTypes.et_LOST_FOCUS _

And (pVal.FormType = 139 Or pVal.FormType = 149 Or pVal.FormType = 140 Or pVal.FormType = 133) Then

Dim oForm As SAPbouiCOM.Form

Dim oMatrix As SAPbouiCOM.Matrix

Dim oCuno As SAPbouiCOM.Item

Dim oDate As SAPbouiCOM.Item

Dim u_itemcode As String = String.Empty

Dim u_customercode As String = String.Empty

Dim u_listnum As Integer = 0

Dim u_mta As String = String.Empty

Dim u_cubasis As Double = 0.0

Dim u_mge1 As Double = 0.0

Dim u_tagkurs As Double = 0.0

Dim u_mge2 As Double = 0.0

Dim u_currkurs As Double = 0.0

Dim u_preisant As Double = 0.0

Dim u_preisantsave As Double = 0.0

Dim u_preisantstr As String = String.Empty

Dim u_preisantstrsave As String = String.Empty

Dim u_currency As String = String.Empty

Dim u_piecepricestr As String = String.Empty

Dim u_pieceprice As Double = 0.0

Dim quantity As Double = 0.0

Dim datekurs As String = String.Empty

Dim u_day As String = String.Empty

Dim u_Month As String = String.Empty

Dim u_year As String = String.Empty

Dim u_diff As Double = 0.0

Dim i As Integer = 0

Dim linenumber As Integer = 0

Dim oRecordSet As SAPbobsCOM.Recordset

Dim oRecordSet1 As SAPbobsCOM.Recordset

Dim oRecordSet2 As SAPbobsCOM.Recordset

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

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

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

If pVal.ItemUID = "38" And pVal.ColUID = "11" Then

u_pieceprice = 0.0

oForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)

oMatrix = oForm.Items.Item("38").Specific

linenumber = oMatrix.VisualRowCount() - 1

oCuno = oForm.Items.Item("4")

u_customercode = oCuno.Specific.String

i = linenumber

u_itemcode = oMatrix.Columns.Item("1").Cells.Item(i).Specific.String

oDate = oForm.Items.Item("10")

datekurs = oDate.Specific.String

u_year = Mid(datekurs, 7, 4)

u_Month = Mid(datekurs, 4, 2)

u_day = Mid(datekurs, 1, 2)

datekurs = String.Empty

datekurs = u_year & "-" & u_Month & "-" & u_day

quantity = oMatrix.Columns.Item("11").Cells.Item(i).Specific.Value / 1000000

oRecordSet.DoQuery("Select U_CU_Mge, U_MTA From OITM Where ItemCode = '" & u_itemcode & "'")

u_mge1 = oRecordSet.Fields.Item("U_CU_Mge").Value

u_mta = oRecordSet.Fields.Item("U_MTA").Value

oMatrix.Columns.Item("U_CU_Mge1").Cells.Item(i).Specific.Value = u_mge1

u_mge2 = quantity / 1000.0 * u_mge1

oMatrix.Columns.Item("U_CU_Mge2").Cells.Item(i).Specific.Value = u_mge2

oRecordSet1.DoQuery("Select U_CU_Basis From OCRD Where CardCode = '" & u_customercode & "'")

u_cubasis = oRecordSet1.Fields.Item("U_CU_Basis").Value

oMatrix.Columns.Item("U_CU_Basis").Cells.Item(i).Specific.Value = u_cubasis

oRecordSet2.DoQuery("Select Top 1 U_Kurs From [@MTZTK] Where U_MTA = '" & u_mta & "' And U_Date < '" & datekurs & "' Order by U_Date desc")

u_tagkurs = oRecordSet2.Fields.Item("U_Kurs").Value

oMatrix.Columns.Item("U_CU_TagKurs").Cells.Item(i).Specific.Value = u_tagkurs

u_preisantstr = String.Empty

u_preisantstr = oMatrix.Columns.Item("U_CU_PreisAnt").Cells.Item(i).Specific.String

If u_preisantstr = String.Empty Then

u_diff = u_tagkurs - u_cubasis

u_preisant = (u_mge1 / 1000.0) * (u_diff / 100.0)

u_preisantstrsave = u_preisant.ToString

u_preisantstrsave = u_preisantstrsave.Replace(".", ",")

oMatrix.Columns.Item("U_CU_PreisAnt").Cells.Item(i).Specific.Value = u_preisantstrsave

u_piecepricestr = oMatrix.Columns.Item("14").Cells.Item(i).Specific.String

Dim PartPrice() As String = u_piecepricestr.Split(" ")

u_pieceprice = CDbl(PartPrice(0))

u_currency = PartPrice(1)

u_pieceprice = u_pieceprice + u_preisant

u_piecepricestr = String.Empty

u_piecepricestr = u_pieceprice.ToString & " " & u_currency

oMatrix.Columns.Item("14").Cells.Item(i).Specific.String = u_piecepricestr

End If

End If

-> Explanantion of my problem:

Normally the Column 14 (the field pieceprice) in a document-line is filled with this SDK-Coding in the lost_focus event after entered Column 11.

But if there is an existing running automated formatted search,

entered by the user in another Line-Column the Column 14 of the matrix is not filled then ???

Who knows the problem ??

Kind Regards,

Roland