将用户定义的字段移动到主窗体

时间:2015-07-10 09:03:35

标签: sapb1

是否可以将用户定义的字段(UDF)移动到某个位置的主窗体/窗口?如果是,有人可以提供一个例子吗?例如,我不知道如何从UDF窗口获取字段或如何获取UDF窗口的引用。

1 个答案:

答案 0 :(得分:0)

我没有找到移动UDF字段的方法,但我找到了克隆它的方法:

Form myForm = ...;//get Form

myForm.Freeze(true);//freeze form for the flickering problem

Item itemTmp = myForm.Items.Add("NewItemId", BoFormItemTypes.it_COMBO_BOX);

ComboBox comboItem = itemTmp.Specific;
comboItem.ExpandType = BoExpandType.et_DescriptionOnly;
itemTmp.DisplayDesc = true;//display the description of the selected value
comboItem.DataBind.SetBound(true, "OITM", "U_HGR_id");//OITM is the DB table for Items/Articles. U_HGR_id is the UDF field (also column name) that I want to clone to the main window

loadUdfValuesInCombo(comboItem);//a local function that loads the values in the newly created combobox

myForm.Freeze(false);//unfreeze form