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

Filtering the search help values

Former Member
0 Likes
10,815

Hi all

I need some help regarding search help that for a normal search help for a field we will get all the possible values for that but here i need to filter the field values based on the previous field entered value.

for example :

two fields are there

plant and work center,

for a normal search help work center may get 100 values from a defined table.

if we enter some value in plant field and then if we press search help for the work center field then the values of the work center should be filtered based on the above entered value.

Please help me in this issue..tell me whether it is possible or not

Thanks in advance.

siva.

Hi all

I need some help regarding search help that for a normal search help for a field we will get all the possible values for that but here i need to filter the field values based on the previous field entered value.

for example :

two fields are there

plant and work center,

for a normal search help work center may get 100 values from a defined table.

if we enter some value in plant field and then if we press search help for the work center field then the values of the work center should be filtered based on the above entered value.

Please help me in this issue..tell me whether it is possible or not

Thanks in advance.

siva.

5 REPLIES 5
Read only

Former Member
0 Likes
3,768

You can specify a FM in your search help to do the filtering. Did you look at FM F4IF_SHLP_EXIT_EXAMPLE? It gives you detailed descriptions on how to use a search help exit.

It also explains how to implement your scenario where you have to filter the selected data.

Read only

Former Member
0 Likes
3,768

Hi,

get the values of field1 into itab1.

get the corresponding values of field2 (wrt field1 entered) into itab2.

Use the FM available for F4 help by passing the itab2 as a parameter.

Be sure that the F4 help FM will be called only if the field1 is populated. Else it will give all the values.

thanks,

teja.

Read only

former_member189629
Active Contributor
0 Likes
3,768

IF not <plant field> is initial

1. Copy F4IF_SHLP_EXIT_EXAMPLE to Z, call it from your programpass the plant data to it

2. Use the changing parameters SHLP and CALLCONTROL of that FM

3. Append your plant values into shlp-selopt[] table () like shown below

data begin of s_hselopt occurs 0.

include structure ddshselopt.

data end of s_hselopt.

CASE callcontrol-step.

WHEN 'SELECT'.

LOOP AT <plant table>

s_hselopt-shlpname = <SHelp Name>

s_hselopt-shlpfield = <Field Name - Wrk Ctr>

s_hselopt-sign = <Constant ('I')>

s_hselopt-option = <Constant ('EQ')>

s_hselopt-low = <plant table-plant>

APPEND s_hselopt.

CLEAR s_hselopt.

ENDLOOP.

shlp-selopt[] = s_hselopt[].

ENDCASE.

Read only

anversha_s
Active Contributor
0 Likes
3,768

Hi,

U can use search help exit for this purpose.

1. Creat 1 view with ur conditions.

2. Use above view in ur Search help.

Pls chk below eg:

eg : tables -. pa0000 and pa0001

join cond -> pa0000-pernr = pa0001-pernr.

view fields

-


pernr

ename

stat2

endda

selection condition -> pa0000-stat2 EQ 3 AND pa0000-enddad EQ 99991231

SEARCH HELP

-


selection method -> above VIEW NAME

search help exit -> f4if_shlp_exit

dialog type -> D

Regards,

Anversha