omkarengineer:
I made it for 2 command but i don't know why it not running. it executes only on 2nd command.
first command executed
Are you saying that even if you send 'a' the code for 'b' is run?
I don't think it is relevant but this line is not doing anything useful as the variable data already has the value 'a'
data='a';
Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.
...R
PS... You need to post your code between [code] [/code] tags