Modifying the SAP main menu items
Emanuele Croci
Dear all,I found the public Helper() method in the Customize Extend Code.
If I insert my code here:
((SwissAddonFramework.UI.Components.Folder)mainForm.Items["3"]).Value = "Mod.";
for example, I can change the first form title, from "Modules" to "Mod."
Now, I'd like to change the text of some menu items of SAP main menu, too.
How could I also change the title of the first menu item "Administration"?
It's the element:
Form 169
Item 6
Pane 1
Column 7
Row 1
How can I access all the elements of a folder and change their settings (i.e. their titles)?
Which C# or VB commands should I use?
Please, can someone help me?
How can I invoke the Helper() method on the '169' OnLoad event?
Regards
Emanuele
Manuel Marhold
Dear Emanuele,you find the entries of the mainmenu in the menu "Modules" and can access them via the ID (show systeminformation).
the id of "modules" ist 43520 p.e.
Olaf Borke
Dear Manuel, dear Emanuelevery interesting function.
If I add this line in the public Helper(), I receive an error that mainForm is not known.
Do you have some lines from the extended code to compare it with my lines ?
Thanks for answer
Best
Olaf
Emanuele Croci
Dear Manuel,thak you for your answer...
I saw the ID in the System Information, but I don't understand how to change the text
i.e: 'Modules' --> 'Mod.'
i.e. I added this command lines in the Helper() method:
MenuItem mi = MenuItem.GetFromUID("43520");
mi.Value = "Mod.";
mi.Load();
but the text doesn't change...
Which commands should I change.
Regards
Emanuele
Manuel Marhold
Dear Emanuele,you cannot change the caption of the menuitem in the menu bar, but you can change the caption of the menuitems in the menuitem 43520.
example:
MenuItem mi = MenuItem.GetFromUID("2049"); 'salesquotation
mi.Value = "My Sales Quotation";
mi.Load();
Emanuele Croci
Dear Manuel,thank you for your support.
The change of the caption of the menuitems in the menuitem 43520 works.
Now... using the customize... is it possible to change the caption of the menuitems in the 'vertical' SAP main menu (the menu visualized on the top left-hand side)?
In the Helper() method in the Customize Extended Code, I added this commands:
Form mainForm = Form.GetFormFromType("169", 1);
((SwissAddonFramework.UI.Components.Folder)mainForm.Items["3"]).Value = "Mod.";
and the caption of the first folder in the menu changes.
But... what command line should I use to change the caption for example of the "Administration" menuitem?
Regards
Emanuele
Manuel Marhold
Dear Emanuele,MenuItem mi = MenuItem.GetFromUID("3328"); 'administration
mi.Value = "My Sales Quotation";
mi.Load();
maybe mi hase more properties to set, I don't know if .Value is the correct oen, but I think so.
Emanuele Croci
Dear Manuel,I'm sorry, but you shown me the commands to change the menuitems of the SAP mein menu in the top of the window.
I would like to change the caption of the menuitems in the SAP main menu WINDOW..... see attached image, please.
what command line should I use to change the caption for example of the "Amministrazione" menuitem?
Regards
Emanuele
Attachment
[url=http://www.coresystems.ch/wp-content/../wp-content/forum-image-uploads/emanuelecroci/Immagine1.JPG]Immagine1.JPG[/url]
Manuel Marhold
Dear Emanuele,SAP loads the MainMenu WINDOWS from the Menu "Modules" on the top.
You are not able to change the caption of the Entries in the Form 169 by using the items in the form, you must change the caption of the mneu items in menu "Modules"
after you changed it, do a refresh of the main manu.
Please take a look at the SAP SDK-Help, the you can find how to handle the SAP menu.
short: Freeze the mainmenu to prevent blinking, change the captions, unfreeze and refresh
Emanuele Croci
Thank you Manuel for your support.Regards
Emanuele
0
Please sign in to leave a comment.
Comments
0 comments