Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Syntax-check of code

Former Member
0 Kudos
82

I am passing certain code in table itab and then doing a syntax check using SYNTAX-CHECK FOR itab MESSAGE mess LINE lin WORD wrd .The problem with this method is it check the code line by line and assign mess with the first error msg but I want to trap all the error message of the code in itab at once in another table.

Is it possible to trap all the error msg at once in a internal table.

3 REPLIES 3

Former Member
0 Kudos
39

hi

Your file w_physical_file will contain all your error messages, but it won't be enough to correct errors in your input file. For each record in w_physical_file, you need some sort of indicator to tell which record is in error.

hope this helps

regards

Aakash Banga

0 Kudos
39

No, I dont have to correct it I just want to trap all the error messages.Where would I get access to this file w_physical_file...

Former Member
0 Kudos
39

You can use the bellow fm. But you will get the message like in ABAP editor. It may be useful for you...

data : isource(255) occurs 0 with header line,
       icorrect(255) occurs 0 with header line,
       iwarning like RSLINLMSG occurs 0 with header line,
       ierror like RSLINLMSG occurs 0 with header line.

read report 'Your prog name in CAPS' into isource.



CALL FUNCTION 'EDITOR_SYNTAX_CHECK'
  EXPORTING
*   I_GLOBAL_CHECK         = ' '
*   I_GLOBAL_PROGRAM       = ' '
    i_program              = 'Your prog name in CAPS'
*   I_R2_CHECK             = ' '
*   I_R2_DESTINATION       = ' '
*   I_TRDIR                = ' '
*   I_CORRWARN             = ' '
   ALL_ERRORS             = 'X'
* IMPORTING
*   O_ERROR_INCLUDE        =
*   O_ERROR_LINE           =
*   O_ERROR_MESSAGE        =
*   O_ERROR_OFFSET         =
*   O_ERROR_SUBRC          =
  tables
    i_source               = isource
   O_CORRECTION_TAB       = icorrect
   O_WARNINGS_TAB         = iwarning
   O_ERROR_TAB            = ierror
          .

regards

Shiba Prasad Dutta