Wrong sy-sysid value
An ABAP program which makes use of sy-sysid picks up a wrong value. The system id is TST, but it picks up production id which is PRD. Therefore, when user runs transaction that needs to place a text file in the local directory, it is looking for /PRD/pce/outdata instead of the existing /TST/pce/outdata, and cannot find it. Clients are refreshed via client import and local client copy. Logical System is defined properly. Where is wrong sy-sysid is coming from?