Hi ,
Use the class CL_RECA_RS_SERVICES/Method CHECK_SYNTAX for syntax check.
OR
The below is the syntax for syntax-check. Press F1 on syntax-check to know more
SYNTAX-CHECK FOR lt_source
MESSAGE ld_error_message
LINE ld_error_line
WORD ld_error_word
PROGRAM ld_progname
DIRECTORY ENTRY ls_dir
ID 'MSG' TABLE lt_warnings.
-Thanks