Need help regarding user with nologin

Hi,
Need one clarification..
If suppose, I have disabled the login to a particular user XXX, but not deleted the user.
So the scripts which must be executed using the user XXX can still be executed using that user or is it not possible..?

In our tasks, we are disabling the user XXX, and after that we r trying to execute some scripts to which XXX is the owner, using su �u XXX �command.
But it failed to work.
But doing the same using sudo �u XXX command is working.

Unable to get what the problem is�
Can u plz help me in this..?

Each process has a real user id and an effective user id.

sudo has the same effect as su username
This DOES NOT "login", you have to run the .profile manually, for example.
This simply changes the effective user id

su - username
This DOES "login"
This changes the real user id.

Is that what you mean?