Welcome Notes

Welcome Viewers

08 March 2018

Get Exchange Rate through SDK

Dear All,
   Today , We will see, How to Get Exchange Rate through SDK


  Public Sub SetExchangeRate(ByVal strSourceCurr As String, ByVal oDate As Date, ByVal dblValue As Double)
        Dim vObj As SAPbobsCOM.SBObob
        oApp = New ClsSAPConn
        vObj = oApp.SAPCompany.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge)
        Try
            vObj.SetCurrencyRate(strSourceCurr, oDate, dblValue, True)
        Catch ex As Exception

        Finally
            If vObj IsNot Nothing Then
                vObj = Nothing
            End If
        End Try

    End Sub

Split String Price in Matrix SAP B1

Dear All,
   Today , We will see, How to Split string Price in Matrix SAP B1



    Public Function SAPPriceSpliter(ByVal aForm As SAPbouiCOM.Form, ByVal aMatrixUid As Object, ByVal oColId As Object, ByVal oRowId As Object) As Double
        '**********************************************
        ' Declare Local Variable
        '**********************************************
        Dim oMatrix As SAPbouiCOM.Matrix = Nothing
        Dim dblPurPrice As Double = 0
        '**********************************************
        oMatrix = aForm.Items.Item(aMatrixUid).Specific
        Try
            Dim result As String = Regex.Replace(oMatrix.Columns.Item(oColId).Cells.Item(oRowId).Specific.Value, "[a-zA-Z\s]+", String.Empty)
            dblPurPrice = Convert.ToDouble(result)
        Catch ex As Exception
            dblPurPrice = 0
        Finally
            If oMatrix IsNot Nothing Then
                oMatrix = Nothing
            End If
        End Try
        Return dblPurPrice

    End Function

Split String with Separator

Dear All,
   Today , We will see, How to Split String with Separator


 Public Function SplitString(ByVal str As String, ByVal strSeparator As String) As String()
        Dim strRight As String = String.Empty
        Dim strEmpty As String = strSeparator.Trim
        Dim strSplit() As String = Convert.ToString(str).Split(strEmpty)
        Return strSplit
    End Function

Convert String To Double

Dear All,
   Today , We will see, How to Convert String To Double.



 Public Function ConvertStringToDouble(ByVal str As String) As Double()
        Dim strRight As String = String.Empty
        Dim strSplit() As String = Convert.ToString(str).Split(":")
        Dim strLeft As String = strSplit(0)
        If strSplit.Length = 1 Then
            strRight = "00"
        Else
            strRight = strSplit(1)
        End If
        Dim result(1) As Double
        result(0) = strLeft
        If strRight.Length = 2 Then
            If Not strRight.Contains("00") Then
                result(1) = "." & strRight
            End If
        Else
            result(1) = strRight.Remove(3, 2)
        End If
        Return result
    End Function

Convert Date String To Date through SDK

Dear All,
   Today , We will see, How to Convert Date String To Date through SDK



Public Function ConvertDateStringToDate(ByVal strDateValue As String) As DateTime
        Dim vObj As SAPbobsCOM.SBObob = Nothing
        Dim retDate As DateTime
   
        vObj = oApplication.SAPCompany.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge)
        Try
            retDate = Convert.ToDateTime(vObj.Format_StringToDate(strDateValue).Fields.Item(0).Value)
        Catch ex As Exception
            retDate = Nothing
        Finally
           If vObj IsNot Nothing Then
                vObj = Nothing
            End If
        End Try
        Return retDate
    End Function