cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the changed row index in webdynpro alv ?

Former Member
0 Kudos

Dear Experts,

I have a ALV table in that one of the two col's are from date and to date. So I'm defaulting those two values based on my data base values.

Suppose in row 2 of the below snapshot, the  from date = 25.01.2014 and to date = 26.01.2014. So here my logic is todate = from date + 2(2days validity). But it should should also accept date <= 26.01.2014.

Pls help me out how to read the selected/changed row of alv table ?. I'm writing the code in ON_CELL_ACTION .

For Ex : If date is changed in 2nd row, i should read only 2nd row of the table.


Thanks

Santhosh

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member213957
Participant
0 Kudos

Hi Santhosh,

From andy alv-event methods you will get parameter R_PARAMS-> INDEX which contains selcted row index. Using this index read entire row of the alv table data like GET_STATIC_ATTRIBUTES.

Modify the values how you required and bind again to table data like BIND_TABLE.

Regards,

Kishorekumar

Former Member
0 Kudos

You can use e.g. the WDDOMODIFYVIEW for this purpose, which will be triggered in any case. There you can implement the logic that is needed.

But you will have to loop through all the records, as I'm not sure if getting only the changed data is possible in ALV (as it is probably not possible for a table element itselft (e.g. using IF_WD_TABLE_METHOD_HNDL or classes using this interface).

I'm supposing you don't expect the user to make the action (e.g. enter) only on the changed row).

ramakrishnappa
Active Contributor
0 Kudos

Hi,

Use the index of the row in on_cell_action from parameter r_params

Lo_node = get the node reference here.

Lo_element = lo_node-> get_element ( index = r_params-> index ).

Now get the static attributes from lo_element.

Hope this helps you.

Let me know if u need further assistance.

Regards,

Rama