Skip to Content
0
Former Member
May 07, 2010 at 12:00 PM

Updating a field using the FUNCTION 'REUSE_ALV_GRID_DISPLAY'

32 Views

hi,

I'm using the FUNCTION 'REUSE_ALV_GRID_DISPLAY' in my program. I want to update the field, which a user changed the value. I do it as following:

form update_flight.

l_fieldcat-fieldname = 'CUSTOMID'.

l_fieldcat-tabname = 'ZROWS_FLT_BOOK'.

l_fieldcat-edit = 'X'.

l_fieldcat-input = 'X'.

APPEND l_fieldcat TO l_tab_fieldcat.

...

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

i_callback_program = l_dis-report

i_callback_pf_status_set = 'CB_ALV_PF_SET_STATUS'

i_callback_user_command = 'CB_ALV_USER_COMMAND'

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

i_structure_name = 'ZROWS_FLT_BOOK'

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

is_layout = l_str_layout

it_fieldcat = l_tab_fieldcat

.

.

.

LOOP AT l_tab_reservationx ASSIGNING <l_str_reservationx>.

IF <l_str_reservationx>-mark = 'X'. "it is updated

update zrows_flt_book set CUSTOMID = <L_str_reservationx>-customid "this is not updated. Why?

WHERE carrid = <l_str_reservationx>-carrid

AND connid = <l_str_reservationx>-connid

AND fldate = <l_str_reservationx>-fldate

AND bookid = <l_str_reservationx>-bookid.

ENDIF.

ENDLOOP.

if sy-subrc eq 0.

commit work.

else.

rollback work.

endif.

*****************************************************

and in other Form

FORM cb_alv_user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

IF r_ucomm = 'EXECUTE'.

rs_selfield-exit = 'X'.

rs_selfield-refresh = 'X'.

ENDIF.

ENDFORM.

Thank you for your help.