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: 

Exclude ABAP code from a syntax check like #R2 #R3 for S/4

martin_eckhardt
Explorer
0 Kudos
465

We have ABAP programs that have to run on different SAP Netweaver versions (6.40 - 7.53).

Now, however, as of Netweaver Version 7.50, certain old program commands are no longer accepted and are acknowledged with a syntax error.

Is it possible to exclude certain lines of code from 7.50 and higher for a syntax check with some mechanism, as was previously possible with R3 and R2 with the commands #R2 and #R3?

Thanks in advance.

1 REPLY 1

iftah_peretz
Active Contributor
0 Kudos
198

Hey Martin,

In short, to the best of my knowledge, the answer is No.

You can see a similar discussion here - and your case is regarding an error and not a warning - meaning a far more extreme case.

There are many work arounds, but they depend on the program logic and purpose.

A general suggestion I can give, is to write an ABAP program (along the lines of the example here) that goes over the old programs you are having issues with and duplicates (or keeps) all the "good" lines (that meet the env. syntax) and replaces "bad" ones with accepted ones.

For example (taken from here) you should have one of the replacement rules from "bad" into "good" lines, like so:

"Bad lines
TYPES: t1, 
       t2 TYPE p.
"Good lines
TYPES: t1 TYPE c LENGTH 1, 
       t2 TYPE p LENGTH 8 DECIMALS 0.