cancel
Showing results for 
Search instead for 
Did you mean: 

Add New button in CFL for UDO

Former Member
0 Kudos

Dear Experts,

How to add a defined new button in CFL for UDO? Just like CFL for business partner where a new button to add new business partner.

Dim oCFLs As SAPbouiCOM.ChooseFromListCollection

Dim oCFL As SAPbouiCOM.ChooseFromList

Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams

Dim oCons As SAPbouiCOM.Conditions

Dim oCon As SAPbouiCOM.Condition

oCFLs = oForm.ChooseFromLists

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

oCFLCreationParams.MultiSelection = False

oCFLCreationParams.ObjectType = "UDO_PRJTYPE"

oCFLCreationParams.UniqueID = "CFL_ProjectType"

oCFL = oCFLs.Add(oCFLCreationParams)

Regards,

Cherine

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Shafi,

I have a text box which assign to a CFL which reference my UDO table. When my CFL form open I can't see the NEW button which normally use to new record in my UDO table. Just like the Business Partner CFL, whereby you can add new BP record within the CFL form when you click the NEW button.

Regards,

Cherine

Former Member
0 Kudos

You will have to develop it yourself, it is not provided as a standard function.

It is not easy, as it is difficult to control the CFL window; you always need to check what window it is referring to. But if you can handle it, you can add the New button to it and program your own logic.

Former Member
0 Kudos

Hi Cherine,

Try This....


'Adding CFL To the Matrix
 oform = sbo_application.Forms.Item("Frm_Emp")
                    Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
                    Dim oCons As SAPbouiCOM.Conditions
                    Dim oCon As SAPbouiCOM.Condition
                    oCFLs = oform.ChooseFromLists
                    Dim oCFL As SAPbouiCOM.ChooseFromList
                    Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
                    oCFLCreationParams = sbo_application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
                    'Adding 2 CFL, one for the button and one for the edit text.
                    oCFLCreationParams.MultiSelection = False
                    oCFLCreationParams.ObjectType = "2"
                    oCFLCreationParams.UniqueID = "cfl"
                    oCFL = oCFLs.Add(oCFLCreationParams)
                    ' Adding Conditions to CFL1
                    oCons = oCFL.GetConditions()
                    oCon = oCons.Add()
                    oCon.Alias = "CardType"
                    oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
                    oCon.CondVal = "C"
                    oCFL.SetConditions(oCons)
                    Dim omat As SAPbouiCOM.Matrix
                    Dim ocolumns As SAPbouiCOM.Columns
                    Dim ocolumn As SAPbouiCOM.Column
                    omat = oform.Items.Item("mat_emp").Specific
                    ocolumns = omat.Columns
                    ocolumn = ocolumns.Item("col_inst")
                    ocolumn.ChooseFromListUID = "cfl"

Thanks

Shafi