2009 Sep 23 5:18 PM
h4.
Hi Friends,
h4.
When the User Presses BACK Button in the PF Status, it should trigger POPUP_TO_CONFIRM whether to SAVE or not.
h4.
Suppose if the user doesn't change any thing in the Screen, it should not ask the User.
h4.
How can i know whether the user changes something in the Screen.
h4.
Screen mean Table Control..
h4.
How can i track this.
h4.
Regards:.
h4.
Sridhar.J
2009 Sep 24 5:56 AM
Hi Sridhar.
Two ways to know if data was changed:
1. Before displaying the popup, store the old value (that you are about to display) in a variable
When the user clicks back, check the new value in the screen field is same as old value or not. If not, display your popup to confirm SAVE.
2. Using the variable SY-DATAR which is set to 'X' after any key press. This is not much reliable... you may not want to ask for SAVE if the user changed the data but wrote it back, example: "ABAP" -> "ABA" -> "ABAP" the final value is still the same as previous value but SY-DATAR is set to X.
regards,
Aabhas...
Edited by: Aabhas K Vishnoi on Sep 24, 2009 2:56 PM
h4.
Hi Friends,
h4.
When the User Presses BACK Button in the PF Status, it should trigger POPUP_TO_CONFIRM whether to SAVE or not.
h4.
Suppose if the user doesn't change any thing in the Screen, it should not ask the User.
h4.
How can i know whether the user changes something in the Screen.
h4.
Screen mean Table Control..
h4.
How can i track this.
h4.
Regards:.
h4.
Sridhar.J
2009 Sep 23 5:25 PM
Hi
If I rember the system variable SY-DATAR should be set to X if a value in a input field is changed
Max
2009 Sep 24 5:56 AM
Hi Sridhar.
Two ways to know if data was changed:
1. Before displaying the popup, store the old value (that you are about to display) in a variable
When the user clicks back, check the new value in the screen field is same as old value or not. If not, display your popup to confirm SAVE.
2. Using the variable SY-DATAR which is set to 'X' after any key press. This is not much reliable... you may not want to ask for SAVE if the user changed the data but wrote it back, example: "ABAP" -> "ABA" -> "ABAP" the final value is still the same as previous value but SY-DATAR is set to X.
regards,
Aabhas...
Edited by: Aabhas K Vishnoi on Sep 24, 2009 2:56 PM
2009 Sep 28 7:28 AM
Hi Sridhar,
Within the table control loop, create a chain of all the fields in the structure of line type. call a PAI module with addition ON CHAIN-REQUEST. This is a conditional module call which will be triggered ONLY when user changes something on the screen. In this module you can set a global variable DATA_CHANGED to say 'X'. When user chooses BACK function, check this global variable to decide on the confirmation popup.
One small caution. If you have the ROW SELECTION field also included in the line type of your internal table associated with the table control, you need to exclude that from the CHAIN of fields above; otherwise even when user selects a line or de-selects, this module will be triggered.
Read ON CHAIN-REQUEST and ON REQUEST online ABAP help for more clarity.
Regards
Suresh
Edited by: Suresh Radhakrishnan on Sep 28, 2009 4:29 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |