‎2015 Oct 19 9:15 AM
Hi Abapers,
I am trying to find the FM or Class which can return me with all the syntax errors present in that object.(Object can be a FUnction Group,Report,Class,Function Module). Is there any Function Module which can return back all the errors present in the object. I tried with RS_SYNTAX_CHECK, but it didn't worked. It is not returning all the errors present.
Thanks in advance.
‎2015 Oct 19 10:25 AM
‎2015 Oct 19 10:58 AM
Open the abap editor. Type SYNTAX. Place your cursor within the word. Press F1.
‎2015 Oct 19 11:17 PM
As it was mentioned in the previous answer, you can use a special ABAP statement - SYNTAX-CHECK FOR ...
If you don't want to code error handling by yourself, you can consider using method CL_ABAP_ERROR_ANALYZE=>GET_MINIMAL_INCLUDE_SET.
You can pass the name of the program (e.g. the report, the main program of function group, etc) and this method will return all the errors your program contains. There is an example in the report RS_ABAP_ERROR_ANALYZE.
Please note that this method always checks the active version of the program. Internally it calls READ REPORT statement without a STATE clause. Hence, only active state is taken into account. If you want to check an inactive version, you should write your own code and use in it READ REPORT ... STATE 'I' and SYNTAX-CHECK statements. The rest you can copy from the implementation of CL_ABAP_ERROR_ANALYZE. It that case you should be aware of that STATE addition is internal. And there are some limitations. You should refer to the documentation.