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

change data element in search help

Former Member
0 Likes
1,232

Hi at all,

how can i change the data elemte of an parameter in the search help?

The selektion method of the search help is a view and the data element comes from the DB.

Maybe it is possible to change the length of the parameter in the result list? That would help, too!

Thanks in advance.

Regards

1 ACCEPTED SOLUTION
Read only

rodrigo_paisante3
Active Contributor
0 Likes
1,056

Hi,

try to create your own search help. You can use AT SELECTION-SCREEN ON VALUE-REQUEST event the FM F4IF_INT_TABLE_VALUE_REQUEST.

Regards,

Rodrigo

5 REPLIES 5
Read only

rodrigo_paisante3
Active Contributor
0 Likes
1,057

Hi,

try to create your own search help. You can use AT SELECTION-SCREEN ON VALUE-REQUEST event the FM F4IF_INT_TABLE_VALUE_REQUEST.

Regards,

Rodrigo

Read only

0 Likes
1,056

Hi Rodrigo,

can you please specify your answer! i already use my own search.

I also thought about implementing a search help exit, additonal to the view.

Is that the only way changing the parameter length?

Read only

0 Likes
1,056

Alexander,

see this code bellow:


REPORT  zsearch.

TYPES:
BEGIN OF ty_scustom,
  id   TYPE scustom-id,
  name(8) TYPE c,
END OF ty_scustom.

DATA: wa_scustom TYPE ty_scustom.


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
SELECT-OPTIONS s_name FOR wa_scustom-name NO INTERVALS OBLIGATORY.
SELECTION-SCREEN END   OF BLOCK b1.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_name-low.
  PERFORM f_select.



*&---------------------------------------------------------------------*
*&      Form  f_select
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM f_select.

  TYPES: BEGIN OF ty_data,
        name TYPE scustom-name,
        END OF ty_data.

  DATA: tl_data TYPE STANDARD TABLE OF ty_data,
        wl_data TYPE ty_data,
        tl_return TYPE STANDARD TABLE OF ddshretval,
        wl_return TYPE ddshretval.

  SELECT  name
    FROM scustom
    INTO  TABLE tl_data.

  CHECK sy-subrc = 0.

  SORT tl_data BY name.
  DELETE ADJACENT DUPLICATES FROM tl_data COMPARING name.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
*   DDIC_STRUCTURE         = ' '
      retfield               = 'NAME' 
     value_org              = 'S'
    TABLES
      value_tab              = tl_data
*   FIELD_TAB              =
     return_tab             = tl_return
  EXCEPTIONS
      parameter_error = 1
      no_values_found = 2.


  IF sy-subrc = 0.

    READ TABLE tl_return INDEX 1 INTO wl_return.
    CHECK sy-subrc = 0.

    s_name-low = wl_return-fieldval.

  ENDIF.


ENDFORM.                    "f_select

Is it helpful? In search help show full name, but in parameter, only 8 first chars. Is it what you want to do?

Regards,

Rodrigo

Read only

0 Likes
1,056

Hi Rodrigo.

My answer comes very late, i'm sory.

Its not really what i was looking for. Maybe the explanation of the problem was wrong.

However, i've solved it and your hint was helpful anyway.

Thanks

Read only

Former Member
0 Likes
1,056

i solved the problem with a search help exit. i've changed the length of the parameters in shlp. (shlp-fielddescr)