cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Menu on Right Click failes on sales oder form

kurt_huwiler
Participant
0 Kudos

Hi you all

I want to add for sales oder form on right click some menu items so the user can navigate to different user forms.

I catch the RightMouse Before action Event and I'm

adding menues for the menue groupe "Goto". When the sales order form is in Add Mode right after the form is launched then my menus are nicely added I can see them.

Changing the sales order form mode to OK, after a Find, and I go again for the right click then my added menu items are not there anymore. First I thougt SBO is overwriting the menue for some reason and I did again adding them. It did not work. It seems like SDK adds the menues but they will not be visible.

I tried all kind of work arounds to make it working but I failed.

Has anyone an idea what I do wrong ?

-


I use this code to add menues:

Private Sub XX_AddMenuToMenuGroup(ByVal sbo_mnusv As SAPbouiCOM.Menus, _

ByVal szvMenuKey As String, _

ByVal szvMenuCaption As String, _

ByVal sbo_emtv As SAPbouiCOM.BoMenuType)

Dim mcp_sbo As SAPbouiCOM.MenuCreationParams

Set mcp_sbo = sbo_ax.CreateObject(Type:=cot_MenuCreationParams)

szIconFileSpec = upx.IconPath & _

szxDELIMETER_CHAR & _

szCIM_POOL_BitMap

With mcp_sbo

.String = szvMenuCaption

.UniqueID = szvMenuKey

.Type = sbo_emtv

.Enabled = True

.Position = sbo_mnusv.Count

.Image = szIconFileSpec

End With

sbo_mnusv.AddEx CreationPackage:=mcp_sbo

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Kurt,

This sounds similar to something I had an issue with. The menu creation may be throwing an exception because it already sees the UID. The menus disapearing seems to be related to the FormMode Change.

Have you tried a "Try...Catch..End Try" Loop. If the creation fails, try again with a different UID. Such as adding a counter at the end for each attempt.

Hope this helps.

Paul

Answers (1)

Answers (1)

former_member185703
Active Contributor
0 Kudos

Hi Kurt,

Which PL are you on?

I remember that there was some issue like the one you indicate in "early" patches of 2005A...

Regards,

Frank