cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to read the basic data during ON_CLICK event

Former Member
0 Kudos

Hi Experts,

I have developed one web dynpro application where I need to read the basic data from the primary table.Based on the on click event if i click on any row of this primary table i should get the details of this row.

For ex: In the first table which is ALV type and having the fields like MATNR etc ,if i click on MATNR then it should retrieve item details of corresponding material number from MARC table.

What i have done :

1.I have created an ALV table and created a link_to_action for the column MATNR.

2.I could trigger the on_click event.

Problem .

As the details of the particular clicked row is present in r_param , my problem is how to use this details in select statement so that i can use the value of the material number and select item details from MARC.

Please post your ideas and suggestions.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI ,

You can directly retrieve the data from r_param.

field-symbols : <lv_id> type data.

assign R_PARAM->value->* to <lv_id>.

Now you can use this field symbol to get the vaules.

Regards

Kuldeep

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi manogna and kuldeep,

I have tried both ways .Both are working .Thanks alot.

Edited by: ch_ravi_sap on Apr 13, 2011 10:40 AM

former_member1151507
Participant
0 Kudos

Hi,

In your event handler, R_PARAM->INDEX value gives you the index of the row from where you have clicked MATNR.

By using this index you can get the node element of ALV table and attribute value.

For reference go through the following example.

data lv_index type i.

data lv_matnr type mara-matnr.

data lo_element type ref to if_wd_context_element.

data lo_node type ref to if_wd_context_node.

lv_index = r_param->index.

  • get the node reference first & get the selected element of node

lo_node = wdcontext->get_node( 'ALV' ).

lo_element = lo_node->get_element( lv_index ).

lo_element->get_attribute( exporting name = 'MATNR' importing value = lv_matnr ).

Regards,

Manogna