cancel
Showing results for 
Search instead for 
Did you mean: 

intialize form after FORM_LOAD is completed?

Former Member
0 Kudos

hi,

each time my form opens i want to display some values in my grid (initialize my form).

I'm using the FORM_LOAD-Event, but the items are not receivable at this moment.

Is there a workaround ? (for example: waiting until the formload is completed)

Case "FrmVmNDisc"

                Select Case pVal.EventType
                    Case SAPbouiCOM.BoEventTypes.et_FORM_LOAD
                        If pVal.Before_Action = False Then
                            oForm = moSboApplication.Forms.Item(FormUID)
                            initGrid(oForm)
                        End If
                End Select

thanks

Markus

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If is the form loaded from menu, use menu event and check

<et_MENU_CLICK> beforeaction = false

If you call the form as your form not from menu, but from button or code, create global variable as

dim x as integer

x = 0

Case "FrmVmNDisc"

Select Case pVal.EventType

Case SAPbouiCOM.BoEventTypes.et_FORM_ACTIVATE and x = 1

oForm = moSboApplication.Forms.Item(FormUID)

initGrid(oForm)

x = 0

end if

Case SAPbouiCOM.BoEventTypes.et_FORM_LOAD

If pVal.Before_Action = False Then

x = 1

End If

End Select

Former Member
0 Kudos

hi,

this doesn't work. I also have the same behaviour and error as before.

Case "FrmVmNDisc"
                'Natural Discount Dialog

                Select Case pVal.EventType

                    Case SAPbouiCOM.BoEventTypes.et_FORM_ACTIVATE
                        If pVal.Before_Action = False And gocNaturalDiscount.bActive Then
                            oForm = moSboApplication.Forms.Item(FormUID)
                            initGrid(oForm)
                            gocNaturalDiscount.bActive = False
                        End If

                    Case SAPbouiCOM.BoEventTypes.et_FORM_LOAD
                        If pVal.Before_Action = False Then
                            gocNaturalDiscount.bActive = True
                        End If
                End Select

Nussi
Active Contributor
0 Kudos

Hi Markus,

when it is a userform with UDO or a system FORM you use the FORM_DATA_LOAD event.

didn't try FORM_DATA_LOAD so far in a normal UserForm but maybe you do it

lg David

Former Member
0 Kudos

hi David,

its no udo form. With udo form i had no problems.

Now i create the form by code instead of using loadBatchTransactions.

It seems there is a special event missing for such things.

thanks

Markus

Nussi
Active Contributor
0 Kudos

Hi Markus,

German:

das wäre mein nächster Gedanke gewesen - probier das Form mit Code zu generieren

sicher - Du könntest es auch mit einem "Thread" probieren. den startest Du im FORM_LOAD

und sagst ihm er soll in 2 Sekunden das Feld füllen!

mehr kann ich nicht vorschlagen.

English:

i said he can try it with creating form by code or he can try "threading"

lg David

Answers (1)

Answers (1)

Former Member
0 Kudos

Markus,

If u r using a Menu Event (Menu CLick to load the form) then fill the data in the menu event after ur form is loaded.

Vasu Natari.