Purpose
You can load a file content into the source script file using #include' directive. This tells the pre-processor to load the file contents inline. You can execute very complex scripts easily minimizing errors and increasing efficiency.
This process allows the interpreter to execute the script continously after executing the included script file in the source script file. This is used for code readability when smaller functions have to be grouped into separate files and called inline. You can include this command in a function or directly in the script file.
Syntax
#include "filename.sjs"
Note: Make sure there are no blank spaces after declaration of the include statement or else include will not get executed
Options
The #include command does not take any options.
Example
-
Open SAP Easy Access screen. You will see the customized screen to display required notification details
-
Click on Get Order Info[Syntax1] to display the notification details in the respective fields. Here the function does error handling, calls include function and returns ro main function.
Liquid UI Script
//SAPLSMTR_NAVIGATION.E0100.sjs
// Include Pre-processor makes the function inline #include "INC_GET_ORDER_DATA_1.sjs" #include "INC_GET_ORDER_DATA_2.sjs"