In what mode the Datastore is set to?
Generate & Execute
Or Execute Preloaded?
For the Datastore Config that is used by the job, set the mode to Generate & Execute
Also, the below post would be helpful for you in the way to write the ABAP program in SAP System as the method of “Generate & Execute” would be a costly one.