Welcome Notes

Welcome Viewers

05 March 2018

Get Date Separator SAP B1

Dear All,
   Today , We will see, Get Date Separator SAP B1 through SDK.



  Friend Function GetDateSep() As String
        Dim oCompanyService As SAPbobsCOM.CompanyService = Nothing
        Dim oCompanyAdminInfo As AdminInfo = Nothing
        Dim strReturn As String = String.Empty
        'get company service
        oCompanyService = oApp.SAPCompany.GetCompanyService
        'get admin info
        oCompanyAdminInfo = oCompanyService.GetAdminInfo
        Try
            strReturn = oCompanyAdminInfo.DateSeparator
        Catch ex As Exception
            strReturn = String.Empty
        Finally
            If oCompanyService IsNot Nothing Then
                oCompanyService = Nothing
            End If
            If oCompanyAdminInfo IsNot Nothing Then
                oCompanyAdminInfo = Nothing
            End If
        End Try


        Return strReturn
    End Function

Display Define New and Display last value from UDT in SAP B1

Dear All,
   Today , We will see, How to Display Define New and Display last value from UDT through SDK.


Private Sub ComboBox0_ComboSelectAfter(ByVal sboObject As Object, ByVal pVal As SAPbouiCOM.SBOItemEventArg) Handles ComboBox0.ComboSelectAfter
            Try
                If Me.ComboBox0.Selected.Value = "-9" Then
                    SBO_Application.ActivateMenuItem("51202")
                Else
                    Me.ComboBox0.ExpandType = SAPbouiCOM.BoExpandType.et_ValueDescription
                End If
            Catch ex As Exception

            End Try
        End Sub
 Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent

            If pVal.FormTypeEx = "SetColorComboBox.Form1" Then
                Select Case pVal.EventType
                    Case SAPbouiCOM.BoEventTypes.et_FORM_ACTIVATE
                        If pVal.ActionSuccess And pVal.BeforeAction = False Then
                            objForm = SBO_Application.Forms.Item(pVal.FormUID)
                            If objForm IsNot Nothing Then
                                blnForm = False
                                If blnForm = False Then
                                    ComboBoxLoadValues(Me.ComboBox0, "SELECT Code,Name FROM ""@TESTDEFINENEW""  Order by Code")
                                    Me.ComboBox0.Item.DisplayDesc = True
                                End If
                            End If

                        End If
                End Select
            End If
        End Sub

        Private Sub SBO_Application_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.MenuEvent
            If pVal.BeforeAction And pVal.MenuUID = "51202" Then
                ComboBox0.ValidValues.Remove(ComboBox0.ValidValues.Count - 1, SAPbouiCOM.BoSearchKey.psk_Index)
                ComboBox0.Item.Description = String.Empty
                blnForm = True
            End If

        End Sub




Get UDT Menu Id from SAP B1

Dear All,
   Today , We will see, How to Get UDT Menu Id from SAP B1 through SDK.


'' It is Only No Object Table Type
SELECT convert(nvarchar(6), row_number() over (order by t0.tablename) + 51201),T0.TableName, T0.Descr, T0.TblNum+ 51201 as [Menu ID] FROM OUTB T0 WHERE T0.ObjectType = 0 order by t0.tablename

Get UDO Menu ID SAP B1 SDK

Dear All,
   Today , We will see, How to Get UDO Menu ID SAP B1 SDK.


select 51119 + row_number() over (order by tableid), tableid
from
(
select distinct 
tableID from cufd
where tableid like N'@%'
and tableid not in
(
select '@' + tablename from oudo
)
and tableid not in
(
select '@' + tablename from udo1
)
) t
order by tableID