cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic search help using value set is not working in any method other than wdinit

former_member283828
Participant
0 Kudos

Hi,

I am creating the dynamic value help using the below code. It is working only when I put the code in wdinit() method.

My requirement is to get the dynamic value help values based on another field selected so I cannot put the code in wdinit().

Let me know how we can catch the event when the user clicks f4 button in above scenario so that I can get the query field value(project) and get the dynamic search help values(wage type relevant to that  project).

DATA lo_nd_flightinfo TYPE REF TO if_wd_context_node.

DATA lo_nd_info_flightinfo TYPE REF TO if_wd_context_node_info.

DATA lt_value_set TYPE wdy_key_value_table.

DATA lo_componentcontroller TYPE REF TO ig_componentcontroller .

lo_nd_flightinfo = wd_context->get_child_node( name = 'FLIGHTINFO' ).

lo_nd_info_flightinfo = lo_nd_flightinfo->get_node_info( ).

lo_componentcontroller = wd_this->get_componentcontroller_ctr( ).

lo_componentcontroller->read_carrid( IMPORTING e_carrier_vs = lt_value_set ).

lo_nd_info_flightinfo->set_attribute_value_set( name = 'CARRID' value_set = lt_value_set ).

Thanks & Regards,

Kiran Kumar K

Accepted Solutions (0)

Answers (1)

Answers (1)

amy_king
Active Contributor
0 Kudos

Hi Kiran,

There is no event for onClick of the F4 button, but you could move your code into hook method WDDOMODIFYVIEW, which will execute upon return from a search help.

Cheers,

Amy

former_member283828
Participant
0 Kudos

Thanks Amy for the reply.

Actually the issue is the above code for dynamic search help is working only when I put the code in Wdinit() method I.e before the view is rendered.

How can I make the code work in any other method after the view is rendered.

Thanks & Regards,

Kiran Kumar K

amy_king
Active Contributor
0 Kudos

Hi Kiran,

It sounds like this is a dropdown and not a search help, is that right? If it's really a search help, you can restrict the search help values with importing parameters. If it's a dropdown, you need some action to trigger after the user enters a value in the project field so that your code can set the wage type value set.

"the above code ... is working only when I put the code in Wdinit() method."

The code itself should work in any method, but the question is when does that method execute? You need a method that will execute after the project value is entered and before the wage type dropdown is clicked.

You could create an onEnter event for the project field that builds the value set for the wage type dropdown based on the project value. Maybe you could disable the wage type field until the user enters a project value and hits enter.

Cheers,

Amy

former_member283828
Participant
0 Kudos

Hi Amy,

My requirement is to have a search help not dropdown because user want to see both value and text together.

The importing parameters for the elementary search help doesn't help in my case as I need to search the ztable to fetch the active record at that point of time based on the work_date I.e workdate should be in between begda and enda. The workdate field is not there in the ztable from where I am searching the records but there are begda and enda.

Again below code is working when I put the same in WdInit() for search help but it is not working in any other method.

Its working fine I.e in other methods in the case of dropdown but incase of UI element to be input field(I.e for search help) it is only working in WdInit() and not working in any other methods.

I have put the context attribute property 'Input Help Mode' to be 'automatic'.


I am referring the below tutorial:

http://fuller.mit.edu/web_dynpro/value_help_web_dynpro_tutorial.pdf

I am using the below code:

DATA:

lr_node_sbook type ref to if_wd_context_node,

lr_node_info type ref to if_wd_context_node_info,

lr_value_set type wdr_context_attr_value,

lt_value_set type table of wdr_context_attr_value.

lr_node_sbook = wd_context->get_child_node( name = wd_this->wdctx_wbs_order_wt ).

lr_node_info = lr_node_sbook->get_node_info( ).

 

*define value set

lr_value_set-value = '1166'.

lr_value_set-text = 'Living Allowance Non Taxable'.

Append lr_value_set to lt_value_set.

lr_value_set-value = '1167'.

lr_value_set-text = 'Travel Allowance Non Taxable'.

Append lr_value_set to lt_value_set.

lr_node_info->set_attribute_value_set( name = 'DEF_WT1'

     value_set = lt_value_set ).

Thanks & Regards,

Kiran Kumar K