2019 Sep 04 11:16 AM
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.
2019 Sep 06 2:01 PM
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.