SAP EDITOR_SYNTAX_CHECK Function Module for
EDITOR_SYNTAX_CHECK is a standard editor syntax check SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for editor syntax check FM, simply by entering the name EDITOR_SYNTAX_CHECK into the relevant SAP transaction such as SE37 or SE38.
Function Group: S38E
Program Name: SAPLS38E
Main Program: SAPLS38E
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function EDITOR_SYNTAX_CHECK pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'EDITOR_SYNTAX_CHECK'".
EXPORTING
* I_GLOBAL_CHECK = ' ' "Check the main program containing the include
* I_GLOBAL_PROGRAM = ' ' "Main program to be checked with modified include
I_PROGRAM = "Program or include to be checked
* I_R2_CHECK = ' ' "Check with R/2 syntax
* I_R2_DESTINATION = ' ' "RFC destinatiion for R/2 syntax check
* I_TRDIR = ' ' "
* I_CORRWARN = ' ' "
* ALL_ERRORS = ' ' "
IMPORTING
O_ERROR_INCLUDE = "Include where error is located
O_ERROR_LINE = "Line of the error position
O_ERROR_MESSAGE = "Error message text
O_ERROR_OFFSET = "Offset of the error position
O_ERROR_SUBRC = "Return code of SYNTAX-CHECK
TABLES
I_SOURCE = "Source to be checked, its name is I_PROGRAM
* O_CORRECTION_TAB = "
* O_WARNINGS_TAB = "
* O_ERROR_TAB = "
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPLS38E_001 Exit for ABAP Editor
IMPORTING Parameters details for EDITOR_SYNTAX_CHECK
I_GLOBAL_CHECK - Check the main program containing the include
Data type: SY-CALLDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_GLOBAL_PROGRAM - Main program to be checked with modified include
Data type: SY-REPIDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_PROGRAM - Program or include to be checked
Data type: SY-REPIDOptional: No
Call by Reference: No ( called with pass by value option)
I_R2_CHECK - Check with R/2 syntax
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_R2_DESTINATION - RFC destinatiion for R/2 syntax check
Data type: TXCOM-SDESTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_TRDIR -
Data type: TRDIRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_CORRWARN -
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
ALL_ERRORS -
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for EDITOR_SYNTAX_CHECK
O_ERROR_INCLUDE - Include where error is located
Data type: SY-REPIDOptional: No
Call by Reference: No ( called with pass by value option)
O_ERROR_LINE - Line of the error position
Data type: SY-INDEXOptional: No
Call by Reference: No ( called with pass by value option)
O_ERROR_MESSAGE - Error message text
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
O_ERROR_OFFSET - Offset of the error position
Data type: SY-TABIXOptional: No
Call by Reference: No ( called with pass by value option)
O_ERROR_SUBRC - Return code of SYNTAX-CHECK
Data type: SY-SUBRCOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for EDITOR_SYNTAX_CHECK
I_SOURCE - Source to be checked, its name is I_PROGRAM
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
O_CORRECTION_TAB -
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
O_WARNINGS_TAB -
Data type: RSLINLMSGOptional: Yes
Call by Reference: No ( called with pass by value option)
O_ERROR_TAB -
Data type: RSLINLMSGOptional: Yes
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for EDITOR_SYNTAX_CHECK Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lt_i_source | TYPE STANDARD TABLE OF STRING, " | |||
| lv_i_global_check | TYPE SY-CALLD, " SPACE | |||
| lv_o_error_include | TYPE SY-REPID, " | |||
| lv_o_error_line | TYPE SY-INDEX, " | |||
| lv_i_global_program | TYPE SY-REPID, " SPACE | |||
| lt_o_correction_tab | TYPE STANDARD TABLE OF SY, " | |||
| lv_i_program | TYPE SY-REPID, " | |||
| lt_o_warnings_tab | TYPE STANDARD TABLE OF RSLINLMSG, " | |||
| lv_o_error_message | TYPE RSLINLMSG, " | |||
| lv_i_r2_check | TYPE RSLINLMSG, " ' ' | |||
| lt_o_error_tab | TYPE STANDARD TABLE OF RSLINLMSG, " | |||
| lv_o_error_offset | TYPE SY-TABIX, " | |||
| lv_o_error_subrc | TYPE SY-SUBRC, " | |||
| lv_i_r2_destination | TYPE TXCOM-SDEST, " SPACE | |||
| lv_i_trdir | TYPE TRDIR, " SPACE | |||
| lv_i_corrwarn | TYPE TRDIR, " SPACE | |||
| lv_all_errors | TYPE TRDIR. " SPACE |
|   CALL FUNCTION 'EDITOR_SYNTAX_CHECK' " |
| EXPORTING | ||
| I_GLOBAL_CHECK | = lv_i_global_check | |
| I_GLOBAL_PROGRAM | = lv_i_global_program | |
| I_PROGRAM | = lv_i_program | |
| I_R2_CHECK | = lv_i_r2_check | |
| I_R2_DESTINATION | = lv_i_r2_destination | |
| I_TRDIR | = lv_i_trdir | |
| I_CORRWARN | = lv_i_corrwarn | |
| ALL_ERRORS | = lv_all_errors | |
| IMPORTING | ||
| O_ERROR_INCLUDE | = lv_o_error_include | |
| O_ERROR_LINE | = lv_o_error_line | |
| O_ERROR_MESSAGE | = lv_o_error_message | |
| O_ERROR_OFFSET | = lv_o_error_offset | |
| O_ERROR_SUBRC | = lv_o_error_subrc | |
| TABLES | ||
| I_SOURCE | = lt_i_source | |
| O_CORRECTION_TAB | = lt_o_correction_tab | |
| O_WARNINGS_TAB | = lt_o_warnings_tab | |
| O_ERROR_TAB | = lt_o_error_tab | |
| . " EDITOR_SYNTAX_CHECK | ||
ABAP code using 7.40 inline data declarations to call FM EDITOR_SYNTAX_CHECK
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single CALLD FROM SY INTO @DATA(ld_i_global_check). | ||||
| DATA(ld_i_global_check) | = ' '. | |||
| "SELECT single REPID FROM SY INTO @DATA(ld_o_error_include). | ||||
| "SELECT single INDEX FROM SY INTO @DATA(ld_o_error_line). | ||||
| "SELECT single REPID FROM SY INTO @DATA(ld_i_global_program). | ||||
| DATA(ld_i_global_program) | = ' '. | |||
| "SELECT single REPID FROM SY INTO @DATA(ld_i_program). | ||||
| DATA(ld_i_r2_check) | = ' '. | |||
| "SELECT single TABIX FROM SY INTO @DATA(ld_o_error_offset). | ||||
| "SELECT single SUBRC FROM SY INTO @DATA(ld_o_error_subrc). | ||||
| "SELECT single SDEST FROM TXCOM INTO @DATA(ld_i_r2_destination). | ||||
| DATA(ld_i_r2_destination) | = ' '. | |||
| DATA(ld_i_trdir) | = ' '. | |||
| DATA(ld_i_corrwarn) | = ' '. | |||
| DATA(ld_all_errors) | = ' '. | |||
Search for further information about these or an SAP related objects