cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a context menu to an existing form with XML file?

Former Member
0 Kudos

Hello,

Does anyone know how to add a context menu to an existing form (such as Sales Order, A/R invoice) with a XML file?

Is it possible to work? If yes, how to do it and what is the structure of the XML file?

Many thanks in advance.

Thanks & Regards,

Gordon

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Gordon,

Context in the sense whn u right click copy, paste option will appear u have to add one option rite???

Thn u cant write in xml else u can write in Menu event

For example,

Dim oForm As SAPbouiCOM.Form = app.Forms.ActiveForm

If oForm.UniqueID = "DS" Then

Dim MItem As SAPbouiCOM.MenuItem = app.Menus.Item("1280")

Dim Menu As SAPbouiCOM.Menus = MItem.SubMenus

If MItem.SubMenus.Exists("sub") = True Then

Menu.RemoveEx("sub")

End If

End If

Regards,

Anitha

Former Member
0 Kudos

Hi Anitha,

Thanks for your reply.

But the context menu means form menu, I would like to add an additional form menu (e.g My Menu) to a B1 stardand form (e.g Sales Order) with XML file. That means when I right-click on the Sales Order, the form menu will display "My Menu" and it will also appear under GoTo Menu.

I could do it with hard codes, however, when I open the second form of the Sales Order, I get exceptions on identical menu unique IDs. That is why I want to use XML file to add a form menu to avoid this exception, but I don't know the structure of the XML file. I have tried many times with different structures, but it didn't work.

Below is the definition of the XML file.

<?xml version="1.0" encoding="UTF-16" ?>

<Application>

<formmenu>

<action type="add">

<Menu Checked="0" Enabled="0" FatherUID="" Position="" String="My Menu" Type="1" UniqueID="MyMenu01" Image="" />

</action>

</formmenu>

</Application>

Thanks & Regards,

Gordon

Edited by: Gordon Kao on Jan 4, 2008 1:26 AM

Former Member
0 Kudos

Hello All,

Finally, I have found the solution for the structure of XML file to add an additional form menu on a B1 standard form.

Please kindly refer to the following definition if you need.

<?xml version="1.0" encoding="UTF-16"?>

<Application>

<forms>

<action type="update">

<form uid="">

<formmenu>

<menus>

<action type="add">

<Menu Checked="0" Enabled="1" FatherUID="" Position="" String="My Menu" Type="1" UniqueID="MyMenu01" Image="" />

</action>

</menus>

</formmenu>

</form>

</action>

</forms>

</Application>

Regards,

Gordon