Application Development and Automation 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: 
Read only

syntax check of code

Former Member
0 Likes
914

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
737

Do not post Duplicate Threads!!!

Against Forum rules.

regards,

neha

hi

there are various ways of doing that

1. Static compilation - for syntax errors check.

2. Extended program check (transaction SLIN) - to analyze the errors, warnings and potential sources of runtime errors and others severe problems that may exist in your code.

3. Code Inspector (transaction SCI) - to perform more sophisticated static checks.

4. ABAP Unit testing - to ensure all modularization units of your program are actually doing what they are supposed to do.

5. Integration tests with eCATT, the extented Computer Aided Test Tool (transaction SECATT) - to verify that the modularization units and application screens work together correctly in a complex application scenario.

6. Coverage analysis (transaction SCOV) - to verify that all relevant parts of your program have been executed and tested before you release it for use in your production system.

hope this helps

regards

Aakash Banga

4 REPLIES 4
Read only

Former Member
0 Likes
737

it may not be logical to check syntax before fixing the first err.

Read only

Former Member
0 Likes
738

Do not post Duplicate Threads!!!

Against Forum rules.

regards,

neha

Read only

MarcinPciak
Active Contributor
0 Likes
737

Hi,

This is similar to what ABAP Editor sytax check does. You cannot check sytax of the "futher" code as the "closer" code may affect the "further". Unless you correct the first error you cannot therefore check if futher lines are correct. If this worked like you want it would have to correct "closer" errors first by itself, then it could check rest of the code. But how the compilator (generall meaning) would have to know what to place there. This is of course impossible. There is no such compliator doing so in none of known to me programming languages.

You may skip this by a trick. Looping at the table with a code and checking each line of this with a check syntax. Then collect all these errors within an error table.

Nevetherless be carefull !! You would have to place excatly one statement per line in code table. Otherwise it won't pass the exam. Moreover you cannot use any of chain statements i.e.


write: 'first line',
        'second line'.

...should be replaced with


write 'first line'.
write 'second line'.

Hope this give you some idea:)

Regards

Marcin

Read only

Former Member
0 Likes
737

hi

there are various ways of doing that

1. Static compilation - for syntax errors check.

2. Extended program check (transaction SLIN) - to analyze the errors, warnings and potential sources of runtime errors and others severe problems that may exist in your code.

3. Code Inspector (transaction SCI) - to perform more sophisticated static checks.

4. ABAP Unit testing - to ensure all modularization units of your program are actually doing what they are supposed to do.

5. Integration tests with eCATT, the extented Computer Aided Test Tool (transaction SECATT) - to verify that the modularization units and application screens work together correctly in a complex application scenario.

6. Coverage analysis (transaction SCOV) - to verify that all relevant parts of your program have been executed and tested before you release it for use in your production system.

hope this helps

regards

Aakash Banga