Skip to Content
avatar image
Former Member

Add and Update using the same button c# UI API

Hi Experts, I would like to use the same button to add, update and search.

I already put hte unique id in 1.
sample code or references. Will appreciate your hel

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Nov 07, 2017 at 11:28 AM

    Hi Esteban,

    When you receive a click on button 1, you can check what mode your form are, and then perform your action.

                        SAPbouiCOM.Form oForm = SBO_Application.Forms.ActiveForm;
                        switch(oForm.Mode)
                        {
                            case SAPbouiCOM.BoFormMode.fm_ADD_MODE:
    
    
                                break;
                            case SAPbouiCOM.BoFormMode.fm_UPDATE_MODE:
    
    
                                break;
                            case SAPbouiCOM.BoFormMode.fm_FIND_MODE:
    
    
                                break;
                        }
    

    If you are using a UDO in your own user form, just add your UDO code on ObjectType property of your form, and SAP will handle this situations for you.

    Hope it helps.

    Kind Regards,

    Diego Lother

    Add comment
    10|10000 characters needed characters exceeded