cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with adding child table to the existing UDO

Former Member
0 Kudos

Hi Experts,

I trying to add child table to the existing UDO which is having two child tables already.

But I found that newly added child table replacing the existing child table as below.

And the new child table is not adding to the UDO.

Before adding :

Udo Name            : TRACKUDO

Main Table            : TRACK

Child Table 1         : TRACK1

Child Table 2         : TRACK2

After adding Child table 3 i'e TRACK 3 the udo is updating as follows

Udo Name            : TRACKUDO

Main Table            : TRACK

Child Table 1         : TRACK3

Child Table 2         : TRACK2

Code lines :

   Dim oUserObjectMD As SAPbobsCOM.UserObjectsMD = Nothing

   Dim ChildTables As Array

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

   If oUserObjectMD.GetByKey("TRACKUDO") = True Then

   oUserObjectMD.ChildTables.TableName = "TRACK3"

   oUserObjectMD.ChildTables.Add()

If oUserObjectMD.Update() <> 0 Then                            objApplication.StatusBar.SetText(objMain.objCompany.GetLastErrorDescription)

End If

   End If


I already refer the below link :

Issue With adding a New Child to Existing UDO | SCN



Kindly suggest.


Thanks in Advance

RAJ DEV

Accepted Solutions (1)

Accepted Solutions (1)

pedro_magueija
Active Contributor
0 Kudos

Hi Raj,

Perhaps you're overriding the existing child table.

Try to invert these:


  oUserObjectMD.ChildTables.TableName = "TRACK3"

  oUserObjectMD.ChildTables.Add()

to these:


  oUserObjectMD.ChildTables.Add()

  oUserObjectMD.ChildTables.TableName = "TRACK3"


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn
Follow @pedromagueija on Twitter

Former Member
0 Kudos

Hi Pedro Magueija,

  Thank you so much... It's working fine...........

Regards

Raj

Answers (0)