📚 SAP Business One SDK Help

AddBankStatement Method
See Also  Example
pIBankStatement
Specifies the properties of the bank statement you want to add.

Description

Adds a bank statement row.

Syntax

Visual Basic
Public Function AddBankStatement( _
   ByVal pIBankStatement As BankStatement _
) As BankStatementParams

Parameters

pIBankStatement
Specifies the properties of the bank statement you want to add.

Remarks

The bank statement is added as a draft document.

Example

Add Bank Statement (Visual Basic)Copy Code
Sub AddBankStatement()

        Dim oBnkStSrv As SAPbobsCOM.BankStatementsService
        Dim oCmpSrv As SAPbobsCOM.CompanyService
        Dim oBankStatement As SAPbobsCOM.BankStatement
        Dim oBnkStRow As SAPbobsCOM.BankStatementRow
        Dim MultiPayment As SAPbobsCOM.MultiplePayment

        oCmpSrv = oCompany.GetCompanyService ' Assume oCompany is the DI company Object

        'Get Bank Statement Service
        oBnkStSrv = oCmpSrv.GetBusinessService(SAPbobsCOM.ServiceTypes.BankStatementsService)
        oBankStatement = oBnkStSrv.GetDataInterface(SAPbobsCOM.BankStatementsServiceDataInterfaces.bssBankStatement)
        oBankStatement.BankAccountKey = 1

        'Add Row to Bank Statement
        oBnkStRow = oBankStatement.BankStatementRows.Add()
        oBnkStRow.ExternalCode = "E1"

        'Add Payment to Bank Statement row
        MultiPayment = oBnkStRow.MultiplePayments.Add()
        MultiPayment.AmountFC = 20
        MultiPayment.IsDebit = SAPbobsCOM.BoYesNoEnum.tYES

        'Add Bank Statement
        oBnkStSrv.AddBankStatement(oBankStatement)

End Sub

See Also