cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Search IView - how to display zero records in result set iview

Former Member
0 Kudos

Hi All,

I have developed Custom search IView using Webdynpro, i have used "getRecordsByIds" event.

i have used java apis to do search on table and i am passing record ids of main table to the event , result is getting displayed in Result set iview.

my problem is that if i do not find any matching records, i do not want to display any thing in Result set iview.

WDPortalEventing.fire("urn:com.sap.pct.mdm.appl.masteriviews","getRecordByIds","&id=R5"); ( i have hardcoded R5 as record id)

Could you please let me know what value i need to pass in "id" to show zero records in result set iview.

Thanks & Regards,

Veera.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Veera,

Try putting id as R0.

Cheers,

Arafat

Answers (2)

Answers (2)

nitin_mahajan2
Contributor
0 Kudos

I undertsant the question is marked as Answered, but as a proper design, if the new search result doesn't display any match, you should keep the older result in place and just display a message stating "0 matches found".

If it is a specific requirement to clean the search table, please ignore.

I am using a similar approach.

Regards,

Nitin

Former Member
0 Kudos

Hi Veera,

As per my experience, getRecordsById command returns first record if the given record id is not existing in the table.

You can try compairing the record id of the return record with your given recordId... and then clear the resultset if the both are not matching...

Regards,

- Shailesh.

Former Member
0 Kudos

Hi Shailesh,

Thank you for your reply...

I am raising event from Webdynpro(custom iview) and Result set(standard Iview) will listens the event and display the results,How to compare result from getRecordByIds event and record id which is passed to Event.

Could you please tell me how to implement this comarasion ? how to empty the result set ?

Thanks & Regards,

Veera.

Former Member
0 Kudos

Hi Arfat,

It works with R0.. Thank you for your help...

Thanks & Regards,

Veera.

Former Member
0 Kudos

Hi Arafat,

Is there any specific reason for using R0 as a record id?

-

Shailesh.

nitin_mahajan2
Contributor
0 Kudos

There is no record in MDM with id R0, so it will return 0 records in the result if an event is triggered with this record id.

~Nitin