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

Problem in edittable ALV grid

Former Member
0 Likes
284

Hi All,

When I click on save after editting.I have a pop-up message having two buttons-yes and cancel.When I clcik on save,data get updated.But when I click on cancel,I want that The alv grid display page should return to previous values which were there before editting.

Please answer to my query.

Thanks and Regards,

Aman

Hi All,

When I click on save after editting.I have a pop-up message having two buttons-yes and cancel.When I clcik on save,data get updated.But when I click on cancel,I want that The alv grid display page should return to previous values which were there before editting.

Please answer to my query.

Thanks and Regards,

Aman

1 REPLY 1
Read only

Former Member
0 Likes
268

Hi Try this Code

FORM list_display .

DATA: l_exit_by_caller(1) TYPE c,

ls_exit_by_user TYPE slis_exit_by_user,

l_answer(1) TYPE c.

DO.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = sy-cprog

i_callback_pf_status_set = 'F_SET_PF_STATUS'

i_callback_user_command = 'F_USER_COMMAND'

i_callback_top_of_page = 'F_TOP_OF_PAGE'

it_fieldcat = itab_fieldcat

is_layout = wa_layout

i_save = 'A'

it_events = itab_events

IMPORTING

e_exit_caused_by_caller = l_exit_by_caller

es_exit_caused_by_user = ls_exit_by_user

TABLES

t_outtab = itab_overall

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

IF ls_exit_by_user-back = 'X' OR

ls_exit_by_user-exit = 'X' OR

ls_exit_by_user-cancel = 'X'.

IF itab_overall IS INITIAL.

LEAVE LIST-PROCESSING.

ENDIF.

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

text_question = text-prn

text_button_1 = text-yes

text_button_2 = text-ext

display_cancel_button = ' '

IMPORTING

answer = l_answer

EXCEPTIONS

text_not_found = 1

OTHERS = 2.

IF sy-subrc <> 0 OR l_answer NE '1'.

EXIT.

ENDIF.

ENDIF.

ENDIF.

ENDDO.

Thanks

Pavan