Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Object creation (default form) through the sdk..

       Hi.

    i have  one requirement ..

    normally while creating object master type default form setting is there ok.

    i would like to create the default form with sdk ..

    i am using below code for creating object and set it to the default form but

   i am able to create object but default form i am not able to create it ..

  what i had ddone.............

  can u plz do any changes in below code.............

   Dim ousermd As SAPbobsCOM.UserObjectsMD

                ousermd = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)

                ousermd.Code = "ONOn"

                ousermd.Name = "ONOn  Master"

                ousermd.ObjectType = SAPbobsCOM.BoUDOObjType.boud_MasterData

                ousermd.TableName = "TI_ONO"

                ousermd.CanFind = SAPbobsCOM.BoYesNoEnum.tYES

                ousermd.CanDelete = SAPbobsCOM.BoYesNoEnum.tYES

                ousermd.CanCancel = SAPbobsCOM.BoYesNoEnum.tYES

                ousermd.CanCreateDefaultForm = SAPbobsCOM.BoYesNoEnum.tYES

                ousermd.MenuItem = SAPbobsCOM.BoYesNoEnum.tYES

                ousermd.MenuCaption = "Dolor Master"

                ousermd.FatherMenuID = "11520"

                ousermd.Position = 11

                ousermd.MenuUID = "ONOn"

                ousermd.FindColumns.ColumnAlias = "Code"

                ousermd.FindColumns.ColumnDescription = "Color Code"

                ousermd.FindColumns.ColumnAlias = "Name"

                ousermd.FindColumns.ColumnDescription = "Dolor"

                return_value2 = ousermd.Add()

                If return_value2 <> 0 Then

                    ocompany.GetLastError(return_value2, SerrorMsg)

                    SBO_Application.StatusBar.SetText(SerrorMsg, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)

                Else

                End If

Tags:
Former Member
Former Member replied

Hi Srinivas,

You are not adding the find columns to the UDO object.

It should be like this.

ousermd.MenuUID = "ONOn"

ousermd.FindColumns.ColumnAlias = "Code"

ousermd.FindColumns.ColumnDescription = "Color Code"

ousermd.FindColumns.Add()

ousermd.FindColumns.ColumnAlias = "Name"

ousermd.FindColumns.ColumnDescription = "Dolor"

ousermd.FindColumns.Add()

Now to create the Default Form through Code, you have to add form columns to the UDO object like the below code.

ousermd.FormColumns.FormColumnAlias = "Code"

ousermd.FormColumns.FormColumnDescription = "Color Code"

ousermd.FormColumns.Add()

ousermd.FormColumns.FormColumnAlias = "Name"

ousermd.FormColumns.FormColumnDescription = "Dolor"

ousermd.FormColumns.Add()

Hope it is helpful.

Regards

Kartheek

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question