Welcome Notes

Welcome Viewers

09 March 2018

Get System Currency through SAP Business one SDK

Dear All,
   Today , We will see, How to Get System Currency through SDK


  Public Function GetSysCurrency() As String
        Dim vObj As SAPbobsCOM.SBObob = Nothing
        oApp = New ClsSAPConn
        Dim oRS As SAPbobsCOM.Recordset
        Dim strSysCurrency As String = String.Empty
        vObj = oApp.SAPCompany.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge)
        oRS = oApp.SAPCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
        Try
            oRS = vObj.GetSystemCurrency()
            strSysCurrency = oRS.Fields.Item(0).Value
        Catch ex As Exception
            strSysCurrency = String.Empty
        Finally
            If vObj IsNot Nothing Then
                vObj = Nothing
            End If
            System.Runtime.InteropServices.Marshal.ReleaseComObject(oRS)
            If oApp IsNot Nothing Then
                oApp = Nothing
            End If
        End Try
        Return strSysCurrency
    End Function