cancel
Showing results for 
Search instead for 
Did you mean: 

Browseby function help needed

Former Member
0 Kudos

Hi,

I have a question on the data navigation using the browseby function. From what i know, you have to link it to a column in a table and it will auto navigate all the items there. Just say if i want to browse by a particular sales employee, how would i use the browseby function? For example i have 2 sales employee, and i want that sales employee to only navigate records created by him/her how would i do it?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Melvin,

I think in that case it won't be a browse by function, but rather a condition on your dbdatasource. The browse function is looking for something, like a primary index or unique key to browse the records by. Look at the condition example in the help file, it is fairly comprehensive.

Hope it helps,

Adele

Former Member
0 Kudos

hey i tried using this code, but there seems to be an error in it.... can anyone troubleshoot this for me?

Also is there a way to search from multiple tables instead of only one table?

oForm = SBO_Application.Forms.ActiveForm

                oCondition = oConditions.Add
                oCondition.BracketOpenNum = 1
                oCondition.Alias = "DocStatus"
                oCondition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
                oCondition.CondVal = "C"
                oCondition.BracketCloseNum = 1

                oForm.DataSources.DBDataSources.Item("ORDR").Query(oconditions)
                oForm.DataBrowser.BrowseBy = "8"

Former Member
0 Kudos

What error do u get? Can you give a little more detail and someone maybe able to debug the problem.

Former Member
0 Kudos

When i debug the program, it just stalled at this particular line

oForm.DataSources.DBDataSources.Item("ORDR").Query(oconditions)

my this code is used in the menuevent where the navigation button is pressed

Answers (1)

Answers (1)

Former Member
0 Kudos

This is my exact code


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

        If SBO_Application.Forms.ActiveForm.UniqueID.ToString = "QPT_SITfrmR" Or SBO_Application.Forms.ActiveForm.UniqueID.ToString = "QPT_Sitfrm" Then
            If pVal.MenuUID = "1288" And pVal.BeforeAction = False Then

                Dim oDBDataSource As SAPbouiCOM.DBDataSource
                Dim oConditions As SAPbouiCOM.Conditions
                Dim oCondition As SAPbouiCOM.Condition

                oConditions = New SAPbouiCOM.Conditions
                oCondition = oConditions.Add


                oForm = SBO_Application.Forms.ActiveForm

                oCondition.BracketOpenNum = 1
                oCondition.Alias = "U_Branch"
                oCondition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
                oCondition.CondVal = "Branch1"
                oCondition.BracketCloseNum = 1

                'oDBDataSource.Query(oConditions)
                oForm.DataSources.DBDataSources.Item("@OSIT").Query(oConditions)

                oForm.DataBrowser.BrowseBy = "28"


            End If
End Sub

OSIT is a custom UDO

I am trying to navigate the record where the branch = branch1 but it seems that it wont navigate past the first record

The browseby itemuid is pointing at the branch edittext field. Should i point it at the docnum field? What is the prupose of the browseby when there is a condition.

Thanks

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

The conditions are only for the first record shown in your form, after that if you use the arrow buttons you lost the conditions you set before.

You need to change the conditions everytime the user clicks on an arrow, otherwise you will have allways the same item (the first one of your conditions result)

Regards

Trinidad.