2019 Sep 20 3:57 AM
Hello,
We have written custom Search help, which return whole table (3 columns), with advanced search criteria (3 fields).
We have requirement that on F4 results screen (where all table records are displayed) ,when user enters anything in Advanced search criteria, result table should be filtered accordingly. how to implement it?
following Is existing code
CALL FUNCTION 'F4UT_PARAMETER_RESULTS_PUT'
EXPORTING
parameter = gwa_fields-fieldname
* OFF_SOURCE = 0
* LEN_SOURCE = 0
* VALUE =
fieldname = gv_fname
TABLES
shlp_tab = shlp_tab
record_tab = record_tab
source_tab = gt_class
CHANGING
shlp = shlp
callcontrol = callcontrol
EXCEPTIONS
parameter_unknown = 1
OTHERS = 2.
ENDLOOP.
ENDLOOP.
* PERFORM STEP_SELECT TABLES RECORD_TAB SHLP_TAB
* CHANGING SHLP CALLCONTROL RC.
IF sy-subrc = 0.
callcontrol-step = 'DISP'.
ELSE.
callcontrol-step = 'EXIT'.
ENDIF.
EXIT. "Don't process STEP DISP additionally in this call.
ENDIF.
In above code , gt_class is table with full results.
When we put breakpoint , we are getting SHLB_TAB-SELOPT populated with whatever value user is entering in advanced search help. how to use that to further filter search result?
Thanks in advance.
2019 Sep 20 5:16 AM
Hello,
Kindly help us understand your requirement better:
1) What are all the fields that are displayed.
2) The value that is entered in Filter condition, corresponds to which field?
3) Can you CDS views with your version?
2019 Sep 20 10:46 AM
I agree with Satish, it's difficult to understand your exact scenario.
Why don't you just delete the lines from GT_CLASS?
Generally speaking, a search help usually doesn't need any coding at all because it's based on a table or view defined as "selection method". The other possibility is to define a search help exit to load the "possible values" via ABAP code. In your exit, you have to load the data during the step "SELECT" (parameter CALLCONTROL-STEP), and you have to take into account the selection criteria passed via SHLP_TAB-SELOPT, and you load the "possible values" usually via F4UT_RESULTS_MAP (F4UT_PARAMETER_RESULTS_PUT is to load extra column(s)).
2019 Sep 20 2:20 PM
Hi Sandra / Satish TYVM
Its hard to explain here but will try
there are five columns/fields in SAP table col1,col2,..col5,
col1 and col2 are keys
user populates col1,col2 manually and col3 field has search help which displays all values of col 3 , 4 and 5 , based on col 1 and col 2, (this is my gt_class).
now my search help has advanced search criteria with col3,col4 and col5.
so user will select either of these three fields and result should get updated accordingly.
2019 Sep 20 2:45 PM
But did you define a search help exit for a specific reason?