<?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: Diff between MACRO and Include programs in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-macro-and-include-programs/m-p/2257155#M488847</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Macros and Includes serves the same purpose. However you can use a Macro local to that program where as Include can be used globally.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 12 May 2007 17:40:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-12T17:40:16Z</dc:date>
    <item>
      <title>Diff between MACRO and Include programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-macro-and-include-programs/m-p/2257152#M488844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is the Diff between MACRO and Include programs ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 May 2007 14:37:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-macro-and-include-programs/m-p/2257152#M488844</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-12T14:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Diff between MACRO and Include programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-macro-and-include-programs/m-p/2257153#M488845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A macro is not a program, but a kind of "subroutine" (similar to FORMs), here's an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* Macro Definition-------------------------------------------------*
* Application server File opening and reading.

DEFINE READ_DATASET_INPUT.
  OPEN DATASET &amp;amp;1 FOR INPUT IN TEXT MODE.
  IF SY-SUBRC NE 0.
    PERFORM ERROR USING &amp;amp;3 SY-DATUM 'E' 'ZERRS' '101' &amp;amp;1
			SPACE SPACE SPACE SPACE SPACE SPACE.
  ELSE.
    DO.
      READ DATASET &amp;amp;1  INTO  &amp;amp;2.
      IF SY-SUBRC NE 0.
        EXIT.
      ELSE.
        APPEND &amp;amp;2.
        CLEAR &amp;amp;2.
      ENDIF.
    ENDDO.
  ENDIF.
  CLOSE DATASET &amp;amp;1.
END-OF-DEFINITION.

* You call it like this on the program:

READ_DATASET_INPUT P_FILE T_MAIN G_PROGRAM.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From help: "You can only use a macro within the program in which it is defined, and it can only be called in lines of the program following its definition."&lt;/P&gt;&lt;P&gt;For modularization purposes, it's preferable to use Forms of Function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db972835c111d1829f0000e829fbfe/content.htm"&amp;gt;More on Macros&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An INCLUDE program is a non-executable program which generally has something complementary to the main program (for example type/data declarations or Form subroutines).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db973535c111d1829f0000e829fbfe/content.htm"&amp;gt;More on INCLUDE&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please award points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 May 2007 15:11:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-macro-and-include-programs/m-p/2257153#M488845</guid>
      <dc:creator>alejandro_bindi</dc:creator>
      <dc:date>2007-05-12T15:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Diff between MACRO and Include programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-macro-and-include-programs/m-p/2257154#M488846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check out this thread&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3042306"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 May 2007 15:42:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-macro-and-include-programs/m-p/2257154#M488846</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-12T15:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Diff between MACRO and Include programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-macro-and-include-programs/m-p/2257155#M488847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Macros and Includes serves the same purpose. However you can use a Macro local to that program where as Include can be used globally.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 May 2007 17:40:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-macro-and-include-programs/m-p/2257155#M488847</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-12T17:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Diff between MACRO and Include programs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-macro-and-include-programs/m-p/2257156#M488848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi raj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a macro is evaluated during compile time. The generated code can not be debugged. Just do not use macros. They make programs less transparent and difficult to understand in debug mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 May 2007 20:46:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-macro-and-include-programs/m-p/2257156#M488848</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-05-12T20:46:51Z</dc:date>
    </item>
  </channel>
</rss>

