cancel
Showing results for 
Search instead for 
Did you mean: 

Error when adding row in UDO of type Master Data using DIAPI

Former Member
0 Kudos

Hello,

When we try to add new rows to a user defined object of type master data using the DIAPI we always get the error: -4002 To generate this document, first define the numbering series in the Administration module. A UDO of type master data has no numbering series?

The code for adding the row is UDO of type master data is:

               oUserTable = oCompany.UserTables.Item( "PMX_TEMP_MD" );
                oUserTable.Code = "123";
                oUserTable.Name = "sss";
                int retCode = oUserTable.Add(); //Error -4002

The code for registration of the UDO is:

               oUserObjectsMD.Code = "PMX_TEMP_MD";
                oUserObjectsMD.TableName = "PMX_TEMP_MD";
                oUserObjectsMD.CanCreateDefaultForm = SAPbobsCOM.BoYesNoEnum.tYES;
                oUserObjectsMD.ManageSeries = SAPbobsCOM.BoYesNoEnum.tNO;
                oUserObjectsMD.ObjectType = SAPbobsCOM.BoUDOObjType.boud_MasterData;
                int retCode = oUserObjectsMD.Add();

We are using SBO 2005A SP1 PL 31.

Is there maybe an other way for inserting new rows in a UDO of type master data using the DIAPI? Or is this a bug?

Thanks for the help.

Regards,

Jeffrey

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Does this mean that the function

oCompany.UserTables.Item( "PMX_TEMP_MD" )

can only be used on user defined table of type "no object"?

Regards,

Jeffrey

Former Member
0 Kudos

Is is not possible to do insert/updates/deletes in a UDO using DIAPI. It is not allowed to do SQL statements on a UDO table using DIAPI.

If you want to add data to an own table using DIAPI then you have to create the table using SQL and do SQL statements on this table.

Regards,

Jeffrey

Gianluigi
Product and Topic Expert
Product and Topic Expert
0 Kudos

I am wondering how you can get this error given the fact that DI API does not

give you support for UDOs - for the moment.