Hi,
My company uses account segemntation.
I need to create a document where i need to pass the account code.
I guess, i cannot just pass the account code in this case. I have to pass the system code for that account name.
I am trying to retrieve the system code for the account no using the following method, but it cannot find the account code.
Can someone tell me what is wrong with my following code.
-
Dim x As New SAPbobsCOM.SBObob
Dim y As New SAPbobsCOM.Company
Dim z As New SAPbobsCOM.Recordset
y.UseTrusted = True
y.Server = "AAAAAA
y.CompanyDB = "SBCO_DB"
y.UserName = "manager"
y.Password = "manager"
y.Language = SAPbobsCOM.BoSuppLangs.ln_English
lRet = y.Connect()
If lRet <> 0 Then
msgbox "Failed to connect to database"
y.GetLastError lRet, sErrMsg
GoTo Err_
End If
Set x = y.GetBusinessObject(BoBridge)
Set z = x.GetObjectKeyBySingleValue(oChartOfAccounts, "FormatCode", frm.Items.Item("58").Specific.Value, bqc_Equal) 'Business partner form account tab
If z.EOF Then
MsgBox "Nothing found"
Else
MsgBox z.Fields(0).Value
End If
-
Message was edited by: Satish Dwevedi