<?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: wat is macro? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/wat-is-macro/m-p/3481908#M837093</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;to know about subroutine.&lt;/P&gt;&lt;P&gt;try this link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04s/helpdata/en/9f/db979035c111d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04s/helpdata/en/9f/db979035c111d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Mar 2008 07:33:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-05T07:33:46Z</dc:date>
    <item>
      <title>wat is macro?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wat-is-macro/m-p/3481903#M837088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi friends&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          what is the definitions of Macro, Events, Sub routines in abap and can you give some examples for the above mentioned&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Mar 2008 07:22:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wat-is-macro/m-p/3481903#M837088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-05T07:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: wat is macro?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wat-is-macro/m-p/3481904#M837089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MACROS:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to reuse the same set of statements more than once in a program, you can include them in a macro. For example, this can be useful for long calculations or complex WRITE statements. 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;&lt;/P&gt;&lt;P&gt;&lt;U&gt;The following statement block defines a macro:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DEFINE makro.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;statements&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;END-OF-DEFINITION&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You must specify complete statements between DEFINE and END&amp;amp;#8209;OF&amp;amp;#8209;DEFINITION. These statements can contain up to nine placeholders &amp;amp;1, &amp;amp;2,...., &amp;amp;9). You must define the macro before the point in the program at which you want to use it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EXAMPLE:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;DATA: RESULT TYPE I,&lt;/P&gt;&lt;P&gt;N1 TYPE I VALUE 5,&lt;/P&gt;&lt;P&gt;N2 TYPE I VALUE 6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE OPERATION.&lt;/P&gt;&lt;P&gt;RESULT = &amp;amp;1 &amp;amp;2 &amp;amp;3.&lt;/P&gt;&lt;P&gt;OUTPUT &amp;amp;1 &amp;amp;2 &amp;amp;3 RESULT.&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE OUTPUT.&lt;/P&gt;&lt;P&gt;WRITE: / 'The result of &amp;amp;1 &amp;amp;2 &amp;amp;3 is', &amp;amp;4.&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPERATION 4 + 3.&lt;/P&gt;&lt;P&gt;OPERATION 2 ** 7.&lt;/P&gt;&lt;P&gt;OPERATION N2 - N1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This produces the following output:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result of 4 + 3 is 7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result of 2 ** 7 is 128&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result of N2 - N1 is 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REGARDS,&lt;/P&gt;&lt;P&gt;KAVITHA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: kavitha koppada on Mar 5, 2008 8:26 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Mar 2008 07:25:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wat-is-macro/m-p/3481904#M837089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-05T07:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: wat is macro?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wat-is-macro/m-p/3481905#M837090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is Macro?:&lt;/P&gt;&lt;P&gt;Macro is a set of executable statement/s which can be called in a program.&lt;/P&gt;&lt;P&gt;Whenever it is called in the program its replaces the statement which is defined inside the macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE macro_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Set of statements to be executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.Note:&lt;/P&gt;&lt;P&gt;It is also possible to pass parameters to the MACRO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steps Involved&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here am declaring a macro which can accept 4 Parameter during runtime. &lt;/P&gt;&lt;P&gt;Declaring necessary data types. &lt;/P&gt;&lt;P&gt;Calling Macro in the Program. &lt;/P&gt;&lt;P&gt;Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE s.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select &amp;amp;1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from &amp;amp;2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;into table &amp;amp;3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where &amp;amp;4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: t_mara TYPE mara OCCURS 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: l_mara(4) VALUE 'MARA',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_s(6) VALUE 'SELECT',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_field(5) VALUE '*',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_table(6) VALUE 'T_MARA',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_query TYPE string VALUE 'MATNR = ''000000000000000001'''.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;fs&amp;gt; TYPE table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN t_mara TO &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;s (l_field) (l_mara) &amp;lt;fs&amp;gt; (l_query).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Mar 2008 07:26:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wat-is-macro/m-p/3481905#M837090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-05T07:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: wat is macro?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wat-is-macro/m-p/3481906#M837091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CLASSICAL EVENTS&lt;/P&gt;&lt;P&gt;Initalization&lt;/P&gt;&lt;P&gt;At selection-screen output&lt;/P&gt;&lt;P&gt;At seelction-screen on field&lt;/P&gt;&lt;P&gt;At selection-screen on block&lt;/P&gt;&lt;P&gt;At selection-screen&lt;/P&gt;&lt;P&gt;Start-of-selection&lt;/P&gt;&lt;P&gt;End-of-selection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INTERACTIVE EVENTS&lt;/P&gt;&lt;P&gt;At line-selection&lt;/P&gt;&lt;P&gt;At user-command&lt;/P&gt;&lt;P&gt;At pfnn&lt;/P&gt;&lt;P&gt;Top-of-page during line selection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LIST EVENTS&lt;/P&gt;&lt;P&gt;Top-of-page&lt;/P&gt;&lt;P&gt;End-of-page&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONTROL BREAK EVENTS&lt;/P&gt;&lt;P&gt;At first&lt;/P&gt;&lt;P&gt;At last&lt;/P&gt;&lt;P&gt;At new&lt;/P&gt;&lt;P&gt;At end of &lt;/P&gt;&lt;P&gt;On change of&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIALIZATION &lt;/P&gt;&lt;P&gt;Before the standard selection screen is displayed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN&lt;/P&gt;&lt;P&gt;After user input on a selection screen has been processed, but while the selection screen is still active &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION &lt;/P&gt;&lt;P&gt;After the standard selection screen has been processed, before data is read from the logical database&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GET node &lt;/P&gt;&lt;P&gt;After the logical database has read a data record from the node node &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GET node LATE &lt;/P&gt;&lt;P&gt;After all of the nodes of the logical database have been processed that are hierarchically subordinate to the node node in the structure of the logical database &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-SELECTION &lt;/P&gt;&lt;P&gt;After all data has been read by the logical database &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;List processor events:&lt;/P&gt;&lt;P&gt;TOP-OF-PAGE&lt;/P&gt;&lt;P&gt;In list processing when a new page starts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-PAGE&lt;/P&gt;&lt;P&gt;In list processing when a page ends&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT LINE-SELECTION&lt;/P&gt;&lt;P&gt;When the user triggers the predefined function code PICK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT PFnn&lt;/P&gt;&lt;P&gt;When the user triggers the predefined function code PFnn&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT USER-COMMAND&lt;/P&gt;&lt;P&gt;When the user triggers a function code defined in the program&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;Ramya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Mar 2008 07:29:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wat-is-macro/m-p/3481906#M837091</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-05T07:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: wat is macro?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wat-is-macro/m-p/3481907#M837092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai      &lt;STRONG&gt;&lt;EM&gt;mahesh kumar&lt;/EM&gt;&lt;/STRONG&gt; ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H4&gt;&lt;SPAN&gt;Macros &lt;/SPAN&gt;&lt;/H4&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to reuse the same set of statements more than once in a program, you can include them in a macro. For example, this can be useful for long calculations or complex WRITE statements. 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;&lt;/P&gt;&lt;P&gt;The following statement block defines a macro &amp;lt;macro&amp;gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE &amp;lt;macro&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &amp;lt;statements&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You must specify complete statements between DEFINE and END-OF-DEFINITION. These statements can contain up to nine placeholders (&amp;amp;1, &amp;amp;2, ..., &amp;amp;9). You must define the macro before the point in the program at which you want to use it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Macros do not belong to the definition part of the program. This means that the DEFINE...END-OF-DEFINITION block is not interpreted before the processing blocks in the program. At the same time, however, macros are not operational statements that are executed within a processing block at runtime. When the program is generated, macro definitions are not taken into account at the point at which they are defined. For this reason, they do not appear in the overview of the structure of ABAP programs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A macro definition inserts a form of shortcut at any point in a program and can be used at any subsequent point in the program. As the programmer, you must ensure that the macro definition occurs in the program before the macro itself is used. Particular care is required if you use both macros and include programs, since not all include programs are included in the syntax check (exception: TOP include).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To use a macro, use the following form: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;macro&amp;gt; [&amp;lt;p1&amp;gt; &amp;lt;p2&amp;gt; ... &amp;lt;p9&amp;gt;].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the program is generated, the system replaces &amp;lt;macro&amp;gt; by the defined statements and each placeholder &amp;amp;i by the parameter &amp;lt;p i &amp;gt;. You can use macros within macros. However, a macro cannot call itself. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: RESULT TYPE I,&lt;/P&gt;&lt;P&gt;N1 TYPE I VALUE 5,&lt;/P&gt;&lt;P&gt;N2 TYPE I VALUE 6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE OPERATION.&lt;/P&gt;&lt;P&gt;   RESULT = &amp;amp;1 &amp;amp;2 &amp;amp;3.&lt;/P&gt;&lt;P&gt;OUTPUT &amp;amp;1 &amp;amp;2 &amp;amp;3 RESULT.&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE OUTPUT.&lt;/P&gt;&lt;P&gt;   WRITE: / 'The result of &amp;amp;1 &amp;amp;2 &amp;amp;3 is', &amp;amp;4.&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPERATION 4 + 3.&lt;/P&gt;&lt;P&gt;OPERATION 2 ** 7.&lt;/P&gt;&lt;P&gt;OPERATION N2 - N1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The produces the following output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result of 4 + 3 is 7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result of 2 ** 7 is 128&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result of N2 - N1 is 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, two macros, OPERATION and OUTPUT, are defined. OUTPUT is nested in OPERATION. OPERATION is called three times with different parameters. Note how the placeholders &amp;amp;1, &amp;amp;2, ... are replaced in the macros.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following example shows that a macro definition only works in the program lines following its definition. Do not copy it! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose we have a program with a subroutine TEST:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROGRAM MACRO_TEST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM TEST.&lt;/P&gt;&lt;P&gt;  WRITE '...'.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose we then changed the program to the following: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROGRAM MACRO_TEST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM TEST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE MACRO.&lt;/P&gt;&lt;P&gt;    WRITE '...'.&lt;/P&gt;&lt;P&gt;  ENDFORM.&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MACRO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inserting the macro changes nothing in the generated form of the program. Processing blocks - here a subroutine - are always indivisible. We could also write the program as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROGRAM MACRO_TEST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEFINE MACRO.&lt;/P&gt;&lt;P&gt;    WRITE '...'.&lt;/P&gt;&lt;P&gt;  ENDFORM.&lt;/P&gt;&lt;P&gt;END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM TEST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MACRO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The most essential feature of a macro definition is that it should occur before the macro is used. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;H5&gt;&lt;SPAN&gt;Subroutines &lt;/SPAN&gt;&lt;/H5&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Subroutines are procedures that you can define in any ABAP program and also call from any program. Subroutines are normally called internally, that is, they contain sections of code or algorithms that are used frequently locally. If you want a function to be reusable throughout the system, use a function module. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM &amp;lt;subr&amp;gt; [USING   ... [VALUE(]&amp;lt;pi&amp;gt;[)] [TYPE &amp;lt;t&amp;gt;|LIKE &amp;lt;f&amp;gt;]... ] &lt;/P&gt;&lt;P&gt;            [CHANGING... [VALUE(]&amp;lt;pi&amp;gt;[)] [TYPE &amp;lt;t&amp;gt;|LIKE &amp;lt;f&amp;gt;]... ].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;You call subroutines using the statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM... [USING   ... &amp;lt;pi&amp;gt;... ] &lt;/P&gt;&lt;P&gt;                       [CHANGING... &amp;lt;pi&amp;gt;... ].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Subroutines can call other subroutines (nested calls) and may also call themselves (recursive calls). Once a subroutine has finished running, the calling program carries on processing after the PERFORM statement. You can use the USING and CHANGING additions to supply values to the parameter interface of the subroutine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;subr&amp;gt; is the name of the subroutine. The optional additions USING and CHANGING define the parameter interface. Like any other processing block, subroutines cannot be nested. You should therefore place your subroutine definitions at the end of the program, especially for executable programs (type 1). In this way, you eliminate the risk of accidentally ending an event block in the wrong place by inserting a FORM...ENDFORM block.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Mar 2008 07:31:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wat-is-macro/m-p/3481907#M837092</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-05T07:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: wat is macro?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/wat-is-macro/m-p/3481908#M837093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;to know about subroutine.&lt;/P&gt;&lt;P&gt;try this link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04s/helpdata/en/9f/db979035c111d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04s/helpdata/en/9f/db979035c111d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Mar 2008 07:33:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/wat-is-macro/m-p/3481908#M837093</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-05T07:33:46Z</dc:date>
    </item>
  </channel>
</rss>

