cancel
Showing results for 
Search instead for 
Did you mean: 

How to use free programmed value help in web dynpro table

Former Member
0 Kudos

Hi,

I am using a free programmed value help (implementing the IWD_VALUE_HELP) in a table.

I create a component usage in another application and attach the value help to a context filed of a table structure.

When I select this field in the table, the value help opens and I can select a value .

However, it only puts the selected value in the corresponding field if the first row in the table.

If I use the value help in another row, the selected value should be transferred to this row.

Now I need to know the originating row in the method transferring the value to the table.

How can I do this ?

Any help is appreciated.

Regards

Marcus

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member1151507
Participant
0 Kudos

Hi,

You might have created some event and fire that event when ever we select the data from F4 help and created an event handler for that event in the Component (where you have table).

In the event handler, you need to get the data selected from F4 and bind it to the table. Here is some sample code:

data lo_nd_selected_val TYPE REF TO if_wd_context_node.

data lo_el_selected_val TYPE REF TO if_wd_context_element.

data ls_selected_val TYPE wd_this->element_selected_val.

data lo_nd_table TYPE REF TO if_wd_context_node.

data lo_el_table TYPE REF TO if_wd_context_element.

    • get selected value

lo_nd_selected_val = wd_context->get_child_node( name = wd_this->wdctx_selected_val ).

  • get element via lead selection

lo_el_selected_val = lo_nd_selected_val->get_element( ).

  • get all declared attributes

lo_el_selected_val->get_static_attributes(

IMPORTING

static_attributes = ls_selected_val ).

    • set to the table field

lo_nd_table= wd_context->get_child_node( name = wd_this->wdctx_table ).

lo_el_table = lo_nd_table->get_element( ). " return the selected row

lo_el_table->set_attribute(

name = `PERNR`

value = ls_selected_val-pernr).

Regards,

Manogna

Madhu2004
Active Contributor
0 Kudos

HI,

when creating a freely programmed value help component we need to implement interface IWD_VALUE_HELP,

which gives a method SET_VALUE_HELP_LISTENER Ato set the instance of value help listner.

Create a component controller attribute to maintain buffer the value help listner instance of type IF_WD_VALUE_HELP_LISTENER.

This interface has the context element refernce of the attribute for which you selected the F4(freely programmed help)

In the view where you are setting the value selected use the F4_CONTEXT_ELEMENT of the above interface an it will set the value correctly to the selected cell.

Regards,

Madhu