Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Advanced Search Help to filter Search Result

former_member185558
Active Participant
0 Kudos
1,661

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.

4 REPLIES 4
Read only

former_member1716
Active Contributor
1,070

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?

Read only

Sandra_Rossi
Active Contributor
1,070

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)).

Read only

former_member185558
Active Participant
0 Kudos
1,070

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.

Read only

0 Kudos
1,070

But did you define a search help exit for a specific reason?