Actually i have pressed some key say F7 to scroll the contents in mainframe, then i press some other key say F10 which performs some task on the contents on the screen. Now i want to know that whther F7 is pressed anytime in the whole transaction. The problem is for every key press the program is called and the values are restored so i want some storage area where i can retrieve values in my next call......
Take a look at both the program and the MFS. They will determine how PF keys are handled. When you "communicate" by pressing a key that is defined, you are not "scrolling the contents of the mainframe" - you are scrolling the message fields that were passed back to your screen when you hit a function key. They are formatted and passed back from the database based on your program's instructions.
I have checked the program for this.... i'm working on that program..... but here my concern is to trace the previously pressed key not the current key..... The program present has instructions to process the current PF key......
You can always control where you are and what you did the last time you pressed a key. You hide that info in hidden "work fields" on you screen. If this is an existing program, that info will not be available to you unless the person that originally wrote the program put the code in.