Skip to Content
0
Former Member
May 31, 2004 at 11:19 AM

generate_userfields

36 Views

i will generate a userfield with values

but the program does not running,

because i get a error - 5002 when i use

ValidValuesMD.

what is wrong on my source code?

best regards

ingo

Public Function generate_userfields()

Dim UFld As SAPbobsCOM.UserFieldsMD

Dim VVFld As SAPbobsCOM.ValidValuesMD

Dim RetVal As Long

Dim ErrCode As Long

Dim ErrMsg As String

Set UFld = vCompany.GetBusinessObject(oUserFields)

UFld.TableName = “OITM”

UFld.Name = "test"

UFld.Description = "test”

UFld.Type = db_Alpha

UFld.Size = 10

RetVal = UFld.Add

The result was 0 in the error routine

Set VVFld = UFld.ValidValues

VVFld.Description = "test"

VVFld.Value = 1

VVFld.Add

The result was –5002 in the error routine

End Function