<?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: need help to understand this code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-to-understand-this-code/m-p/3467839#M833549</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
  IF NOT pernr IS INITIAL.
    create_ranges r_pernr pernr.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the field pernr is not empty it calls the DEFINEd macro CREATE_RANGES passing the range R_PERNR and the value to add to it, PERNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The range would then be used in other statements like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  SELECT * INTO IT_PERSONS FROM PA001
     WHERE PERNR in R_PERNR.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Mar 2008 16:33:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-10T16:33:49Z</dc:date>
    <item>
      <title>need help to understand this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-to-understand-this-code/m-p/3467837#M833547</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;how this code is working?&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;RANGES: r_pernr FOR pa0000-pernr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DEFINE create_ranges.
  &amp;amp;1-sign = 'I' .
  &amp;amp;1-option = 'EQ' .
  &amp;amp;1-low = &amp;amp;2.
  append &amp;amp;1 .

  IF pernr IS NOT INITIAL.
    create_ranges r_pernr pernr.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 16:19:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-to-understand-this-code/m-p/3467837#M833547</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-10T16:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: need help to understand this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-to-understand-this-code/m-p/3467838#M833548</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;If pernr is initial in the selection screen, then it will create a range and will be used in the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sriram Ponna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 16:27:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-to-understand-this-code/m-p/3467838#M833548</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-10T16:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: need help to understand this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-to-understand-this-code/m-p/3467839#M833549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
  IF NOT pernr IS INITIAL.
    create_ranges r_pernr pernr.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the field pernr is not empty it calls the DEFINEd macro CREATE_RANGES passing the range R_PERNR and the value to add to it, PERNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The range would then be used in other statements like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  SELECT * INTO IT_PERSONS FROM PA001
     WHERE PERNR in R_PERNR.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 16:33:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-to-understand-this-code/m-p/3467839#M833549</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-10T16:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: need help to understand this code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-to-understand-this-code/m-p/3467840#M833550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
DEFINE create_ranges.
  &amp;amp;1-sign = 'I' .
  &amp;amp;1-option = 'EQ' .
  &amp;amp;1-low = &amp;amp;2.
  append &amp;amp;1 .
ENDDEFINE.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The above piece of defines a macro named "create_ranges". As you know, macro acts nothing like a subroutine whereas &amp;amp;1 and &amp;amp;2 are formal parameters passed while calling the macro. &amp;amp;1 is the first parameter passed and &amp;amp;2 is the second parameter passed while calling the macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF pernr IS NOT INITIAL.
  create_ranges r_pernr pernr.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The above code calls the "create_ranges" macro with the parameters r_pernr (&amp;amp;1) and pernr (&amp;amp;2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DEFINE &amp;lt;marco-name&amp;gt;

 &amp;lt;&amp;lt;Set of statements&amp;gt;&amp;gt;

ENDDEFINE.

"The above DEFINE... statement defines a macro named &amp;lt;marco-name&amp;gt;.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Balaji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2008 16:36:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-to-understand-this-code/m-p/3467840#M833550</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-10T16:36:32Z</dc:date>
    </item>
  </channel>
</rss>

