cancel
Showing results for 
Search instead for 
Did you mean: 

SRM - Einkaufswagen Monitor - Operatoren aktivieren

BP23
Discoverer
0 Kudos
194

High All,

I'm looking for a way to change the filter options in the SRM shopping cart monitor. Does anyone know if you can influence it. More specifically, I would like to enable the operators for more fields.

BP23_0-1718715727333.png

 

I would be very happy about your help.

Best regards

View Entire Topic
daniel_marlen
Employee
Employee
0 Kudos

Hi BP23,

There isn't any configuration to add the operators to more fields. The reason why the operator is available for Purchasing Group is because there is a specific coding to add this criterion with range table support. 

The field is added differently here:

WebDynpro Component /SAPSRM/WDC_UI_SC_AMF_CA
V_AO_SC_SEARCH Search View For Shopping Cart

Method WDDOINIT
*Create a range table that consists of this new data element
lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'BBP_PROC_GROUP' ).


*Add a new field to the selection
lv_description = wd_assist->if_wd_component_assistance~get_text( key = '007' ).

wd_this->m_handler->add_selection_field(
i_id = 'BBP_PROC_GROUP'
i_value_help_type = if_wd_value_help_handler=>co_prefix_searchhelp
i_value_help_id = '/SAPSRM/H_PDO_MON_SC_PURCHGRP'
it_result = lt_range_table
i_no_intervals = abap_true
i_description = lv_description
i_tooltip = lv_description

).

Then, the range values are gathered in the same WDC and view:

Method ONACTIONON_SEARCHBUTTON
CALL METHOD wd_this->m_handler->get_range_table_of_sel_field
EXPORTING
i_id = 'BBP_PROC_GROUP'
RECEIVING
rt_range_table = wd_this->lt_pur_grp.

ASSIGN wd_this->lt_pur_grp->* TO <fs>.


wd_this->mo_mms_sc->/sapsrm/if_cll_mm_search~set_wd_search_context(
ion_wd_search = lon_fields ).
lon_fields->set_attribute(
EXPORTING
name = 'PURCHASE_GROUP1'
value = <fs> ).

Finally the values are provided to the search structures:

/SAPSRM/CL_CH_WD_MMS_SC Shopping Cart search Monitor mapper
/SAPSRM/IF_CLL_MMS_SC~SEARCH

IF ls_criteria_pdo-purchase_group1 IS NOT INITIAL.

lt_pur_grp[] = ls_criteria_pdo-purchase_group1[].

LOOP AT lt_pur_grp INTO ls_pur_grp.
IF ls_pur_grp-high IS INITIAL.
lv_pur_grp_low = ls_pur_grp-low+0(12).
ls_pur_grp-high = ls_pur_grp-low+13(117).
CLEAR ls_pur_grp-low.
ls_pur_grp-low = lv_pur_grp_low.
CLEAR lv_pur_grp_low.
CONDENSE: ls_pur_grp-low, ls_pur_grp-high.
MODIFY TABLE lt_pur_grp FROM ls_pur_grp.
ENDIF.
ENDLOOP.

ls_criteria_pdo-purchase_group1[] = lt_pur_grp[].

APPEND ls_pur_grp TO lt_pur_grp.
ls_criteria_pdo-purchase_group1 = lt_pur_grp.

"" move purchase group field from cll structure to pdo structure
MOVE ls_criteria_pdo-purchase_group1 TO ls_criteria_pdo-purchase_group1.

ENDIF.

In addition this is possible for field Purchasing Group, because this field is added as table type in the relevant data structures /SAPSRM/S_PDO_SC_SEARCH, /SAPSRM/S_CLL_WD_SC_SEARCH.

Therefore adding operator to other fields would require bigger development efforts, but even then it is not guaranteed that further search codes are prepared to handle the range tables and operators. I'm sorry I couldn't provide a more positive answer.

Best regards,
Daniel

BP23
Discoverer
0 Kudos
Thank you for the detailed information.