cancel
Showing results for 
Search instead for 
Did you mean: 

Search help that populates two fields on a WEB dynpro page

Former Member
0 Kudos

Hi there,

I have created a search help based on a single table ( QPCD ) with two exporting parameters CODEGRUPPE and CODE. When the user selects a their desired entry i would like it to poulate the relevant two fields on the web dynpro screen. I know in a normal dialog screen you could get this to happen automatically, but when implementing it into a web dynpro from abap screen it only returns the first value into the field that the search help was called from. Anyone know how i could get both fields populated?

Thanks in advance

Regards

Mart

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mart,

This can be done without freely programming also if

-> CodeGruppe and Code fields exists in a DDIC structure

-> if exists Strucutre can be changed

In that case, this can be done using field assignment for Search help.

Select the CODEGRUPPE attribute in the structure

goto ENTRYPHELP/CHECK tab

Click on SEARCHHELP button that exists in the tool bar of the table.

Mention the Search help name in the pop up.

Click on PROPOSE which automatically proposes the assignments.

If those assignements are wrong, do it manually. i.e, for CODEGRUPP export parameter select the codegrupp in the structure and for CODE export parameter of search help give CODE attribute of the structure.

In the webdynpro, for the CODEGRUPP and CODE attributes, selecte the search help type as AUTOMATIC.

In this way, corresponding fields will be populated without any coding or without creation of freely programmable search help.

Hope I understood you problem correctly.

Thanks,

Prashanth

Former Member
0 Kudos

Doh! oh yeah you have to assign the search help to the actual table dont you, thought it was strange why it did not just work:-). Thanks very much Prashanth that has worked a treat. Could not assign it directly to the table as it was a SAP standard but have created my own Z version, assigned the search help to it and then used that in my web dynpro.

Thanks again

Mart

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

have you tried the OVS search help?

It seems easier to have that solution (only one table, name description..)

<a href="http://help.sap.com/saphelp_nw04s/helpdata/en/30/d7fa41c915da6fe10000000a1550b0/frameset.htm">documentation</a>

grtz,

Koen

Former Member
0 Kudos

Thanks also for your responce Koen, i will look into implementing one of these as well!

Mart

Former Member
0 Kudos

Hi Mart.

You can achieve this using freely programmed input help.

Cheers,

Sascha

Former Member
0 Kudos

Hi Sascha,

Are they easy to create? Dont suppose you know of any examples demonstrating how to create a freely programmed input help do you?

Regards

Mart

Former Member
0 Kudos

check http://help.sap.com/saphelp_nw04s/helpdata/en/5d/395e4254139041e10000000a1550b0/frameset.htm

It is not that hard.

Create a new webdynpro component and implement IWD_VALUE_HELP in this component.

go to the component controller of you new component and add a new attribute:

listener type ref to IF_WD_VALUE_HELP_LISTENER.

in the method set_value_help_listener add the line:

wd_this->listener = listener.

then you can create as much views and things you need for your search help.

To set a selected value just add a method to your component controller which takes the values as import parameters. if you only want to set the value for the attribute it was requested for:

wd_this->listener->F4_CONTEXT_ELEMENT->set_attribute(

name = wd_this->listener->F4_ATTRIBUTE_INFO-name

value = <value>

).

This is the save way

But you can also call

wd_this->listener->F4_CONTEXT_ELEMENT->set_attribute(

name = 'CODEGRUPPE'

value = <value_codegruppe>

).

wd_this->listener->F4_CONTEXT_ELEMENT->set_attribute(

name = 'CODE'

value = <value_code>

).

But keep in mind that if the structure of the element changes, this could lead to short dump if the name of the attribute changes or the attribute was deleted.

if you want to close the search help window call wd_this->listener->close( ).

Hope this helps.

Cheers,

Sascha

Former Member
0 Kudos

Hi Sascha,

Thanks for your reply, sorry if im sounding a bit dumb but have not really worked with web dyn pros before. I have done the steps as you described i think:-) but im a little unsure how i then add this as the input help of the field. i have chosen 'freely programmed' as the input help mode then entered my web dynpro component name which is ZQPCD_SH. I then get the following error messsage:

ZQPCD_SH is not component usage of an implementation of IWD_VALUE_HELP.

I have added it to the 'implemented interfaces' tab which gave me the 'set_value_help_listener' method where i added your code. I then just put the wd_this->listener->F4_CONTEXT_ELEMENT... code in the WDOINIT method just to set a default value so that i could see it working, or not!

Any ideas why i get this error message?

Regards

Mart

Any ideas?

Former Member
0 Kudos

Hi Mart.

Sorry I forgot to mention that you have to add a component usage to the freely programmed component and then set the name for this usage for the field "Input Help Component Usage" for the context attribute.

Cheers,

Sascha

Former Member
0 Kudos

Thanks Sascha,

That has now allowed me to add the freely assigned input help. Not quite got it to return any values yet but at least I now know the basics of creating a freely programed search help so thanks very much for your time!

Regards

Mart

SergioFerrari
Active Contributor
0 Kudos

and now, if you like the freely programmed Search Helps, have a look to http://code.google.com/p/sapelegantfinder/ and to

/people/sergio.ferrari2/blog/2007/09/11/sap-elegant-finder-was-born--it-is-the-open-source-that-makes-a-pleasure-to-search-on-web-dynpro-for-abap

Sergio

Former Member
0 Kudos

Hi Sascha,

Just a quick question about the following comand:

wd_this->listener->F4_CONTEXT_ELEMENT->set_attribute(

name = 'CODEGRUPPE'

value = 'AA'

).

When ever i execute it i get a short dump with the following error, 'Access via 'NULL' object reference not possible'. do you know what this means?

Regards

Mart