cancel
Showing results for 
Search instead for 
Did you mean: 

Functionality of Find Mode with UserForm wich is not connected to an UDO

Former Member
0 Kudos

Hi all,

We have development a userform connect to a user table, but it isn't connected to a User Define Object.

So we need to have the same functionality of the system user form when it is in the find mode.

For example: You change the form to a Find mode and you put in the field an expression like this "marie", because you are looking for all records that has marie in the name. As you press Find, the SBO shows a list of all records that fits with the expression above "marie".

But it works only with system form and user form that is connected to a UDO.

I would like to know if it's possible to do with a user form without UDO?

I hope you can understand my problem.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

When loadinf the form you need:

- to activate all menu: FIND, DELETE, ADD, <<, <, >, >>;

- write code to catch menu events:


Private Sub SBO_Application_MenuEvent( _
            ByRef pVal As SAPbouiCOM.MenuEvent, _
            ByRef BubbleEvent As Boolean _
) Handles SBOApp.MenuEvent

  Select Case pVal.MenuUID
     Case "1282"     ' New
       If Not pVal.BeforeAction Then
         Dim oForm As SAPbouiCOM.Form
         oForm = SBOApp.Forms.ActiveForm
         If oForm.UniqueID = "PUT_HERE_oFormTypeEx" Then
           C_MyForm.ManageMenuEvent(pVal, BubbleEvent)
         End If
         oForm = Nothing
     End If
... other menu ... FIND, DELETE, ADD, <<, <, >, >>;
  End Case
End Sub

Private Sub EnableMenu(ByRef oForm As SAPbouiCOM.Form)
        Try
            oForm.Freeze(True)
            ' MENU UIDs
            'oForm.EnableMenu("1281", True)  ' Find 
            oForm.EnableMenu("1282", True)  ' Add
            oForm.EnableMenu("1283", True)  ' Delete
            oForm.EnableMenu("1290", True)  ' First
            oForm.EnableMenu("1289", True)  ' Next
            oForm.EnableMenu("1288", True)  ' Previous
            oForm.EnableMenu("1291", True)  ' Last
        Catch ex As Exception
        Finally
            oForm.Freeze(False)
            System.GC.Collect() 'Release the handle to the table
        End Try
End Sub

- Use SAPbobsCOM.UserTable methods to add, remove, update records.

Also look these threads

- [Thread: Update User Defined Table|https://forums.sdn.sap.com/thread.jspa?threadID=966638&tstart=0];

- [Thread: How to insert data in DB with DBDataSource ?|https://forums.sdn.sap.com/thread.jspa?threadID=170769&tstart=0];

...

- [develop the add-on with using of SAP toolbars buttons: FIND, ADD, <<, <, >, >>.|https://forums.sdn.sap.com/thread.jspa?threadID=1070101&tstart=0]

Hope to help

Regards

Sierdna S.

Edited by: Sierdna S on Oct 1, 2008 4:22 PM

Answers (0)