Sap scripting API must be active.
You need to enable this setting on both the user side and the server side.
1-Open SAP GUI (SAP GUI, i.e. Graphical User Interface must be active.)
2-Go to Options
3-Click on the Scripting tab and check the ENABLE scripting option
Follow the steps below to activate it on the server side
Access SAP server settings Set parameter to TRUE using transaction code RZ11