Skip to Content
Former Member
Oct 21, 2004 at 10:54 AM

adding user field to user table



My name is Sashka and I don't have a lot of experience in programming with SAP BO.

I receive an error -1120 (The Mete Data for this object cannot be updated, since it's ref count is bigger then 0) when I try to add a new field to "SV1" table.

Here is my code:

Set oTablesMD = g_oCompany.GetBusinessObject(oUserTables)

oTablesMD.TableName = "SV1"

oTablesMD.TableDescription = "Tabella statistica"

lResult = oTablesMD.Add

If lResult = 0 Then

Set UFld = g_oCompany.GetBusinessObject(oUserFields)

UFld.TableName = "SV1"

UFld.Name = "Field1"

UFld.Description = "My Field 1"

UFld.Type = db_Alpha

UFld.EditSize = 8

lResult = UFld.Add

If lResult <> 0 Then

g_oCompany.GetLastError lErrCode, sErrMsg

MsgBox "Failed to add UserField " & lErrCode & " " & sErrMsg


MsgBox "Operazione terminata con successo!", vbInformation, "Creazione tabella"

End If

End If

Thank you.