Hi Benjamin,
I think you need to add the line item = customizing.SubMenus.AddEx(mcp); after mcp.Checked=true; for the mt_STRING type menu. And then use the below code for mt_POPUP type menu as :
sub = customizing.SubMenus.Add(udo.Code, udo.MenuUID, BoMenuType.mt_POPUP, customizing.SubMenus.Count);
instead off
sub = customizing.SubMenus.Add(udo.MenuUID, udo.MenuUID, BoMenuType.mt_POPUP, customizing.SubMenus.Count);
Hope this helps.
Regards,
Nitin