<?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: perform stm in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/perform-stm/m-p/2394786#M532843</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;check this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: num1 TYPE i,&lt;/P&gt;&lt;P&gt;      num2 TYPE i,&lt;/P&gt;&lt;P&gt;      res  TYPE p DECIMALS 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num1 = 3. num2 = 4.&lt;/P&gt;&lt;P&gt;PERFORM divide USING num1 num2 CHANGING res.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num1 = 5. num2 = 0.&lt;/P&gt;&lt;P&gt;PERFORM divide USING num1 num2 CHANGING res.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num1 = 2. num2 = 3.&lt;/P&gt;&lt;P&gt;PERFORM divide USING num1 num2 CHANGING res.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM divide USING    n1 TYPE any&lt;/P&gt;&lt;P&gt;                     n2 TYPE any&lt;/P&gt;&lt;P&gt;            CHANGING r  TYPE any.&lt;/P&gt;&lt;P&gt;  CHECK n2 NE 0.&lt;/P&gt;&lt;P&gt;  r = n1 / n2.&lt;/P&gt;&lt;P&gt;  WRITE: / n1, '/', n2, '=', r.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Patil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Jun 2007 06:00:10 GMT</pubDate>
    <dc:creator>santhosh_patil</dc:creator>
    <dc:date>2007-06-11T06:00:10Z</dc:date>
    <item>
      <title>perform stm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/perform-stm/m-p/2394784#M532841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;plz send me one example abt perform stm.&lt;/P&gt;&lt;P&gt;and plz explain me abt using,&lt;/P&gt;&lt;P&gt;                                  changing,&lt;/P&gt;&lt;P&gt;                                   value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 05:56:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/perform-stm/m-p/2394784#M532841</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T05:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: perform stm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/perform-stm/m-p/2394785#M532842</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;PERFORM &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variants: &lt;/P&gt;&lt;P&gt;1. PERFORM form. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. PERFORM form IN PROGRAM prog. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. PERFORM n OF form1 form2 form3 ... . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. PERFORM form ON COMMIT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. PERFORM form ON ROLLBACK. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. PERFORM form(prog). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 1 &lt;/P&gt;&lt;P&gt;PERFORM form. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Extras: &lt;/P&gt;&lt;P&gt;1. ... TABLES   itab1 itab2 ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. ... USING    u1 u2 u3 ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. ... CHANGING c1 c2 c3 ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Calls the subroutine form defined usng a FORM statement. After the subroutine has finished, processing continues after the PERFORM statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;The order and number of parameters after TABLES, USING, and CHANGING depends strictly on the definition of the subroutine interface in the FORM statement (position parameter). If you use the TABLES addition with FORM, you must also use it at the start with PERFORM and specify the correct number of table-like actual parameters after. With PERFORM the additions USING and CHANGING are synonymous. You can specify both additions or only one. It is only essential that the number, order, and type of the specified actual parameters correspond to the formal parameters. However, for reasons of protocol you should use the additions as with the definition of the subroutine in FORM. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;PERFORM HELP_ME. &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;FORM HELP_ME. &lt;/P&gt;&lt;P&gt;  ... &lt;/P&gt;&lt;P&gt;ENDFORM. &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 PERFORM statement calls the subroutine HELP_ME. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 1 &lt;/P&gt;&lt;P&gt;... TABLES itab1 itab2 ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;You must use TABLES to transfer internal tables to subroutines whose interface definitions have a TABLES addition in the FORM statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF ITAB_TYPE, &lt;/P&gt;&lt;P&gt;         TEXT(50), &lt;/P&gt;&lt;P&gt;         NUMBER TYPE I, &lt;/P&gt;&lt;P&gt;       END OF ITAB_TYPE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:  ITAB TYPE STANDARD TABLE OF ITAB_TYPE WITH &lt;/P&gt;&lt;P&gt;                 NON-UNIQUE DEFAULT KEY INITIAL SIZE 100, &lt;/P&gt;&lt;P&gt;       BEGIN OF ITAB_LINE, &lt;/P&gt;&lt;P&gt;         TEXT(50), &lt;/P&gt;&lt;P&gt;         NUMBER TYPE I, &lt;/P&gt;&lt;P&gt;       END OF ITAB_LINE, &lt;/P&gt;&lt;P&gt;       STRUC like T005T. &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;PERFORM DISPLAY TABLES ITAB &lt;/P&gt;&lt;P&gt;                USING  STRUC. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM DISPLAY TABLES PAR_ITAB STRUCTURE ITAB_LINE &lt;/P&gt;&lt;P&gt;             USING  PAR      like      T005T. &lt;/P&gt;&lt;P&gt;  DATA: LOC_COMPARE LIKE PAR_ITAB-TEXT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WRITE: / PAR-LAND1, PAR-LANDX. &lt;/P&gt;&lt;P&gt;  ... &lt;/P&gt;&lt;P&gt;  LOOP AT PAR_ITAB WHERE TEXT = LOC_COMPARE. &lt;/P&gt;&lt;P&gt;    ... &lt;/P&gt;&lt;P&gt;  ENDLOOP. &lt;/P&gt;&lt;P&gt;ENDFORM. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within the DISPLAY subroutine, you can use all available table operations on the transferred internal tables. For TABLES parameters the system automatically creates a header, which may be filled with the contents of the actual parameter header. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 2 &lt;/P&gt;&lt;P&gt;... USING    u1 u2 u3 ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 3 &lt;/P&gt;&lt;P&gt;... CHANGING c1 c2 c3 ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;These additions must be followed by type-related actual parameters for all USING and CHANGING parameters of the called subroutine. The two additions are equivalent. Only the order of the parameters is important. The first USING or CHANGING parameter of the PERFORM call is transferred to the first USING or CHANGING parameter of the subroutine, the second to the second, and so on. For documentation reasons you should, when calling, use the same addition as with the subroutine 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;&lt;/P&gt;&lt;P&gt;You can specify offset and length of a parameter as variables. If you use the addition ' ...USING p1+off(*)', the parameter p1 will be passed with the offset off, but the length will not exceed the total length of the field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;DATA: NUMBER_I TYPE I VALUE 5, &lt;/P&gt;&lt;P&gt;      NUMBER_P TYPE P VALUE 4, &lt;/P&gt;&lt;P&gt;      BEGIN OF PERSON, &lt;/P&gt;&lt;P&gt;        NAME(10)      VALUE 'Paul', &lt;/P&gt;&lt;P&gt;        AGE TYPE I    VALUE 28, &lt;/P&gt;&lt;P&gt;      END   OF PERSON, &lt;/P&gt;&lt;P&gt;      ALPHA(10)       VALUE 'abcdefghij'. &lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS TYPE ANY. &lt;/P&gt;&lt;P&gt;ASSIGN NUMBER_P TO . &lt;/P&gt;&lt;P&gt;PERFORM CHANGE USING 1 &lt;/P&gt;&lt;P&gt;                     NUMBER_I &lt;/P&gt;&lt;P&gt;                     NUMBER_P &lt;/P&gt;&lt;P&gt;                     &lt;/P&gt;&lt;P&gt;                     PERSON &lt;/P&gt;&lt;P&gt;                     ALPHA+NUMBER_I(). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM CHANGE USING VALUE(PAR_1) &lt;/P&gt;&lt;P&gt;                  PAR_NUMBER_I &lt;/P&gt;&lt;P&gt;                  PAR_NUMBER_P &lt;/P&gt;&lt;P&gt;                  PAR_POINTER &lt;/P&gt;&lt;P&gt;                  PAR_PERSON STRUCTURE PERSON &lt;/P&gt;&lt;P&gt;                  PAR_PART_OF_ALPHA. &lt;/P&gt;&lt;P&gt;  ADD PAR_1 TO PAR_NUMBER_I. &lt;/P&gt;&lt;P&gt;  PAR_NUMBER_P = 0. &lt;/P&gt;&lt;P&gt;  PAR_PERSON-NAME+4(1) = ALPHA. &lt;/P&gt;&lt;P&gt;  PAR_PERSON-AGE = NUMBER_P + 25. &lt;/P&gt;&lt;P&gt;  ADD NUMBER_I TO PAR_POINTER. &lt;/P&gt;&lt;P&gt;  PAR_PART_OF_ALPHA = SPACE. &lt;/P&gt;&lt;P&gt;ENDFORM. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field contents after the PERFORM statement: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NUMBER_I    = 6 &lt;/P&gt;&lt;P&gt;NUMBER_P    = 6 &lt;/P&gt;&lt;P&gt;   = 6 &lt;/P&gt;&lt;P&gt;PERSON-NAME = 'Paula' &lt;/P&gt;&lt;P&gt;PERSON-AGE  = 25 &lt;/P&gt;&lt;P&gt;ALPHA       = 'abcde    j' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;If you want to pass the body of an internal table itab that has a header line, you must use the notation itab[] (see Data Objects). If you do not use the brackets, the header line of the tabel is passed. &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 field types and lengths of the parameters remain the same. If a parameter is changed within the subroutine, it will still have the changed value after the subroutine has finished. This does not apply to parameters passed using VALUE. werden. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you pass literals, they may not be changed unless you pass them to a formal parameter defined with USING VALUE. &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;PS:Reward if useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 05:59:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/perform-stm/m-p/2394785#M532842</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T05:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: perform stm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/perform-stm/m-p/2394786#M532843</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;check this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: num1 TYPE i,&lt;/P&gt;&lt;P&gt;      num2 TYPE i,&lt;/P&gt;&lt;P&gt;      res  TYPE p DECIMALS 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num1 = 3. num2 = 4.&lt;/P&gt;&lt;P&gt;PERFORM divide USING num1 num2 CHANGING res.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num1 = 5. num2 = 0.&lt;/P&gt;&lt;P&gt;PERFORM divide USING num1 num2 CHANGING res.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num1 = 2. num2 = 3.&lt;/P&gt;&lt;P&gt;PERFORM divide USING num1 num2 CHANGING res.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM divide USING    n1 TYPE any&lt;/P&gt;&lt;P&gt;                     n2 TYPE any&lt;/P&gt;&lt;P&gt;            CHANGING r  TYPE any.&lt;/P&gt;&lt;P&gt;  CHECK n2 NE 0.&lt;/P&gt;&lt;P&gt;  r = n1 / n2.&lt;/P&gt;&lt;P&gt;  WRITE: / n1, '/', n2, '=', r.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Patil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 06:00:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/perform-stm/m-p/2394786#M532843</guid>
      <dc:creator>santhosh_patil</dc:creator>
      <dc:date>2007-06-11T06:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: perform stm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/perform-stm/m-p/2394787#M532844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The PERFORM statement transfers control explicitly to one or more procedures and implicitly returns control to the next executable statement after execution of the specified procedures is completed. It calls an ABAP subroutine (form) from any program, subject to the normal ABAP runtime authorization checking.&lt;/P&gt;&lt;P&gt;First, define the subroutine and then save your main program. The newly-defined subroutine appears in the navigation area. Move it to the required call point in your program by means of drag &amp;amp; drop. All you have to do is replace the formal parameters in the generated source code with corresponding actual parameters. Alternatively, the call generation can also be implemented using the &amp;lt;Pattern&amp;gt; pushbutton in the ABAP editor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax:&lt;/P&gt;&lt;P&gt;Perform &amp;lt; subroutine name &amp;gt; Using Var1 Changing &amp;lt;Var2&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"using Var1" doesn't reflect any changes that we made to Var1 in the subroutine. But "changing Var2" reflects the changes we made to Var2.It is similar to the concept call by value and call by reference. &lt;/P&gt;&lt;P&gt;Example: &lt;/P&gt;&lt;P&gt;  v1=10 &lt;/P&gt;&lt;P&gt;  v2=20 &lt;/P&gt;&lt;P&gt;perform subroutine using v1 changing v2. &lt;/P&gt;&lt;P&gt;form subroutine &lt;/P&gt;&lt;P&gt;using &lt;/P&gt;&lt;P&gt;value a1  -&amp;gt; Call by value&lt;/P&gt;&lt;P&gt;changing &lt;/P&gt;&lt;P&gt;a2. -&amp;gt; Call by reference&lt;/P&gt;&lt;P&gt; a1 =30. &lt;/P&gt;&lt;P&gt; a2=40. &lt;/P&gt;&lt;P&gt;endform. &lt;/P&gt;&lt;P&gt;then the values of v1 = 10 v2 =40. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Yogitha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 06:43:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/perform-stm/m-p/2394787#M532844</guid>
      <dc:creator>Yogitha</dc:creator>
      <dc:date>2007-06-11T06:43:37Z</dc:date>
    </item>
  </channel>
</rss>

