Skip to Content
author's profile photo Former Member
Former Member

Method or Function Module for Syntax Checks

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Oct 19, 2015 at 09:58 AM

    Open the abap editor. Type SYNTAX. Place your cursor within the word. Press F1.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2015 at 09:25 AM

    ...and the purpose of this would be?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 19, 2015 at 10: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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.