Welcome Notes

Welcome Viewers

30 December 2015

Convert Date From SAP

Convert Date From SAP


  Private Function ConvertDateFromSAP(ByVal strDate As String) As String  
       Return Mid(strDate, 5, 2) & "/" & Right(strDate, 2) & "/" & Left(strDate, 4)  
     End Function  

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  

Display Supplier Catelog Number in BOM Item Code

Display Supplier Catelog Number in BOM Item Code


 SELECT Distinct SuppCatNum FROM OITM  Where Itemcode= $[$3.1.0]  

Query for PO Draft

Query for PO Draft 
 IF @transaction_type In ( 'A' ,'U') AND @object_type = '112'  
 BEGIN  
 if exists(select * from ODRF t1 inner join DRF1 t2 on t1.DocEntry =t2.DocEntry where  
  t1.DoCENTRY =@list_of_cols_val_tab_del and t1.ObjType = 22 AND isnull(T2.Project,'') = '')  
 BEGIN  
 SELECT @Error = 5, @error_message = 'Project Code is missing !'  
 END  
 END