<?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: preprocessor directives in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/preprocessor-directives/m-p/12473976#M2001243</link>
    <description>&lt;P&gt;Nevermind: finding an answer is all about picking the right keywords.&lt;/P&gt;&lt;P&gt;This has been &lt;A href="https://answers.sap.com/questions/1861303/conditional-compiling-in-abap.html" target="_blank"&gt;discussed before&lt;/A&gt; and, no, sadly it can't be done.&lt;/P&gt;</description>
    <pubDate>Sun, 13 Jun 2021 08:41:14 GMT</pubDate>
    <dc:creator>abo</dc:creator>
    <dc:date>2021-06-13T08:41:14Z</dc:date>
    <item>
      <title>preprocessor directives</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/preprocessor-directives/m-p/12473975#M2001242</link>
      <description>&lt;P&gt;On older systems the following statement&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;cl_salv_table=&amp;gt;factory(  
  IMPORTING r_salv_table = DATA(lo_table)  
  CHANGING  t_table  = &amp;lt;fs_data&amp;gt; ).&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;must be rewritten as follows:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;DATA: lo_table TYPE REF TO cl_salv_table.
cl_salv_table=&amp;gt;factory(  
  IMPORTING r_salv_table = lo_table  
  CHANGING  t_table  = &amp;lt;fs_data&amp;gt; ).
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Is there a pragma or some other sort of compiler directive that would enable me to write a single version of the code?&lt;/P&gt;
  &lt;P&gt;Something like this:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;#ifdef BASIS740
cl_salv_table=&amp;gt;factory(  
  IMPORTING r_salv_table = DATA(lo_table)  
  CHANGING  t_table  = &amp;lt;fs_data&amp;gt; ).
#else
DATA: lo_table TYPE REF TO cl_salv_table.
cl_salv_table=&amp;gt;factory(  
  IMPORTING r_salv_table = lo_table  
  CHANGING  t_table  = &amp;lt;fs_data&amp;gt; ).
#endif&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;At the moment I have to workaround it by having the unused version commented out, although technically this means the two source codes are different. I used inline declarations in this question but there are other language elements which are version-dependent.&lt;/P&gt;
  &lt;P&gt;I couldn't find anythin either in ABAPDOCU or in the forum.&lt;/P&gt;
  &lt;P&gt;Comments it is, then?&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jun 2021 08:23:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/preprocessor-directives/m-p/12473975#M2001242</guid>
      <dc:creator>abo</dc:creator>
      <dc:date>2021-06-13T08:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: preprocessor directives</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/preprocessor-directives/m-p/12473976#M2001243</link>
      <description>&lt;P&gt;Nevermind: finding an answer is all about picking the right keywords.&lt;/P&gt;&lt;P&gt;This has been &lt;A href="https://answers.sap.com/questions/1861303/conditional-compiling-in-abap.html" target="_blank"&gt;discussed before&lt;/A&gt; and, no, sadly it can't be done.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jun 2021 08:41:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/preprocessor-directives/m-p/12473976#M2001243</guid>
      <dc:creator>abo</dc:creator>
      <dc:date>2021-06-13T08:41:14Z</dc:date>
    </item>
  </channel>
</rss>

