Hi Baber,
This has been a known issue for a few years now, unfortunately not all banks follows the Bank Account Identification. In some countries they have a format <BranchCode>-<BankAccountnumber> whereas some banks use only <BankAccountNumber>. In countries like Australia, the same account number is re-used under different BSB numbers or branches.
You can try the following solution, where you extend the SearchBankAccountTable method used by BAI2 import process. This solution is one workaround. Else you can try creating the BankACcountNumber including BSB like "012-2345887".
protected BankAccountTable searchBankAccountTable(
BankStatementNameText _bankName,
BankStmtISOAccountStatement _statement)
{
BankAccountTable searchedBankAccountTable;
BankStatementIdentificationText accountnumFromFile;
int accountnumSize;
BankAccount bankAccountnum;
searchedBankAccountTable = next searchBankAccountTable(_bankName,_statement);
// Get the Account identifier from the import file bsb + accountnumber
accountnumFromFile = _statement.AccountIdOtherId;
accountnumSize = strLen(accountnumFromFile);
// Get the bank account number without BSB number e.g 001-0023451
bankAccountnum = subStr(accountnumFromFile,7,accountnumSize);
if(bankAccountnum)
{
select crosscompany searchedBankAccountTable
where searchedBankAccountTable.AccountNum == bankAccountnum;
}
return searchedBankAccountTable;
}