Application Development 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: 

System variable to know whether some change is done or not

Former Member
0 Kudos

Hi,

i have a requirement where in a transaction i have 15 fields. if someone changes one field and tries to exit the program without saving it i need to populate a message.

is there any system variable which can give information that some change has happneed in the screen

awaiting reply and thanks in advance

regards

Sai easwar

6 REPLIES 6

former_member181962
Active Contributor
0 Kudos

Try sy-datar.

Otherwise you have to check old and new vvalues individually

Former Member
0 Kudos

hi SAi,

SY-DATAR <> 0 implies, some changes have been done to the screen fields.

Sajan.

Former Member
0 Kudos

HI,

I tried to use SY-DATAR. but it is giving SPACE always. is there anything i need to do to be set automatically?

regards

Sai easwar

0 Kudos

hi,

there is no sy-field.

try this:

organize your input-fields that they are in one structure.

e.g. in-bukrs,

in-gsber,...

define structure old like in (as copy).

at PBO save structure "IN" in OLD

after PAI compare "IN and "OLD"

if IN = OLD...

A.

Message was edited by: Andreas Mann

Former Member
0 Kudos

Hi Sai,

The sy-datar field will be initial, if no changes occur in the screen fields. It is character field (and hence please dont check for sy-datar <> 0 as i mentioned in my previous reply).

Sajan.

Former Member
0 Kudos

Hi,

follow below logic

itab_old-matnr = '10'.

itab-new-matnr = '20'.

case ok-code

when 'EXIT'

if itab_old-matnr <> itab_new-matnr.

message i000(zz) with 'Save entries'

endif.

Regards

amole