cancel
Showing results for 
Search instead for 
Did you mean: 

Change Form Mode

Former Member
0 Kudos

Hi

I need to change A/R Invoice mode when it loading . i write the code below but still its in addmode

if ((pVal.FormType == 133) & (pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_LOAD) & (pVal.Before_Action == true))

{

SAPbouiCOM.Form oForm = null;

try

{

oForm = SBO_Application.Forms.Item(pVal.FormUID);

oForm.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE;

}

catch (Exception e)

{

SBO_Application.MessageBox(e.Message, 1, "Ok", "", "");

}

}

}

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI all

The system forms are deniding the change of the mode

You can do the following (in vb.net convert please)

IN MENUEVENTHANDLER -> click on the menu ! and after the event sent find mode the form using the DATA/FIND menu.


        If pVal.MenuUID = "2053" And pVal.BeforeAction = False Then
            sbo_application.ActivateMenuItem("1281")
        End If

If you click on the link arrow connecting to invoice and it must have to be also in find mode the solution is:


' // in itemeventhandler !

  Static ARINVOICEFROMMustHavetoFindMode As Boolean = False
        If pVal.FormTypeEx = "133" Then

            Select Case pVal.EventType
                Case BoEventTypes.et_FORM_LOAD
                    If pVal.BeforeAction = True Then Exit Sub
                    ARINVOICEFROMMustHavetoFindMode = True

                Case BoEventTypes.et_FORM_ACTIVATE

                    If ARINVOICEFROMMustHavetoFindMode Then
                        ARINVOICEFROMMustHavetoFindMode = False
                        sbo_application.ActivateMenuItem("1281")
                    End If
            End Select
        End If

We need a static / public variable to store the logical change. Otherwise you can open more the invoice one time ?!!!!

it is always in find mode independent orange arrow / linked button !

Regards

J.

Edited by: Janos Nagy on Jul 31, 2008 3:56 PM

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Bilal,

Did you add the form to the filter ?

oFilter = oFilters.Add(SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD);

oFilter.AddEx("133");

SBO_Application.SetFilter(oFilters);

Regards

Michael

Former Member
0 Kudos

can u send the sample code.