Welcome Notes

Welcome Viewers

30 December 2015

Get Remarks of Item Code using SAP Business one Studio Suite

Get Remarks of Item Code using SAP Business one Studio Suite


  Private Sub GetRemarksofItemcode()  
       Dim oRsOITM As SAPbobsCOM.Recordset = Nothing  
       Dim strQuery As String = String.Empty  
       Dim strItemCode As String = String.Empty  
       Dim oCell As SAPbouiCOM.Cell  
       Dim oEditText As SAPbouiCOM.EditText  
       Dim oCol As SAPbouiCOM.Column  
       oRsOITM = oApplication.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)  
       For index As Integer = 1 To Matrix0.VisualRowCount  
         oCol = Matrix0.Columns.Item("7")  
         oCell = oCol.Cells.Item(index)  
         oEditText = DirectCast(oCell.Specific, SAPbouiCOM.EditText)  
         'strItemCode = DirectCast(Matrix0.Columns.Item("7").Cells.Item(index).Specific, SAPbouiCOM.EditText).Value.Trim()  
         strItemCode = oEditText.String  
         strQuery = "Select ValidComm from OITM where Itemcode='" & strItemCode & "'"  
         oRsOITM.DoQuery(strQuery)  
         If oRsOITM.RecordCount > 0 Then  
           SetMatrixValues(Matrix0, "u_ea_Remarks", index, oRsOITM.Fields.Item("ValidComm").Value)  
         Else  
           SetMatrixValues(Matrix0, "u_ea_Remarks", index, String.Empty)  
         End If  
   
       Next  
     End Sub