On one of the screens I am working, PF4 has a return functionality. On pressing the PF4 key (displayed with label 'RETURN' on the map) the user should go back to the transaction from which this transaction was invoked. If however this transaction was started directly (by entering the transaction on a blank CICS screen) then pressing PF4 should clear the screen and return the control to CICS. The user can always press the clear key to do the same but this is what they want. Any pointers on how this can be done would be of great help.
Right now this is what i am planning to do:
Do a send text with message 'Function XXXX terminated. Clear screen before entering the a new function'. Then do a EXEC CICS RETURN.