cancel
Showing results for 
Search instead for 
Did you mean: 

Suggest Values(Auto Fill) for code and description in WD ABAP

former_member491305
Active Contributor
0 Kudos
512

Greetings everyone,

I have one ABAP webdynpro application which has to provide the auto fill (Suggest Values) option for one of the field for Eg:Material No.The requirement is the user will have only one field where he/she should be able to search the material either by its name or material number in the same field.Please let me know how we can achieve this.As of now i am able to search by material number using suggest values using my own custom search help.But how can i include the material description also as search option for the material number field.Any help will be appreciated.

Material No:[____________] <- - - i should be able to search both by material number and description in suggest values(Autofill)

Thanks,

Vignesh

Accepted Solutions (0)

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

The suggest values functionality works with the DDic search help. It will only have one importing parameter into the search help. Therefore by default it would never work with a search across two different fields. The only possible solution I can think of is to build a search help and implement a search help exit. Form within the coding of the search help exit, you could perform two separate searches and merge the results.

former_member199125
Active Contributor
0 Kudos

Why dont u use OVS?

http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9502

But it doesn't provide autofill option.

How do you achieve autofill option by custom search help? i think autofill is when we type S, it will show all the values with s automatically, right?

Thanks and Regards

Srinivas

former_member491305
Active Contributor
0 Kudos

@Sansrini. Yes.You are right.When you type "S",it will show all the values starts with S'.We can achieve this by attaching a search help to a context attribute.

The autofill is required for my case because it will reduce time for the users to search.i need to include the description also as a search field in material number.

Thanks,

Vignesh

former_member199125
Active Contributor
0 Kudos

what version you are using...

In ECC6.0 autofill option was not availbel. i have to press F4 help directly..

Coming to your query, using OVS search help,but it doesn't provide auttofill option. check the link which i have given in previous post.

Regards

Srinivas

Former Member
0 Kudos

Hi vigneswar,

You can try using OVS.

In Phase 1 of the OVS you can provide a search input, for this you will have the search help

Using this search help you can find the materials starting with 'S', then again you will come back to

actual OVS search input and you can get both the material number as well as the description filled.

Check the following link : http://www.saptechnical.com/Tutorials/WebDynproABAP/OVS/page1.htm

former_member491305
Active Contributor
0 Kudos

FYI. Guys I am using ECC6.0 EHP 4 where suggest value(Auto Fill) option is available.Kindly answer to my query.OVS does not help for Autofill.Any help will be appreciated.

Thanks,

Vignesh

Former Member
0 Kudos

Hi,

Yes I agree with Thomas, Even if we can use search help exit we will still have one importing parameter

with both the fields merged. So its better you go for OVS help.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Hi,

>

> Yes I agree with Thomas, Even if we can use search help exit we will still have one importing parameter

> with both the fields merged. So its better you go for OVS help.

That wasn't what I was say at all. You only have one input field, so it is possible to acomplish this with a search help exit instead of OVS. The problem with switching to OVS is that it can't be combined with the SuggestValues feature as the poster requested.

Former Member
0 Kudos

Hi Thomas,

Iam sorry, I was totally mistaken. I was thinking that the poster needed to fill two input fields so i was

asking to use OVS. And now i got it . For a single input field he need both the suggest values.

former_member491305
Active Contributor
0 Kudos

Hi Thomas,

You are right. I have exactly thought the same way and i implemented the code as well in the search help exit which will give my own search result to the searching criteria with both number and description. I have able to achieve this for one application and now i am able to search with both number and description in the same field.But when i am trying to get the same functionality for another field ,it is showing a auto fill values but only for code and not for description of the code.I have mentioned below the code i have written in the search help exit and i am passing the list to the source tab and getting the search help result in record_tab.When i test this from normal SAP GUI using F4 functionality it works perfect.But when i try to use this search help via Autofill(Suggest values) in WD ABAP,it is not working the same way what i want.I mean it only searches with the code but not with the description in teh autofill.

Any help will be appreciated.

IF callcontrol-step = 'SELECT'.

DATA:lwa_selopt TYPE ddshselopt,

lit_selopt_rsfnr TYPE RANGE OF tn39t-rsfnr,

lwa_selopt_rsfnr LIKE LINE OF lit_selopt_rsfnr ,

lit_selopt_desc TYPE RANGE OF stnd_rsfna,"rsfna, "nkdi-stdtext,

lwa_selopt_desc LIKE LINE OF lit_selopt_desc,

lwa_tn39t TYPE tn39t,

lit_tn39t TYPE STANDARD TABLE OF tn39t,

lv_sel_val TYPE ddshselopt-low.

READ TABLE shlp-selopt INTO lwa_selopt WITH KEY shlpfield = 'RSFNR'."'DKEY'.

IF sy-subrc EQ 0.

MOVE-CORRESPONDING lwa_selopt TO lwa_selopt_rsfnr.

APPEND lwa_selopt_rsfnr TO lit_selopt_rsfnr.

lwa_selopt-option = 'CP'.

CONCATENATE '' lwa_selopt-low '' INTO lwa_selopt-low.

MOVE-CORRESPONDING lwa_selopt TO lwa_selopt_desc.

APPEND lwa_selopt_desc TO lit_selopt_desc.

CLEAR:lit_tn39t[],record_tab[].

SELECT * FROM tn39t INTO TABLE lit_tn39t

WHERE spras = sy-langu AND ( rsfnr IN lit_selopt_rsfnr

OR rsfsn IN lit_selopt_desc ).

CALL FUNCTION 'F4UT_RESULTS_MAP'

EXPORTING

source_structure = 'TN39T'

TABLES

shlp_tab = shlp_tab

record_tab = record_tab " <--- I am getting the result correctlyin record_Tab ..but it is not coming in the output/

source_tab = lit_tn39t

CHANGING

shlp = shlp

callcontrol = callcontrol

EXCEPTIONS

illegal_structure = 1

OTHERS = 2.

callcontrol-step = 'DISP'.

ENDIF.

EXIT. "Don't process STEP DISP additionally in this call.

ENDIF.

Thanks,

Vignesh

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

What happens when set a breakpoint and hit it during the SuggestValues event? I don't know of any reason the data would retrieve correctly when running the search help from the SAPGUI test but not from the SuggestValues.

former_member491305
Active Contributor
0 Kudos

When i put the break point,in my search help exit,i am able to see the records in RECORD_TAB internal table and i put a break point in the method HANDLE_SUGGEST of a class CL_WDR_VALUE_HELP_HANDLER and i could see the the values there in the VALUES internal table.But it is not coming in the autofill output.I am finding it difficult to understand why it is happening.Please let me know if i can raise a message to SAP.

Thanks,

Vignesh

Former Member
0 Kudos

Hi Vignesh,

Did you find the solution to this? I am also facing the same issue.

Thanks,

Pris.