Skip to Content

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

Edit and text and choose from list


I am trying to create a form that resemle to the purchase order form.

In the purchase order form when we select the card code from the choose from list

the system fill all the fileds like the name docnum .. with relevant information.

i tried to do that by using the vent et_evaluate of the edit text bind with the Card code in my form.

The problem is that when i clik on the choose from list button the event is lanched and then the value of the card code is "" so i can't crate my queries to get the infomation like suplier name and ..

does any body have an answer?

This my code:

switch (pVal.ItemUID)


case "3":





string NumFournisseur =

((EditText) _Form.Items.Item("3").Specific).Value;

ArrayList DFournisseur =

new DB.PurchaseRequest(_SboCompany).


EditText Textvar;

// remplir nom fournisseur et nom contact

Textvar = (EditText) _Form.Items.Item("2").Specific;

Textvar.String = DFournisseur[0].ToString();

Textvar = (EditText) _Form.Items.Item("4").Specific;

Textvar.String = DFournisseur[1].ToString();

// remplir les dates comptable , de livraiosn et du document

Textvar = (EditText) _Form.Items.Item("17").Specific;

Textvar.String = DateTime.Today.ToString();

Textvar = (EditText) _Form.Items.Item("19").Specific;

Textvar.String = DateTime.Today.ToString();

Textvar = (EditText) _Form.Items.Item("21").Specific;

Textvar.String = DateTime.Today.ToString();

// remplir devise partenaire et numéro document

((EditText) _Form.Items.Item("59").Specific).String =

new DB.PurchaseRequest(_SboCompany).GetCurrencyCode(


_Form.Items.Item("59").Visible = true;

_Form.Items.Item("59").Enabled = false;

((ComboBox) _Form.Items.Item("10").Specific).Select(




((EditText) _Form.Items.Item("11").Specific).String =

new DB.PurchaseRequest(_SboCompany).GetLastDocNum().


((EditText) _Form.Items.Item("12").Specific).String = "0";


catch (Exception e)










catch (Exception ex)







Former Member
Former Member replied

Hey Achref,

You can use the event and code like this:

string vendCode = string.Empty;
SAPbouiCOM.IChooseFromListEvent oCFLEvento = (SAPbouiCOM.IChooseFromListEvent) pVal;
string sCFL_ID = oCFLEvento.ChooseFromListUID;
SAPbouiCOM.ChooseFromList oCFL = oVendorSourcingForm.ChooseFromLists.Item(sCFL_ID);
SAPbouiCOM.DataTable oDataTable =  oCFLEvento.SelectedObjects;

if (oDataTable != null)
	//get selected value from datatable
	if (oDataTable.Rows.Count > 0)vendCode = oDataTable.GetValue(0, 0).ToString();

Also check out 17.ChooseFromList in the samples that you can download.

Hope that helps


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