Skip to Content
1
Former Member
Dec 20, 2006 at 11:06 AM

conditional compiling in abap

175 Views

Is it possible, to use "compiler directives" in ABAP (as known in other programming languages), especially "conditional compiling".

I would like this technique, for a conditional compiling in following situation:

DDIC-TABLE M_VMVD ist available up to R/3-Release 4.6C

Since Release 4.70 this table is replaced by SHP_VIEW_EXVE.

If possible, i want to write <u>one</u> coding for both releases.

It is not sufficient to use a "normal" if - command, because syntax-check will detect an error (table xy is not known).

Here a - fictional - example, what i think about:

*# IF_COMPILER_RELEASE <  470.  (fictional Compiler-Directive)
select single vbeln into my_vbeln from m_vmvmd where lifex = my_lifex.
*# ELSE_COMPILER_DIRECTIVE (fictional)
select single vbeln into my_vbeln from shp_view_exve where lifex = my_lifex.
*# ENDIF_COMPILER_DIRECTIVE  (fictional)

I know, that there was a conditional-compiling-technique for differing R/2 and R/3.

It was something like that:

*#R2    write: / 'Compiled with R/2'.
*#R3   write: / 'Compiled with R/3'.

Best Regards

Juergen