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
1,013

HI guys,

how can i give search help for parameters to restrict the search help like the values starts only with (SARA)

is there any method for this?

Thanx

Basha

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
966

You would need to special code your own search help.

For example, say I wanted to only show the company codes in the US for the S_BUKRS select option help.



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.

<b>  select bukrs butxt ort01 land1 into table it001 from t001
                where land1 = 'US'.</b>

  sort it001 ascending by bukrs.
  delete adjacent duplicates from it001 comparing bukrs.

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

HI guys,

how can i give search help for parameters to restrict the search help like the values starts only with (SARA)

is there any method for this?

Thanx

Basha

9 REPLIES 9
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
967

You would need to special code your own search help.

For example, say I wanted to only show the company codes in the US for the S_BUKRS select option help.



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.

<b>  select bukrs butxt ort01 land1 into table it001 from t001
                where land1 = 'US'.</b>

  sort it001 ascending by bukrs.
  delete adjacent duplicates from it001 comparing bukrs.

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

0 Likes
966

HI Rich,

Ur reply given me some idea but how can i assign a search help directly as sara*

Enduser press f4 then it searches for sara* directly so no need of typing sara* by enduser.

Regards

Basha

Read only

0 Likes
966

If you had a custom search help, then try to give 'SARA*' in default column. (Have'nt tried as I don't have access to system now)

Or else worst way is to control in search help exit. Refer to this link <a href="http://help.sap.com/saphelp_47x200/helpdata/en/cf/21ee52446011d189700000e8322d00/frameset.htm">Search Help Exit</a>

Regds

Manohar

Read only

0 Likes
966

Can you please let us know which database field this is that you are using and the table for values?

All you need to do is put 'SARA*' in your WHERE clause of the SELECT statement. So where is the issue?

Read only

0 Likes
966

Hi,

I tried with SARA* in default column and i cant activate it cos of errors and also tried in where clause in select statement. it says no values found cos no values r there with sara* in database.

DATABASE: Table : TCG81

Field : SLSTID

Regards

Basha

Read only

0 Likes
966

Try with codes 'SARA*' (have'nt treid as I don't have access to system)

Regds

Manohar

Read only

0 Likes
966

Is your select statement something like this?


SELECT slstid INTO TABLE value_tab
              FROM tcg81
             WHERE slstid LIKE 'SARA%'.

Sorry, it should be '%' not '*'.

Message was edited by: Srinivas Adavi

Read only

0 Likes
966

If there are no values there that start with 'SARA' then why are you restricting the values to this non-existant pattern?

Read only

0 Likes
966

thanx srini got it...

sara% is the correct one.

thanx..

i mean it doesn't shown bcos it looks for directly sara* ..

anyway thanx guys..

Regards

Basha