Purpose With CallJSAsync you can asynchonously call a JavaScript function from a GuiXT Script or InputScript.

Component "GuiXT Controls" is needed for this command.

Example CallJSAsync SetGridLayout

The JavaScript function  "SetGridLayout" is called asynchronously when all elements of the SAP GUI window are created.

Format and Details

Syntax and semantics are identical with  CallJS with the exception that the call is not performed synchronously but later on after finishing the GuiXT script processing and after the creation of all screen elements by SAP GUI. Accessing objects and methods of SAP GUI scripting is possible in asynchronous JavaScript call only, since they are not yet created at the time when the GuiXT script  - which may change the screen layout - is still running.

If the SAP GUI screen contains a "SAP Tree Control" or a "SAP Grid Control", you can use the predefined objects "SapTree" and  "SapGrid" and apply the SAP GUI scripting methods. The SAP GUI session object is predefined as is "SapSession". All these objects are allocated under the condition that SAP GUI scripting is active both on the server and at the frontend.

Components GuiXT + Controls