<?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: macro in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/macro/m-p/1364637#M180549</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Never say never. Macros can be very useful, especially if they represent say only a few lines of code which don't warrant a subroutine. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can't debug but if you are writing your own you can of course debug the code which you are going to turn into a macro. You can't use the &amp;amp;1s etc but it might help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 May 2006 05:03:27 GMT</pubDate>
    <dc:creator>former_member186741</dc:creator>
    <dc:date>2006-05-30T05:03:27Z</dc:date>
    <item>
      <title>macro</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/macro/m-p/1364633#M180545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can we debug a macro? if how and why?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2006 04:50:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/macro/m-p/1364633#M180545</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-30T04:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: macro</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/macro/m-p/1364634#M180546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think macros can be debugged.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;Note : Please mark the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2006 04:57:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/macro/m-p/1364634#M180546</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-30T04:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: macro</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/macro/m-p/1364635#M180547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;GOOD&lt;/P&gt;&lt;P&gt;Since debugging a MACRO is not really possible, prevent the use of them (I've never used them, but seen them in action). If the subroutine is used only local (called internal) use a FORM. If the subroutine is called external (used by more than one program) use a FUNCTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1-&lt;/P&gt;&lt;P&gt;A MACRO is more or less an abbreviation for some lines of code that are used more than once or twice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2-Macros can only be used in the program the are defined in and only after the definition.&lt;/P&gt;&lt;P&gt;3-Macros can take max 9 parameters.&lt;/P&gt;&lt;P&gt;4-Macros are expanded at compilation / generation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THANKS&lt;/P&gt;&lt;P&gt;MRUTYUN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2006 04:58:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/macro/m-p/1364635#M180547</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-30T04:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: macro</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/macro/m-p/1364636#M180548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u can see the macro defn but debugging not achievable!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2006 05:01:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/macro/m-p/1364636#M180548</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-30T05:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: macro</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/macro/m-p/1364637#M180549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Never say never. Macros can be very useful, especially if they represent say only a few lines of code which don't warrant a subroutine. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can't debug but if you are writing your own you can of course debug the code which you are going to turn into a macro. You can't use the &amp;amp;1s etc but it might help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2006 05:03:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/macro/m-p/1364637#M180549</guid>
      <dc:creator>former_member186741</dc:creator>
      <dc:date>2006-05-30T05:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: macro</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/macro/m-p/1364638#M180550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No. We cannot debugg a MACRO. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u feel the need for it, then change from macro to a subroutine. this can be acheived quite easily by sending the parameters to the subroutine in the same way as u r sending to the macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But remember one thing: Macro's are comparitively faster&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if helpful&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2007 18:00:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/macro/m-p/1364638#M180550</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-04T18:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: macro</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/macro/m-p/1364639#M180551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot debug a macro, because there are not actual lines in the source which execute the macro. Macro definition is copied with &amp;amp;parameter converted when pre-compilation of Abap is carried out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;DEFINE&lt;/P&gt;&lt;P&gt;DEFINE Syntax Diagram&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defines a section of source code (macro) that you can address using the name macro. Source code saved as a DEFINE macro may only consist of complete ABAP statements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All macro use is expanded fully in translation. Macros are a text substitute for the translation phase - not a modularization technique for runtime use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You conclude a macro with the END-OF-DEFINITION statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you define a macro, you can use placeholders (&amp;amp;n, where n = 1, 2, ..., 9). When the macro is expanded, &amp;amp;n is replaced with the n-th current parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose you define a macro "INCREMENT", which you then use in your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DEFINE INCREMENT. 

ADD 1 TO &amp;amp;1.
END-OF-DEFINITION.

DATA: NUMBER TYPE I VALUE 1.
...
INCREMENT NUMBER.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Notes  : As a rule, you should use subroutines (FORM,  FUNCTION) instead of macros. This is because subroutines - unlike macros - are supported by all of the ABAP Workbench tools (debugging, runtime analysis, runtime error handling, ...).&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot define a macro within a macro using the &lt;/P&gt;&lt;P&gt;DEFINE statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot use an ABAP keyword as a macro name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The validity of a macro definition is determined by its position in the source code. You can use a given macro in any line of code following its definition. There is no distinction between global and local macros. For example, the fact that a macro is defined within a subroutine has no effect on its validity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you redefine a macro, that is, assign a new meaning to an existing name, the new meaning takes effect from the position in the program where the macro was redefined.&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice on debug in bold upper lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2007 18:19:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/macro/m-p/1364639#M180551</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2007-04-04T18:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: macro</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/macro/m-p/1364640#M180552</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, 16 Jul 2008 04:30:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/macro/m-p/1364640#M180552</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-16T04:30:10Z</dc:date>
    </item>
  </channel>
</rss>

