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

Save data in database table using ALV

Former Member
0 Likes
430

I need to save my data in a database table after i enter the values in alv.

Can any1 help me in this, the call method i need is for version 4.6

2 REPLIES 2
Read only

Former Member
0 Likes
365

hii naresh,

In your FORM user-command using p type sy-ucomm

ff type selfield.

case sy-ucomm.

when 'UPDATE'.

loop at itab where box = 'X'.

modify itab.

modify ztab from itab.

endloop.

moreover you can refer this link also.

rgrds,

Shweta

Edited by: Shweta Joon on Aug 21, 2009 9:30 AM

Read only

Former Member
0 Likes
365

Solved it by searching through forums.

FORM save_database .

  • Getting the selected rows index

CALL METHOD O_GRID->GET_SELECTED_ROWS

IMPORTING ET_INDEX_ROWS = i_selected_rows.

  • Through the index capturing the values of selected rows

LOOP AT i_selected_rows INTO w_selected_rows.

READ TABLE itab INTO wa INDEX w_selected_rows-index.

IF sy-subrc EQ 0.

MOVE-CORRESPONDING wa TO w_modified.

APPEND append w_modified TO i_modified.

ENDIF.

ENDLOOP.

MODIFY zzzmaterial FROM TABLE i_modified.

ENDFORM. " save_database