Hi Anand,
The code seems fine, I'll give you a simple example check if everything is followed as this code
parameters: p_check type c.
*Here the Screen Name is p_check, the name of your variable
AT SELECTION-SCREEN.
LOOP AT SCREEN.
IF SCREEN-NAME = 'P_CHECK'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
You Screen-Name shoud be in Quotes(' ') eg: 'P_CHECK' in caps
If the problem Still Exists Debug and check if the Control is entering your WHEN condition.
Thanks and Regards,
Pratheek