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

editable alv.

kiran_k8
Active Contributor
0 Likes
790

I had created an editable alv where I am having a blank field where the user will enter the data.And when hitting SAVE I want to capture this data in the alv grid back into the program for further processing.



form list1 using r_ucomm like sy-ucomm rs_selfield type slis_selfield.
  case r_ucomm.

    when '&IC1'.

      if rs_selfield-fieldname = 'MATNR'.
        read table it_final index rs_selfield-tabindex.
        set parameter id 'MAT' field it_final-matnr.
        call transaction 'MM03' and skip first screen.
      endif.

  when '&SAVE'.
      rs_SELFIELD-REFRESH = 'X'.
      loop at it_final.
      if it_final-chk = 'X'.
      modify it_final index sy-tabix transporting chk incident.
      endif.
      endloop.
endform

I am getting the CHK as X but not the value that I am entering in the incident (field name) at ALV gird.

Thanks,

Kiran.

6 REPLIES 6
Read only

Former Member
0 Likes
740

call the method check_changed_data of class cl_gui_alv_grid.

The changes done on the editable alv will be copied in the internal table.

data : obj1 type ref to cl_gui_alv_grid.

create object obj1.

for e.g. call method obj1->check_changed_data

Read only

0 Likes
740

Ibrahim,

New to OOPS.Do you have a sample cade which I can go thorugh.

Can't we do without using OOPS ?

Thanks,

Kiran.

Read only

Former Member
0 Likes
740

Hi ,

try this

when '&SAVE'.

loop at it_final where chk = 'X'.

modify it_final index sy-tabix transporting chk incident.

endloop.

rs_SELFIELD-REFRESH = 'X'.

Read only

Noorie
Active Participant
0 Likes
740

Hi,

I think the problem is with the modify it_final sy-tabic.

if you want to modify only one line which is slected then

loop at it_final where chk = 'X'.

modify it_final transporting where chk = 'X'.

endloop.

if multipul lines is selected then:

loop at it_final where chk = 'X'.

modify it_final transporting where chk = 'X' and

field1 = it_final-feild1 and

field2 = it_final-feild2.

endloop.

I had the same problem, but resolved.

Hope this will be helpfull

Read only

kiran_k8
Active Contributor
0 Likes
740

Is it not possible without OOPS ?

Thanks

Read only

kiran_k8
Active Contributor
0 Likes
740

IF ref_grid IS INITIAL.

CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

IMPORTING

e_grid = ref_grid.

ENDIF.

IF NOT ref_grid IS INITIAL.

CALL METHOD ref_grid->check_changed_data.

ENDIF.

The above set of code met my requirement of capturing the data that is changed by the user in the alv gird and using it for further processing within the program.Thanks to SDN wiki.

Thanks,

Kiran.