cancel
Showing results for 
Search instead for 
Did you mean: 

Reg UDO Creation

Former Member
0 Kudos

Hi All,

When i create a UDO through code i am getting following error.

My code is below

-


ConnectToCompany()

'Dim oUserObjectMD As SAPbobsCOM.UserObjectsMD

oUserObjectMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)

oUserObjectMD.CanCancel = SAPbobsCOM.BoYesNoEnum.tYES

oUserObjectMD.CanClose = SAPbobsCOM.BoYesNoEnum.tYES

oUserObjectMD.CanCreateDefaultForm = SAPbobsCOM.BoYesNoEnum.tNO

oUserObjectMD.CanDelete = SAPbobsCOM.BoYesNoEnum.tYES

oUserObjectMD.CanFind = SAPbobsCOM.BoYesNoEnum.tYES

oUserObjectMD.CanLog = SAPbobsCOM.BoYesNoEnum.tNO

oUserObjectMD.CanYearTransfer = SAPbobsCOM.BoYesNoEnum.tNO

oUserObjectMD.Code = "PSSIT_PARAM"

oUserObjectMD.ManageSeries = SAPbobsCOM.BoYesNoEnum.tNO

oUserObjectMD.Name = "PSSIT_PARAM"

oUserObjectMD.ObjectType = SAPbobsCOM.BoUDOObjType.boud_MasterData

oUserObjectMD.TableName = "PSSIT_QCPARAMETER"

Try

<u><b> lRetcode = oUserObjectMD.Add()</b></u>

Catch ex As Exception

MessageBox.Show(ex.Message)

End Try

If lRetcode <> 0 Then

If lRetcode = -1 Then

Else

oCompany.GetLastError(lRetcode, sErrmsg)

MsgBox(sErrmsg)

End If

Else

'MsgBox("UDO: " & oUserObjectMD.Name & " was added successfully")

Label7.Text = "UDO: " & oUserObjectMD.Name & " for " & oUserObjectMD.TableName & " "

End If

oUserObjectMD = Nothing

Error occured in the "lRetcode = oUserObjectMD.Add()" line

Value of lRetcode is =-1200 , and error message is " -The data area passed to a system call is too small"

Please some body can help me on this to solve

Regards

Suresh R

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

oUserObjectMD.Code = "PSSIT_PARAM"

make this name 8 characters.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hey suresh the code seems perfect..check again whether the table is of master data type. Im sure you already done that.. also check whether the name etc provided fall between the ranges specified in OUDO.. n in OUTB check whether the entry for table PSSIT_QCPARAMETER has the name of the udo in the UsedInObj paramter. Hope im of sum help

Regards

Aris

Former Member
0 Kudos

Hi Aris

As u said , i have checked all, this error is for not only this table, i will occur randomly for other table also.. some time UDO for this table will create with out any error .. That's y iam so much of confusion

Regards

Suresh R

Former Member
0 Kudos

Suresh before creating this UDO are you creating sum other tables and field etc?? Im sure you coz of your other post:-) Well i have faced this same problem. What i did was add a delay in the execution then restart the execution again it helps sumtyms.. What i figure is when you try doing this in the frontend (ie thru B1) We get that pop up askin whether to continue with the changes etc?? I gues it has somethin to do with that..

Try addin the delay it may help

regards

Aris

Former Member
0 Kudos

hi Aristotle

Thanks for your answer , u mean that add some delay in my code after creating few tabel ? Dou have any idea how to set dealy in between code. Hope u can help on this

Suresh

Former Member
0 Kudos

System.Threading.Thread.Sleep(500) where 500 is milli secs

N in the previous i din c the single quote:-)

Hope this helps

regards

Aris