Welcome Notes

Welcome Viewers

29 December 2015

TDS Report Section Wise

TDS Report Section Wise
 SELECT T0.[DocNum], T0.[CardCode], T0.[CardName], T0.[DocDate],T0.[BaseAmnt], T0.[WTSum] as TDSAmount, T0.[DocTotal] FROM [dbo].[OPCH] T0 INNER JOIN PCH5 T1 ON T0.DocEntry = T1.AbsEntry   

Validate Project Code in Receipt From Production

Validate Project Code in Receipt From Production
 IF @transaction_type IN (N'A', N'U') AND (@Object_type = N'59')  
 BEGIN  
 Declare @entry int  
 declare @receveqty float  
 declare @receveqty1 float  
 set @entry= (select distinct BaseEntry from IGN1 where DocEntry=@list_of_cols_val_tab_del and BaseType=202)  
 if Exists  
 (SELECT T0.Project from IGN1 T0   
 where  
 T0.DocEntry = @entry)  
  BEGIN  
 SELECT @Error = 5, @error_message = 'Project Code is missing !'  
 END  
 END   

Query for PO

Query for PO



 IF @transaction_type In ( 'A' ,'U') AND @object_type = '22'  
 BEGIN  
  IF EXISTS( select c.DocEntry  
     from OPOR c INNER JOIN  POR1 d on c.DocEntry = d.docentry   
     where c.DocEntry = @list_of_cols_val_tab_del  
       and isnull(d.Project,'') = '')   
 BEGIN  
 SELECT @Error = 5, @error_message = 'Project Code is missing !'  
 END  
 END  

Get Text value from Matrix using SAP Business One Studio Suite

Code for Get Text value from Matrix using SAP Business One Studio Suite
  Private Function GetTextValue(ByVal Matrix As SAPbouiCOM.Matrix, ByVal ColId As String, ByVal row As Integer) As String  
       Return TryCast(Matrix.GetCellSpecific(ColId, row), SAPbouiCOM.EditText).Value  
     End Function  

Add Folder in System Form using SAP business one Studio Suite

 Today , we will see how to add Folder in System Form Using SAP Business one Studio Suite

  Call System Form in VS 2010 .
   Go To System Form Code section.

Declare Control for Form :

  Private WithEvents oFolder As SAPbouiCOM.Folder  
  Private WithEvents oFolder1 As SAPbouiCOM.Folder  
Code for Multiple Folder:
  Private Sub AddMultipleFolders()  
       Try  
         Dim oItem As SAPbouiCOM.Item = Nothing  
         Dim oItemRef As SAPbouiCOM.Item = Nothing  
         oItemRef = Me.UIAPIRawForm.Items.Item("1320002137")  
         '' Earning Folder  
         oItem = Me.UIAPIRawForm.Items.Add("MyFld", BoFormItemTypes.it_FOLDER)  
         oItem.Top = oItemRef.Top  
         oItem.Height = oItemRef.Height  
         oItem.Left = oItemRef.Left + oItemRef.Width  
         oItem.Width = oItemRef.Width  
         oItem.Visible = True  
         oFolder = oItem.Specific  
         oFolder.Caption = "Earnings"  
         oFolder.GroupWith(oItemRef.UniqueID)  
         oFolder.Pane = 25  
         'Create a matrix on the folder   
         oItem = Me.UIAPIRawForm.Items.Add("MyMtx", BoFormItemTypes.it_MATRIX)  
         oItem.FromPane = 25  
         oItem.ToPane = 25  
         oItemRef = Me.UIAPIRawForm.Items.Item("45")  
         oItem.Top = oItemRef.Top - 50  
         oItem.Left = 10  
         oItem.Width = Me.UIAPIRawForm.Width - 200  
         oItem.Height = 200  
         '' Deduction Folders  
         oItemRef = Me.UIAPIRawForm.Items.Item("MyFld")  
         oItem = Me.UIAPIRawForm.Items.Add("MyFld1", BoFormItemTypes.it_FOLDER)  
         oItem.Top = oItemRef.Top  
         oItem.Height = oItemRef.Height  
         oItem.Left = oItemRef.Left + oItemRef.Width  
         oItem.Width = oItemRef.Width  
         oItem.Visible = True  
         oFolder1 = oItem.Specific  
         oFolder1.Caption = "Deductions"  
         oFolder1.Pane = 26  
         oFolder.Item.LinkTo = "1320002137"  
         oFolder1.GroupWith("MyFld")  
         AddHandler oFolder.ClickBefore, AddressOf Me.oFolder_ClickBefore  
         AddHandler oFolder1.ClickBefore, AddressOf Me.oFolder1_ClickBefore   
       Catch ex As Exception  
   
       End Try          
     End Sub  

Add Event:
  Private Sub Form_LoadAfter(pVal As SAPbouiCOM.SBOItemEventArg)  
       'Throw New System.NotImplementedException()  
       AddMultipleFolders()
   
     End Sub  
     Private Sub oFolder_ClickBefore(ByVal sboObject As Object, ByVal pVal As SBOItemEventArg, ByRef BubbleEvent As Boolean) Handles oFolder.ClickBefore  
       If pVal.ItemUID = "MyFld" Then  
         Me.UIAPIRawForm.PaneLevel = 25  
       End If  
     End Sub  
     Private Sub oFolder1_ClickBefore(ByVal sboObject As Object, ByVal pVal As SBOItemEventArg, ByRef BubbleEvent As Boolean) Handles oFolder1.ClickBefore  
       If pVal.ItemUID = "MyFld1" Then  
         Me.UIAPIRawForm.PaneLevel = 26  
   
       End If