Liquid UI - Documentation - 8.19 include

8.19 include


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

This example demonstrates the usage of #include command to display notification details for an order on SAP Easy Access screen from Change Notification screen (IW28).
  1. Open SAP Easy Access screen. You will see the customized screen to display required notification details
     
  2. 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" 

Script Details


Can't find the answers you're looking for?