cancel
Showing results for 
Search instead for 
Did you mean: 

Update and combobox

Former Member
0 Kudos

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 sex(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 sex(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 !

Accepted Solutions (1)

Accepted Solutions (1)

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Huynh Nguyen ,

which form are you using?

form created through coding or SRF(screen painter)

SRF means define your OK button unique id as 1. cancel as 2 then check,

1.all of your columns are binded correctly to your UDT

2.check your UDO s..

if everything correct the form behave like normal SAP Form..

No need do change form mode manually..

Regards,

Ganesh k