cancel
Showing results for 
Search instead for 
Did you mean: 

Filtering UDO

Former Member
0 Kudos

Hi Experts,

Is it possible to filter all records on UDO using sdk?.. How can I achieve it. Can you provide me a tutorial to do this I'm a new to SDK.

Thanks

Regards,

Phoenix

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I have a UDO on SAP. where you can add data.but the problem is my UDO shows all the record on my UDT I cannot filter what the UDO will show. I want to filter it by the current date only when I open the UDO on SAP. Is this possible?

Thanks

Regards,

Phoenix

edy_simon
Active Contributor
0 Kudos

Hi Phoenix,

Needs an addon for this.

I assume your UDO is a matrix style.

On the form load event (this will also depend on if you draw your own form/use the UDO form)

Get the DBDataSource of your UDT.

use the DBDataSourceObject.Query(BoQueryConditions) method to show your desired records.

Regards

Edy

Former Member
0 Kudos

Hi Sir,

I've followed what you said but it gives me an error like this.

Here's my error

Here's my Code

Select Case pVal.BeforeAction

                Case True

                    Select Case pVal.FormTypeEx

                        Case "PDC_INCOMING"

                            Select Case pVal.EventType

                                Case SAPbouiCOM.BoEventTypes.et_FORM_LOAD

                                    oForm = SBO_Application.Forms.Item(FormUID)

                                    Dim odbs As SAPbouiCOM.DBDataSource = oForm.DataSources.DBDataSources.Item("@DFSI_PDC_IN")

                                  

                                    'Set Condition for query

                                    Dim oConditions As SAPbouiCOM.Conditions

                                    Dim oCondition As SAPbouiCOM.Condition

                                    oConditions = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_Conditions)

                                    oCondition = oConditions.Add

                                    '// ((OINV.CardCode = 'OVPM.CardCode') Or

                                    oCondition.Alias = "U_Posted"

                                    oCondition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL

                                    oCondition.CondVal = "N"

                                    Try

                                        odbs.Query(oConditions)

                                    Catch ex As Exception

                                        SBO_Application.MessageBox(ex.Message)

                                    End Try

edy_simon
Active Contributor
0 Kudos

Hi Phoenix,

Have you tried on BeforeAction = False ?

Regards

Edy

Former Member
0 Kudos

Yes Sir I've already try that.

edy_simon
Active Contributor
0 Kudos

Hi Phoenix,

This method can not be applied to a system generated form.

Looks like you are using the SAP generated default UDO form.

If you draw your own form, this should work.

Sorry, I don't have solution for System Form.


Regards

Edy

Former Member
0 Kudos

Hi,

I'm not sure if it is what you need but you can use Recordset


Recordset oRs = (Recordset)COMPANY.GetBusinessObject(BoObjectTypes.BoRecordset);

            oRs.DoQuery("SELECT * FROM [YOURTABLE]");

former_member241304
Active Participant
0 Kudos

Hi Phoenix Langaman,

I'm not able to understand your requirement,What i understand i will tell you

The sap will take in order only no need lo filter the records.