---
title: "How to check if data has been changed "
author: "huang850625"
date: "2014-08-04T16:07:08Z"
tags: []
categories: ["行业应用"]
slug: "how-to-check-if-data-has-been-changed"
draft: false
lastmod: "2014-08-04T16:07:08Z"
id: 2100106
url: "https://wabaper.iteye.com/blog/2100106"
---

There is a system variable SY-DATAR. If any value is changed in the screen it will have 'X'.Otherwise it will be initial.

SY-DATAR is to be used along with a flag.

In PAI set flag using SY-DATAR.

ie

if sy-datar is not initial.
flag = 1.
endif.

Now in 
Module exit_command..
if sy-datar is initial and flag is initial.
...
else.
.....
endif
endmodule
![](http://dl2.iteye.com/upload/attachment/0099/8092/8ff8684e-c440-3001-af4c-33ee3e86899d.png)

refer to:http://scn.sap.com/thread/787703