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

Capturing data from ALV grid

Former Member
0 Likes
672

Dear experts.

Can anyone help me to capture data from ALV grid to pass to a BAPI FM.

My ALV grid has the check box as first column and I want to capture only the rows in the grid with these checkboxes checked. I would prefer to do it without OO.

Regards

Sathar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
633

1. Make your ALV grid editable.

2. In REUSE_ALV_GRID_DISPLAY_LVC or REUSE_ALV_GRID_DISPLAY FM call, pass the user_command subroutine.

i_callback_user_command = 'USER_COMMAND'

3. implement the user_command perform sample

form user_command using r_ucomm type sy-ucomm

rs_selfield type slis_selfield.

case r_ucomm.

when 'SAVE'.

loop at itab where cbox = 'X'.

  • Your code to do whatever.

endloop.

endcase.

endform.

4 REPLIES 4
Read only

Former Member
0 Likes
633

Hi,

Is your ALV editable ? Have you already codded the ALV ?

Regards,

David

Read only

0 Likes
633

Hi David

Yes I have coded my alv to have 3 columns including the checkbox column as editable.

Regards

Sathar

Read only

uwe_schieferstein
Active Contributor
0 Likes
633

Hello Sathar

You need to call method go_grid-><b>check_changed_data</b>( ) at <b>PAI </b>to retrieve the current data from your editable ALV list.

For more details have a look at threads:

Regards

Uwe

Read only

Former Member
0 Likes
634

1. Make your ALV grid editable.

2. In REUSE_ALV_GRID_DISPLAY_LVC or REUSE_ALV_GRID_DISPLAY FM call, pass the user_command subroutine.

i_callback_user_command = 'USER_COMMAND'

3. implement the user_command perform sample

form user_command using r_ucomm type sy-ucomm

rs_selfield type slis_selfield.

case r_ucomm.

when 'SAVE'.

loop at itab where cbox = 'X'.

  • Your code to do whatever.

endloop.

endcase.

endform.