Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

USER_COMMAND Subroutine in ALV Grid

Former Member
0 Likes
591

Hi Experts,

Let's say the ouput of my ALV report displays 10 fields based on the selection criteria entered. Each row has two editable rows (in other words the report has two editable columns). Now I want to edit 2nd, 5th and 8th rows. How do I need to capture the edited rows into an internal table at run-time using RS_SELFIELD? I am using FM REUSE_ALV_GRID_DISPLAY. Please suggest me a solution.

Thank you

2 REPLIES 2
Read only

Former Member
0 Likes
482

Right this moment, I can think in this way -

The internal table for the list output is IT_OUTPUT. We know which two columns are editable. Now before calling the FM REUSE_ALV_GRID_DISPLAY, Pass the entire table content from IT_OUTPUT to another Internal Table IT_OUTPUT_P. Now display the List Output and make the necessary changes in the list. The IT_OUTPUT table is now with the modified values in those editable columns. Now compare the IT_OUTPUT_P with IT_OUTPUT table for those two editable columns. Then we can have the exact row numbers where the modifications have made.

Read only

Former Member
0 Likes
482

Hi,

When you are using USER_COMMAND event, after double click on the report output,

Row number is stored in structure 'rs_selfield-tabindex'.

Check wether it is 2nd, 5th or 8th row as per your consideration.

If it is there then use 'slis_fieldcat_alv-edit' field and pass 'X' to it in order to edit that field.

if rs_selfield-tabindex EQ 2 or rs_selfield-tabindex EQ 5 or rs_selfield-tabindex EQ 8.

slis_fieldcat_alv-edit = 'X'.

endif.

Thanks,

Govind