Supply Chain Management Blogs by SAP
Expand your SAP SCM knowledge and stay informed about supply chain management technology and solutions with blog posts by SAP. Follow and stay connected.
cancel
Showing results for 
Search instead for 
Did you mean: 
bernd_dittrich
Active Participant
0 Kudos
This post is relevant for those of you using the Transportation Management Quick Search. For those not knowing what I´m talking about, quit reading here and go here.

The search bar in the SAP Business Client restricts the lines that will be shown to a user to 25, if the search returns more hits the excessive one are removed, by a more or less random sequence (as a side node: If several searches are returning result list  it might even further shortened by NWBC).

In general we only call the queries in a way that at maximum 25 hits are returned. However there is a one case where the result list as returned by TM would be longer: Activated document flows. If the document flow is very long (many predecessor or sucessor document steps) or wide (e.g. dozends of freight units are assigned to a freight order ) we can easily end up with too many hits. This is specifically true if you activated the additional link to open the found document directly in the Transportaiton Cockpit and show this as an additional entry in the list.

For this case the list needs to be shortened. We tried to find general rules about the best way to shorten the hit list in this case, but this really depends on your usecase. Hence we decided to provide a method with some sample coding, you need to implement a post-exit for it and do the actual implementation.

This is introduced by note 2496110.

After implementing this note you will find the method SHORTEN_RESULT_LIST of class /SCMTMS/CL_QUICK_SEARCHPROVIDE. This is where you enhance.

In this method you can find some example coding, in there we are removing entries from the result list until we reach the maximum value, then we return. We start with external links, continue wuth TRQ-based entries etc.

This of course depends now on your use case, you might even make it depending on the actual found document, which can be found in the first table line.

 
**********************************************************************
* This method is called in case there are too many entries in teh result list, e.g. because of a long document flow or
* because of added navigation entries
* Example implementation below
**********************************************************************

** Example -> Remove the external ERP links first
* LOOP AT ct_result_list TRANSPORTING NO FIELDS WHERE logsys IS NOT INITIAL.
* DELETE ct_result_list.
* IF lines( ct_result_list ) LE mv_max_result_count.
* RETURN.
* ENDIF.
* ENDLOOP.
*
*
** Example -> Remove the TRQ-entries now
* LOOP AT ct_result_list TRANSPORTING NO FIELDS WHERE bo_key = /scmtms/if_trq_c=>sc_bo_key.
* DELETE ct_result_list.
* IF lines( ct_result_list ) LE mv_max_result_count.
* RETURN.
* ENDIF.
* ENDLOOP.
*
** Example -> Remove the cockpit links for Freight Unit
* LOOP AT ct_result_list TRANSPORTING NO FIELDS WHERE nav_url_tc = abap_true AND cat = /scmtms/if_tor_const=>sc_tor_cat_fu.
* DELETE ct_result_list.
* IF lines( ct_result_list ) LE mv_max_result_count.
* RETURN.
* ENDIF.
* ENDLOOP.
*
** Example -> Remove the links for Freight Unit
* LOOP AT ct_result_list TRANSPORTING NO FIELDS WHERE cat = /scmtms/if_tor_const=>sc_tor_cat_fu.
* DELETE ct_result_list.
* IF lines( ct_result_list ) LE mv_max_result_count.
* RETURN.
* ENDIF.
* ENDLOOP.
*
** Example -> Remove the cockpit links for Freight Order
* LOOP AT ct_result_list TRANSPORTING NO FIELDS WHERE nav_url_tc = abap_true AND cat = /scmtms/if_tor_const=>sc_tor_cat_for.
* DELETE ct_result_list.
* IF lines( ct_result_list ) LE mv_max_result_count.
* RETURN.
* ENDIF.
* ENDLOOP.

 

Hope this helps!