on 10-17-2007 8:04 AM
dear all,
i have created a form through screenpainter...i have saved the form in the xml format...i want to add these forms in the sap business one main menu list ,through .net..where can i find the menu item number... can u help me to find the solution for these problem...
hi shankar,
first u have to add ome menu item in sap b1 menu list(administrator,inventory,pruduction,human resource, etc) and after adding it, u have to catch the menu event and load the xml form.. i m sending code
menu id of sap b1 menu is 43520.
//////////////////code for adding menu/////////////////////////
oMenu = SBO_Application.Menus;
oMenuCreationPackage = (SAPbouiCOM.MenuCreationParams)SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams);
//oMenuCreationPackage1 = (SAPbouiCOM.MenuCreationParams)SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams);
oMenuItem = SBO_Application.Menus.Item("43520");
oMenu = oMenuItem.SubMenus;
string spath = null;
spath =Application.StartupPath;
spath = spath.Remove( spath.Length - 9, 9 );
//SBO_Application.MessageBox("hii" + spath,1,"ok","","");
//setting submenu values in the menu creation package
oMenuCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_POPUP;
oMenuCreationPackage.UniqueID = "mymenu";
oMenuCreationPackage.String = "my first menu";
oMenuCreationPackage.Enabled = true;
oMenuCreationPackage.Position = 12;
try
{
oMenu.AddEx(oMenuCreationPackage);
oMenuItem = SBO_Application.Menus.Item("main_menu");
oMenu = oMenuItem.SubMenus;
// Create s sub menu
oMenuCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING;
oMenuCreationPackage.UniqueID = "sub_menu_admin2";
oMenuCreationPackage.String = "Sub menu";
oMenuCreationPackage.Position=1;
oMenu.AddEx(oMenuCreationPackage);
}
catch (Exception ex)
{
//SBO_Application.MessageBox(ex.Message, 1, "Ok", "", "");
SBO_Application.SetStatusBarMessage(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Medium, true);
}
SBO_Application.MenuEvent += new SAPbouiCOM._IApplicationEvents_MenuEventEventHandler(SBO_Application_MenuEvent);
}
////////////////////// code for load form'x xml///////////////////////////////
private void SBO_Application_MenuEvent( ref SAPbouiCOM.MenuEvent pVal, out bool BubbleEvent )
{
string file;
file = ("per_udoForm.xml"); // ur xml file name
System.Xml.XmlDocument oXmlDoc = null;
oXmlDoc = new System.Xml.XmlDocument();
// load the content of the XML File
string sPath = null;
// sPath = Environment.CurrentDirectory;
sPath = System.IO.Directory.GetParent(Application.StartupPath).ToString();
sPath = System.IO.Directory.GetParent(sPath).ToString();
oXmlDoc.Load(sPath + "
" + FileName);
// load the form to the SBO application in one batch
string sXML = oXmlDoc.InnerXml;
SBO_Application.LoadBatchActions(ref sXML);
u can get more information from sample - creatingmenu and working with xml.
hape it will guide u.
if satisfied, rewards me some points
regards
nirdesh panwar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for your suggession and replies...
regards,
shankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Shankar,
U write in xml it is better and call in the Sub Main()
<?xml version="1.0" encoding="utf-8" ?>
<Application>
<Menus>
<action type="add">
<Menu String="Purchase Indent" Enabled="1" Position="0" Checked="0" FatherUID="2304" Type="1" UniqueID="PI" />
<Menu String="Request for Quotation" Enabled="1" Position="1" Checked="0" FatherUID="2304" Type="1" UniqueID="RQF" />
<Menu String="Offer Received from Supplier" Enabled="1" Position="2" Checked="0" FatherUID="2304" Type="1" UniqueID="ORS" />
<Menu String="Compare Quotation" Enabled="1" Position="3" Checked="0" FatherUID="2304" Type="1" UniqueID="CQ" />
<Menu String="Delivery Schedule" Enabled="1" Position="5" Checked="0" FatherUID="2304" Type="1" UniqueID="DS" />
<Menu String="Purchase Order Amendment" Enabled="1" Position="6" Checked="0" FatherUID="2304" Type="1" UniqueID="OA" />
<Menu String="Import Purchase Order Confirmation" Enabled="1" Position="7" Checked="0" FatherUID="2304" Type="1" UniqueID="IPOC" />
</action>
</Menus>
</Application>
If it helps give me points,
Regards,
Anitha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi shankar..
Find the Menu ID where you have to add that SRF Form. and then gives that Menu id in UR code..
Suppose u want to add SRF into sales order then give '169' Menu UId and gives the position where you have to add this SRF..
thnks
deepak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.