‎2007 Jun 21 8:15 PM
Hi all,
I want to track the changes in my screen fields, if it is already updated in the database table, when user selects any exit command it should not give any pop up message(allowing them to go back). If not i need to give a pop up message, giving the user an option to save before exit.
Thanks a bunch.
‎2007 Jun 21 10:05 PM
Rob,
If you understand my question, could you explain how can i use sy-datar.
Seshu,
That way is too long to reach my answer, which will lead to ambiguous state for others.
I guess we can use SCU3 and AUT10 for data log changes. Could any one of you explain how can i use. I am not familiar with that piece.
Warm regards
‎2007 Jun 21 8:33 PM
clear flag.
Check the screen fields value with respect to database.
if sy-subrc eq 0.
flag = 'X'
endif.
when 'EXIT'.
if flag = 'X'.
leave to screen 0.
else.
give pop up message
leave to screen current screen.
endif.
Do not use at exit command ,if you use will not get output as you expected
Thanks
Seshu
‎2007 Jun 21 8:47 PM
I think you can check sy-datar to see if the screen has changed.
So long as the command you are using to exit is defined as an exit-command, you can use an exit module.
Rob
Message was edited by:
Rob Burbank
‎2007 Jun 21 10:05 PM
Rob,
If you understand my question, could you explain how can i use sy-datar.
Seshu,
That way is too long to reach my answer, which will lead to ambiguous state for others.
I guess we can use SCU3 and AUT10 for data log changes. Could any one of you explain how can i use. I am not familiar with that piece.
Warm regards
‎2007 Jun 21 10:08 PM
Like this:
*&---------------------------------------------------------------------*
*& Module EXIT_100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module exit_0100 input.
data: answer.
case ok_code.
when 'CAN'.
if not sy-datar is initial.
call function 'POPUP_TO_CONFIRM_LOSS_OF_DATA'
exporting
titel = 'Exit Editing'
textline1 = 'Do you want to exit editing?'
importing
answer = answer.
if answer = 'J'.
leave program.
endif.
else.
leave program.
endif.
when '%EX'.
if not sy-datar is initial.
call function 'POPUP_TO_CONFIRM_LOSS_OF_DATA'
exporting
titel = 'Exit Editing'
textline1 = 'Do you want to exit editing?'
importing
answer = answer.
if answer = 'J'.
leave program.
endif.
else.
leave program.
endif.
when 'CLEAR'.
perform clear_screen.
leave to screen '0100'.
when 'HELP'.
perform action_help.
endcase.
endmodule. " EXIT_100 INPUT
Rob
‎2007 Jun 21 10:19 PM
Do you have a table control in the screen? I'm not sure if sy-datar can keep track of changes in a table control.
Rob
‎2007 Jun 21 11:42 PM
yes, I have table control in my screen...........but let me check
‎2007 Jun 22 4:24 AM
Thanks Rob,
I got it done, it is working for table control also. Thanks a lot.
‎2007 Jun 22 2:02 PM