Skip to Content

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

Update and combobox

Hi all!

I have a problem that i to reach impasse.There fore,Can you help me?

i am writting code for your's form ,This Form have one datagrid to display data.in datagrid ,I used 1 Combobox to select values for ***(nam,nu), Ok button ,cancel button and new button.

1:

I used code for ok button and update button but it only request command ok but not run update when i changes value of column name child ="nguyen van Huynh"

oItem = oForm.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)

oItem.Left = 700

oItem.Width = 65

oItem.Top = 330

oItem.Height = 19

oItem.AffectsFormMode = True

oBtn = oItem.Specific

oBtn.Caption = "&Ok"

Can you help me rewrite code for update button?

2:

I used 1 Combobox to select values for ***(nam,nu) in datagrid.i dont know to write code for combobox in this case.

Can you help me rewrite code for update button?

<a href="http://imageshack.us">[IMG]http://img522.imageshack.us/img522/363/huynhavr0.png[/IMG]</a>

Thank you !

Former Member
replied

Hello Huynh,

As I mentioned before, the simplest solution for your requirement is UDO, therefore you don't need to rewrite the code of update, people here rarely rewrite the update logic of the form, instead just reuse the default implemenation of update in B1. The only magic is databind in your form. You can use UDO Form Generator in B1DE to create the form for you. Form/DataBind has been done. Then the browse, update function has been done by B1.

Also think about the flexibility of design, what if the employee has more than 5 children.

1. Create your own UDT and UDO instead of UDFs in OHEM, thus you can use UDO, you don't need to do with Add, Update.

Example: your UDT can be like this

AMI_OHEM : U_EmpID (This field works a link to EmpID in OHEM, just forget the UDFs in OHEM)

AMI_HEM1: U_Child, U_DateOB, U_Sex (Child Table, a matrix of children, support as many as children, just set the valid values for U_Sex, then it will be generated as comobox in UDO form by UDO Form Generator, by the way the children grid view will be generated as matrix, not grid in the udo form generator.)

2. Use UDO Form Generater in B1DE to generate the form.

3. Open this UDO form when click the view children button in employee master data form.

This is the right way. Hope it is clear

Kind Regards

-Yatsea

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question