on 10-08-2009 10:12 AM
Hello, i fill my matrix with a DBDatasource object.
How can i only get the top 10 results of my object? is this anyhow possible?
Best regards,
Philipp
Hello
Basically the DBDataSource.Query using Conditions object which has to top x selection criteria,
but,
Try the following
Try
Dim oForm As SAPbouiCOM.Form = sbo_application.Forms.Add("XXXXX")
oForm.Visible = True
Dim dbDs As SAPbouiCOM.DBDataSource = oForm.DataSources.DBDataSources.Add("OITM")
Dim oConds As SAPbouiCOM.Conditions
Dim oCond As SAPbouiCOM.Condition
Dim oRs As SAPbobsCOM.Recordset = oCompany.GetBusinessObject(BoObjectTypes.BoRecordset)
oRs.DoQuery("select top 5 itemcode from OITM")
oConds = sbo_application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_Conditions)
For Row As Integer = 1 To oRs.RecordCount
oCond = oConds.Add
oCond.Alias = "ItemCode"
oCond.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCond.CondVal = oRs.Fields.Item(0).Value
If Row < oRs.RecordCount Then
oCond.Relationship = BoConditionRelationship.cr_OR
End If
oRs.MoveNext()
Next
dbDs.Query(oConds)
Catch ex As Exception
End Try
Regards,
J.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.