cancel
Showing results for 
Search instead for 
Did you mean: 

SDK Sample Code

Former Member
0 Kudos

Hi,

I have tested a form from B1DE as given in elearning.

I have used VB.net and repeated all steps with this tool

and I can Find,Add, update data in my form without any problem

Now my question are

1) In VB.Net there are no components i.e. UI Interface

2) How can I add ChooseFromList to a specific field

Please Help

Best Regards,

Umer Nasim Mirza

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Umer,

This is the way to add a CFL :

1. Define your CFLs :

Here i create a CFL with conditions :

private void AddChooseFromList(SAPbouiCOM.Form myForm)

{

try

{

SAPbouiCOM.ChooseFromListCollection oCFLs;

SAPbouiCOM.Conditions oCons;

SAPbouiCOM.Condition oCon;

oCFLs = myForm.ChooseFromLists;

SAPbouiCOM.ChooseFromList oCFL;

SAPbouiCOM.ChooseFromListCreationParams oCFLCreationParams;

oCFLCreationParams = (SAPbouiCOM.ChooseFromListCreationParams)SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams);

oCFLCreationParams.MultiSelection = false;

oCFLCreationParams.ObjectType = "2";

oCFLCreationParams.UniqueID = "IFC_CFL";

oCFL = oCFLs.Add(oCFLCreationParams);

oCons = oCFL.GetConditions();

oCon = oCons.Add();

oCon.BracketOpenNum = 2;

oCon.Alias = "CardType";

oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;

oCon.CondVal = "S";

oCon.BracketCloseNum = 1;

oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_AND;

oCon = oCons.Add();

oCon.BracketOpenNum = 1;

oCon.Alias = "GroupCode";

oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;

oCon.CondVal = return_GroupNum("Auteur");

oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR;

oCon = oCons.Add();

oCon.Alias = "GroupCode";

oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;

oCon.CondVal = return_GroupNum("Editeur");

oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR;

oCon = oCons.Add();

oCon.Alias = "GroupCode";

oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL;

oCon.CondVal = return_GroupNum("Traducteur");

oCon.BracketCloseNum = 2;

oCFL.SetConditions(oCons);

}

catch (Exception ex)

{

//Catch Error

}

}

2. Affect your CFL to a specific field :

oEdit = (SAPbouiCOM.EditText)oForm.Items.Item("3").Specific;

oEdit.ChooseFromListUID = "IFC_CFL";

oEdit.ChooseFromListAlias = "CardCode";

Hope it's help you

Regards

Michael

Answers (1)

Answers (1)

Former Member
0 Kudos

1)1st u call the xml form in SAP B1.

2)then choose the edit text/ matrix column field.

3)goto collection tab in the property window.

4)select new ->enter the value inthe object type field.

5)then goto items tab -> choose the CFL in choosefromListUID.

I thing it working...