Hi,
Would you be able to attach the screen print of the Substitution here?
Did you mention any Limitation on the Transaction Code as prerequisite and running in Background mode or batch job? If yes..then please set an expert trace and Confirm back that the SY_TCODE Field is popoulating as "Blank".
Hope it helps!
Thanks and Regards,
Varshal Kachole