<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: conditional compiling in abap in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-compiling-in-abap/m-p/1802864#M344637</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi jurgen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. compiler directives are not supported in abap r/3,&lt;/P&gt;&lt;P&gt;  in the way, they are used in c and c++.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. However,&lt;/P&gt;&lt;P&gt;3. For your requirement, we can use&lt;/P&gt;&lt;P&gt;    select with dynamic table name,&lt;/P&gt;&lt;P&gt;   and an if condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. To get a taste of it, just copy paste.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; REPORT abc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-------------" /&gt;&lt;P&gt; data : bukrs like t001-bukrs.&lt;/P&gt;&lt;P&gt; data : tabname(30) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; tabname = 'T001'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------" /&gt;&lt;P&gt; CONDITIONAL , NORMAL IF&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IF REL &amp;lt; 470.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; tabname = 'XYZT001'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select single bukrs&lt;/P&gt;&lt;P&gt; from (tabname)&lt;/P&gt;&lt;P&gt; into bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; BUKRS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Dec 2006 14:31:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-20T14:31:38Z</dc:date>
    <item>
      <title>conditional compiling in abap</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-compiling-in-abap/m-p/1802861#M344634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible, to use "compiler directives" in ABAP (as known in other programming languages), especially "conditional compiling".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like this technique, for a conditional compiling in following situation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DDIC-TABLE M_VMVD ist available up to R/3-Release 4.6C&lt;/P&gt;&lt;P&gt;Since Release 4.70 this table is replaced by SHP_VIEW_EXVE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If possible, i want to write &amp;lt;u&amp;gt;one&amp;lt;/u&amp;gt; coding for both releases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not sufficient to use a "normal" if - command, because syntax-check will detect an error (table xy is not known).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here a - fictional - example, what i think about:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*# IF_COMPILER_RELEASE &amp;lt;  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)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know, that there was a conditional-compiling-technique for differing R/2 and R/3.&lt;/P&gt;&lt;P&gt;It was something like that:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*#R2    write: / 'Compiled with R/2'.
*#R3   write: / 'Compiled with R/3'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Juergen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Dec 2006 11:06:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-compiling-in-abap/m-p/1802861#M344634</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-20T11:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: conditional compiling in abap</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-compiling-in-abap/m-p/1802862#M344635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I dont thisnk there is anything like traditional conditional compiling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could, however, do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: tablename(20) type c.
data: my_vbeln type vbeln.

if sy-saprl = '470'.
  move 'M_MVMD' to tablename.
else.
  move 'SHP_VIEW_EXVE' to tablename.
endif.

select single vbeln into my_vbeln from (tablename)
  where lifex = my_lifex.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(this was all keyed from memory, so you may have to tweak it a bit, but i did try it and it works)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Dec 2006 13:23:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-compiling-in-abap/m-p/1802862#M344635</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-20T13:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: conditional compiling in abap</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-compiling-in-abap/m-p/1802863#M344636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Having worked within SAP, since I had to adapt my coding for every release, &lt;/P&gt;&lt;P&gt;I am sure there was no such possibility. That was a little more than one year ago,&lt;/P&gt;&lt;P&gt;though...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Dec 2006 14:09:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-compiling-in-abap/m-p/1802863#M344636</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-20T14:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: conditional compiling in abap</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-compiling-in-abap/m-p/1802864#M344637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi jurgen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. compiler directives are not supported in abap r/3,&lt;/P&gt;&lt;P&gt;  in the way, they are used in c and c++.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. However,&lt;/P&gt;&lt;P&gt;3. For your requirement, we can use&lt;/P&gt;&lt;P&gt;    select with dynamic table name,&lt;/P&gt;&lt;P&gt;   and an if condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. To get a taste of it, just copy paste.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; REPORT abc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-------------" /&gt;&lt;P&gt; data : bukrs like t001-bukrs.&lt;/P&gt;&lt;P&gt; data : tabname(30) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; tabname = 'T001'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------" /&gt;&lt;P&gt; CONDITIONAL , NORMAL IF&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IF REL &amp;lt; 470.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; tabname = 'XYZT001'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select single bukrs&lt;/P&gt;&lt;P&gt; from (tabname)&lt;/P&gt;&lt;P&gt; into bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; BUKRS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Dec 2006 14:31:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-compiling-in-abap/m-p/1802864#M344637</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-20T14:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: conditional compiling in abap</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-compiling-in-abap/m-p/1802865#M344638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Dec 2006 16:32:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conditional-compiling-in-abap/m-p/1802865#M344638</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-20T16:32:02Z</dc:date>
    </item>
  </channel>
</rss>

