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

Creating Search Help.

Former Member
0 Likes
665

Hi All,

I have created the elementay search help for field ZWELS of table LFB!. ZWELS fileds contains values C and CDF for multiple vendor numbers. In search help i have included only ZWELS field. I have attached this search help to selection screen element by using matchcode object. But when i press F4 , repetitive values are displaying.

I dont want to show the repeating values. I want to show only distinct values.

how to do it?

Please give solution for it.

Thanks and regards,

Rakesh

2 REPLIES 2
Read only

Former Member
0 Likes
539

Can you also supply company code and/or the partner number? Alternatively look at the F4IF_INT_TABLE_VALUE_REQUEST function module with which you can create the value list and allow the user to select via that module. There have been numerous postings on the use of that FM, so a search of the forum or of SDN should lead to code samples.

Read only

Former Member
0 Likes
539

add a search help exit as below along in the search help which you created. what i am doing here is i am deleting the duplicate records comparing the vendor number.

FUNCTION ZF4IF_SHLP_EXIT_LFB.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  TABLES
*"      SHLP_TAB TYPE  SHLP_DESCR_TAB_T
*"      RECORD_TAB STRUCTURE  SEAHLPRES
*"  CHANGING
*"     VALUE(SHLP) TYPE  SHLP_DESCR_T
*"     VALUE(CALLCONTROL) LIKE  DDSHF4CTRL STRUCTURE  DDSHF4CTRL
*"----------------------------------------------------------------------
DATA : record_tab1 type TABLE OF SEAHLPRES.
  IF CALLCONTROL-STEP = 'DISP'.
    LOOP AT record_tab.
      delete record_tab WHERE string+0(13) = record_tab-string+0(13). 
      append record_tab to record_tab1.
    ENDLOOP.
    sort record_tab1 by string ASCENDING.
    record_tab[] = record_tab1[].

  ENDIF.

ENDFUNCTION.

check the code a bit in the debug. adjust the 0(13) if needed for you... 13 because, in lfb1 lifnr field is till 13 characters (3 for mandt and 10 for lifnr)...