Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

UI oForms Item Edit with search

Hi All,

I haven't found anything on search to a related Field....

I add a Field

oItem = oForm.Items.Add("LCardCode", SAPbouiCOM.BoFormItemTypes.it_EDIT);

oItem.Left = 10 + StatWidth;

oItem.Width = StatWidth;

oItem.Top = 40;

oItem.Height = StatHight;

oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));

oEdit.DataBind.SetBound(true, "@MyUserTable", "U_SCardCode");

then add a linked Button

oItem = oForm.Items.Add("CardCode", SAPbouiCOM.BoFormItemTypes.it_LINKED_BUTTON);

oLinkBtn = (SAPbouiCOM.LinkedButton)oForm.Items.Item("CardCode").Specific;

oLinkBtn.LinkedObject = SAPbouiCOM.BoLinkedObject.lf_BusinessPartner;

oItem.Left = StatWidth - 10;

oItem.Top = 40;

oItem.LinkTo = "LCardCode";

Like the CardCode Filed in BusinessPartner...

Any Ideas?

Best Regards

Oliver

Former Member
replied

Hi Oliver,

The correct way would be to write the value on the datasource and not on the item.

Get the DBDatasource from the form and write to the appropriate column:

DbDatasource myDatasource = oForm.Datasources.DBDatasource.Item("@MyUserTable");

myDatasource.SetValue("U_SCardCode", 0, val);

Note that this only works on user defined forms/datasources.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question