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

SEARCH HELP

Former Member
0 Likes
369

Hi all ,

I need help in creating a search help or f4 help.

I have a field in my first screen lets

name .I need to provide a search help for this field.

I have a created a search help using se11.

But the problem , the table which iam using has duplicates names

for item name

1 abc

2 abc because item and name are both primary keys

when i use my search help for name field in initial screen it shows

abc

abc

i.e it shows TWICE instead i need only once

LET ME KNOW IF ANYBODY HAS AN IDEA HOW THIS CN BE ACHEIVED

THANKS

HAVE A NICE WEEKEND

2 REPLIES 2
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
283

Instead of using a search help defined in the dictionary, you can code it directly in your program, and you can take care of the duplicates then.

Here is an example, notice here we are getting data from T001 and putting into IT001, this internal table is what will be shown in the search help. Of course there will be no duplicates here, but if there were, you can see that the DELETE ADJACENT DUPLICATES statement would take care of the that problem. You can use this same type of thing for your requirement.



report zrich_0001 .

tables: t001.

data: begin of it001 occurs 0,
      bukrs type t001-bukrs,
      butxt type t001-butxt,
      ort01 type t001-ort01,
      land1 type t001-land1,
      end of it001.

select-options s_bukrs for t001-bukrs.

initialization.

  select bukrs butxt ort01 land1 into table it001 from t001.

<b>  sort it001 ascending by bukrs.
  delete adjacent duplicates from it001 comparing bukrs.</b>

at selection-screen on value-request for s_bukrs-low.

  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
       exporting
            retfield    = 'BUKRS'
            dynprofield = 'S_BUKRS'
            dynpprog    = sy-cprog
            dynpnr      = sy-dynnr
            value_org   = 'S'
       tables
            value_tab   = it001.

start-of-selection.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
283

HI

One way is to delete duplicate entries comparing name

field via search help exit.

Kind Regards

Eswar