cancel
Showing results for 
Search instead for 
Did you mean: 

search result sorting criteria

Former Member
0 Kudos

Dear All ,

                  What is the default sorting criteria for display of search result. How can we sort display result based on our criteria  ?

Thanks,

Shubh.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member190756
Active Contributor
0 Kudos

Hello Shubh,

BADI /SAPTRX/BADI_EH_S

Methods:

AFTER_GET_DATA After getting event handler data BAPI /SAPTRX/BAPI_EH_GET_DATA

AFTER_GET_DATA_DISP After getting event handler data for display in the WD UI

AFTER_GET_DATA_EH_LIST For transaction /SAPTRX/EH_LIST

There you have all data as changing parameters and can sort them as you want.

Best regards,

Steffen

Former Member
0 Kudos

Hello Steffen,

                      Thanks for your reply. My requirement is to see first two hundred recrods with descending order of search criteria based on EH creation date.

                    With this approach I see a performance issue in the below case:

                     Suppose I search a record for 01.09.2014 to 06.09.2014. This has lets say fifty thousand records.  There are two case :

          1) I don't check a button "Return more than 200 hits". This will fetch me the record from 01.09.2014  for first 200. Hence in method

"AFTER_GET_DATA_DISP After getting event handler data for display in the WD UI"

               I will not get my needed records

          2) I check a button "Return more than 200 hits". This will fetch me 50000 records , and after that I will filter the same for display in web UI.  This is more of performance hit.

            There is even a third case where I don't give any search criteria such as EH creation date and in this case I think it will fetch the records from the date EH which was created in EM.

              Is there anyway I can avoid this and define a search criteria  in customizing ??

Thanks,

Shubh.

former_member190756
Active Contributor
0 Kudos

Hi Shubh,

with this requirement the only possibility is to create an own Retrieval Function module for your use case.

In transaction /n/saptrx/tsc0sqf you can can enter your own search function (replacing /SAPTRX/EH_RETRIEVE_GUIDS). Leaving USer field blank it will be used for all users.

But this will be very complex as /SAPTRX/EH_RETRIEVE_GUIDS contains a lot of logic with creating dynamic joins etc.

Best regards,

Steffen

Former Member
0 Kudos

Hi Shubh,

We have encountered the same issue in sorting function and it is badly impacting performance side.  Some users query takes 5 to 15 mins to retrieve the information to display, if they remove the flag "return more than 200 hits"

So, we have opted different option to avoid this sorting and filter issue in the search selection itself.

1. Have multiple configuration fields in Selection profile which user use for filter/sorting?

2. Enable those configuration fields as multiple input in selection profile?

3. Request user to enter multiple search criteria before hitting the enter button (instead of getting 50000 records it would end up lesser) for example: creation date, document status, carrier id etc, so that you can narrow down the search to give the right result and help the sorting.

Another issue in this: We get popup "Your choice of selection criteria might result in a long response time" but not that big performance issue we had encountered previously.

Check this solution whether it suits you to implement for your client.

You have to think twice on system performance side on own customizing before changing the SAP Standard function in this.

Regards

GGOPII

former_member190756
Active Contributor
0 Kudos

Hi Gopi,

"Your choice of selection criteria might result in a long response time"

You can get rid of this by setting user parameter /SAPTRX/NOPERFPOPUP.

Best regards,

Steffen

Former Member
0 Kudos

Thanks Steffen...

I will do that to rid of the popup.  How about the performance side?  Do we any performance improvement planned in the future release?

Regards

GGOPII

former_member190756
Active Contributor
0 Kudos

Hi Gopi,

a standard improvement for Shubhs use case to do the select descending on special field will be difficult as there could be several tables be involved and sometimes not only one select is sufficient especially when Control, Info Params or Status is involved.

For such special scenarios i only see the possibility as outlined above to copy and adjust the standard retrieval function module.

Another option that come into my mind are Filter Profiles and Authorization Profiles to restrict the number of EHs.

Best regards,

Steffen

Former Member
0 Kudos

Dear Steffen,

                       Also to add to your point ,

                       Wont't it be good if by default, search fetches records based on EH creation date in descending  order ?

                        Since I see , by default any customer would like to see latest records first .

Thanks,

Shubh.

former_member190756
Active Contributor
0 Kudos

Hello Shubh,

the select query is dynamically created based on your customizing. In a lot of cases it is not one single select but more selects as you not only query for one field.

In your special case it would make sense but it would be difficult to handle this in ageneric way.

But i will discuss it internally here if we could do something here.

Best regards,

Steffen

Former Member
0 Kudos

Hello Steffen ,                      

                   Thanks for your reply.  I just want to confirm if I go ahead with the sorting on this method

"AFTER_GET_DATA_DISP After getting event handler data for display in the WD "

                 Should the return more than 200 records always be true ? If yes, by default how can i set this as true ?    In the method,  AFTER_GET_DATA_DISP if I delete the remaining record will it be correct behavior.

  

              On the whole , how this method should be used ?

              I am using the default search parameter functionality for EM 9.0.

Thanks,

Shubh.

former_member190756
Active Contributor
0 Kudos

Yes,

for your use case you should set return more than 200 records always be true. That can only set in the UI.

In the method you can the sort out entries. You at least save the time for rendering in the UI for the sort out entries. You should test how this improves performance as the detail data is still selected.

I think a big improvement is only possible by replacing /SAPTRX/EH_RETRIEVE_GUIDS.

Best regards,

Steffen

Former Member
0 Kudos

Hi Steffen,

I just have one query on this.  If we set return more than 200 records "Set as default" always checked in SAP EM Web UI.  I could see, we couldn't set "Return more than 200 hits" for different tracking scenarios. It is only coming for first tracking scenario on url http://xxxxxxxxxx/sap/bc/webdynpro/saptrx/em_wda_ui?sap-language=EN 

How do we set default "Return more than 200 hits" for different tracking scenarios?

Again when switch to another tracking scenario it refresh and "Return more than 200 hits" is unchecked automatically.

Regards

GGOPII

former_member190756
Active Contributor
0 Kudos

Hi Gopi,

yes unfortunately the Saved Searches does not take the flag for "Return more than 200 hits" into account. You should open a ticket for this.

Best regards,

Steffen