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

How to programatically syntax check development objects

Former Member
0 Likes
3,036

Hello,

We are going through a test upgrade project (4.6C to 4.7) and need to identify all custom objects that have syntax errors. I was able to find some FMs that do syntax check for executable programs (EDITOR_SYNTAX_CHECK, CHECK_SOURCE, etc) but was not able to find any FM/Program that can syntax check different kind of development objects like tables, FMs, Includes, programs, etc. It seems that different objects use different syntax check programs. I am basically getting a list of custom objects from tadir and then want to submit this object to a FM that can tell me if the object is syntactically OK.

Any help is much appreciated.

8 REPLIES 8
Read only

Former Member
0 Likes
1,920

HI Shamin,

You can try to generate a report with the istruction

GENERATE REPORT <prog>.

You can put this in a loop with the name of customer programs take from tadir. <prog> is a simple char array.

I think that if there is some syntax error the program will not compile and this instruction returns a sy-subrc <> 0.

Realy I never do that, but.. you can try.

Bye

Enzo

Read only

Former Member
0 Likes
1,920

Hi,

There are some standard report programs that can be used to check the syntax of a particular object. You can make use of the function SAPLS_CODE_INSPECTOR to check the syntax.

Rgds,

Read only

Former Member
0 Likes
1,920

Hello Shamim,

Can you try out something like this ? -

1. Select Z objects from TADIR

2. loop at the internal table with the objects you want to check.

3.

CASE OBJTECT_TYPE.
  WHEN DDIC ELEMENTS.
    CALL FUNCTION RS_DD_CHECK.
  WHEN TRANSACTION CODES.
    CALL FUNCTION RS_TRANSACTION_CHECK.
  ETC.,
ENDCASE.

Have a look at the FMs RS_*_CHECK. Get back if you need further assistance.

Reagards,

Anand Mandalika.

Read only

0 Likes
1,920

By the way, I was just wondering if it wouldn't suffice if we checked whether the object is active or not. Because, if it has got any syntax errors, then the developer would have corrected them, right ?

Or are there instances where the programs have been activated in spite of the syntax errors?

Regards,

Anand Mandalika.

Read only

Former Member
0 Likes
1,920

Hello All,

Thanks for the quick and helpful responses.

I will check out all suggestions and will let you know how it went.

Anand, all programs are active after the upgrade run even though they could have syntax errors and thus an active status does not help.

Thanks again.

Shamim

Read only

Former Member
0 Likes
1,920

SAP provides transaction UCCHECK to scan custom objects and list unicode syntax errors.

To get some more information on unicode, you can search sdn for the document "How to Make Your ABAP Code Unicode-Enabled.pdf".

Hope that helps.

Read only

Former Member
0 Likes
1,920

Hello All,

With the tips I got from you I was able to identify a transaction called SCI - Code Inspector that does everything that I was wanting to do.

You need to specify an object set that you want to inspect (e.g.: Z programs, Z function groups, etc) along with the type of inspection (syntax check, object generation, etc) you want to perform via a variant and then create an inspection referring to the object set and variant and that's it. The result gives a complete list of objects based on the type of inspection you wanted performed. Another useful thing that I found was an ABAP statement called syntax-check that you can use to check executable programs and function groups without calling any FMs. It is limited in the type of objects it can check but works great for executable programs.

Keep up the great work and thanks again to all of you that responded.

A special thanks to Sailatha for the code inspection program tip.

Best regards,

Shamim

Read only

Former Member
0 Likes
1,920

Hi All,

Good morning,

My requirement is to list all custom objects and specify which objects are not following the development standards and also should specify the changes that need to be made to the existing objects.

Can anyone guide me please how to build such functionality with functinal modules. I'll very grateful for ur help.

Thanks in advance,

Shankar