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

How to check changed data

Former Member
0 Likes
2,808

Hi all,

I have added a sub-screen in XQQM function module for the scrap notification. Here the user inputs the data in table control and saves using QM01.Now in QM02 the screen shot is as follows

Now when user changes any value and performs any action other than save, i want to use FM POPUP_TO_CONFIRM. here my problem is how to know whether the value of a particular field is changed or not and the field may be part of the table control item or an individual field.Here my intension is if any thing is changed then i want to inform the user else i want to display message no changes done(if clicked on save).

Thanks in advance

Mallikarjun Reddy G

1 ACCEPTED SOLUTION
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
1,900

Check if SY-DATAR works for you it gets set if you change anything on screen. Please check

Hi all,

I have added a sub-screen in XQQM function module for the scrap notification. Here the user inputs the data in table control and saves using QM01.Now in QM02 the screen shot is as follows

Now when user changes any value and performs any action other than save, i want to use FM POPUP_TO_CONFIRM. here my problem is how to know whether the value of a particular field is changed or not and the field may be part of the table control item or an individual field.Here my intension is if any thing is changed then i want to inform the user else i want to display message no changes done(if clicked on save).

Thanks in advance

Mallikarjun Reddy G

4 REPLIES 4
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
1,901

Check if SY-DATAR works for you it gets set if you change anything on screen. Please check

Read only

0 Likes
1,900

Thank you Nabheet,earlier i checked with that system field but could not find.Now again i checked its so far returning the value 'X'. Thanks for your reply

Read only

0 Likes
1,900

hi nabheet,

here sy-datar is not working in my screen. see the following code.

PROCESS AFTER INPUT.

MODULE CHECK_CHANGE INPUT.

   IF SY-DATAR = 'X'.

     CLEAR CHANGE_FLAG.

     CHANGE_FLAG = SY-DATAR.

   ENDIF.

ENDMODULE.


But the value for sy-datar is always 'X' even i am not changing any field either in table control or an individual field(Not part of table control). Here i am selecting the row in table control.whenever i am selecting the row its returning 'X'.can you please let me know.


Thanks in advance

Mallikarjun Reddy

Read only

0 Likes
1,900

Hi Mallikarjun

So it becomes X even if you select some row in table control...correct I think a better and safe solution will be to follow how SAP standard does in case of sales order etc...all header fields should be part of work area XWA/YWA(X signifies new/updated data Y means old) and all table control data in XTC[]/YTC[]. You can have initially same header data in XWA and YWA in PAI update XWA check if XWA ne YWA means something changed. Same goes for internal table.

A reliable way of checking

Nabheet