<?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: OO programming or Procedural? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500421#M17281</link>
    <description>&lt;P&gt;For instance, utility program for batch input session with SPA/GPA parameters not reset :&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;REPORT.
PARAMETERS p_tcode TYPE tcode OBLIGATORY.
TYPES spa_value TYPE c LENGTH 255.
DEFINE mac_set_parameter.
  PARAMETERS p_spa&amp;amp;1 TYPE tpara-paramid.
  PARAMETERS p_val&amp;amp;1 TYPE spa_value.
  IF p_spa&amp;amp;1 IS NOT INITIAL.
    SET PARAMETER ID p_spa&amp;amp;1 FIELD p_val&amp;amp;1.
  ENDIF.
END-OF-DEFINITION.
mac_set_parameter : 01, 02, 03, 04, 05, 06, 07, 08, 09, 10.
CALL TRANSACTION p_tcode WITH AUTHORITY-CHECK.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Or any utility program in fact.&lt;/P&gt;
  &lt;P&gt;EDIT: with authority-check added.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Nov 2017 17:13:45 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2017-11-24T17:13:45Z</dc:date>
    <item>
      <title>OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500413#M17273</link>
      <description>&lt;P&gt;Hello i have been working with SAP-ABAP for about 4 months and i just finished a course in OO programming. I Would like to understand if i should always program everything in OO concepts or should i use procedural programming on minor programs?&lt;/P&gt;
  &lt;P&gt;To me it seems like doing everything in OO way is the more reasonable choice because the SAP environment will then have more redundancy and will be more robust but i would like to hear some opinions about this topic from other members of the community&lt;/P&gt;
  &lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 09:13:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500413#M17273</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-11-23T09:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500414#M17274</link>
      <description>&lt;P&gt;You should always use OO. For a start, FORM and PERFORM are now obsolete language components. However, the main reason is that minor programs from time to time become major programs. (Can you just add this? Can you make it do that? etc.). If you've programmed it properly in the first place, the cost of maintaining and enhancing will be reduced.&lt;/P&gt;
  &lt;P&gt;You don't have to use global classes. You can use local classes. Sometimes I've needed to make a local class global, but that's a relatively straightforward task.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 09:15:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500414#M17274</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2017-11-23T09:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500415#M17275</link>
      <description>&lt;P&gt;Thank you for the quick rspoonse, it makes more sense now.&lt;/P&gt;
  &lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 12:30:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500415#M17275</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-11-23T12:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500416#M17276</link>
      <description>&lt;P&gt;&lt;A href="https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenabap_obj_progr_model_guidl.htm" target="test_blank"&gt;https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenabap_obj_progr_model_guidl.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 17:25:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500416#M17276</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2017-11-23T17:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500417#M17277</link>
      <description>&lt;P&gt;Of course, if it's a basic code of &lt;STRONG&gt;10 lines &lt;/STRONG&gt;(sometimes it's needed for interfacing two applications), I don't see why we should use OO, as the procedural way would be far more readable.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 19:09:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500417#M17277</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-11-23T19:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500418#M17278</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;horst.keller&lt;/SPAN&gt; I found this link about SoC(Separation of concern) while Reading the link you provided. it gave me a clearer Picture on how to implement OO techniques in programs.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;&lt;A href="https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenabap_obj_progr_model_guidl.htm" target="test_blank"&gt;https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenabap_obj_progr_model_guidl.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 12:25:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500418#M17278</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-11-24T12:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500419#M17279</link>
      <description>&lt;P&gt;As I said:&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;...the main reason is that minor programs from time to time become major programs. (Can you just add this? Can you make it do that? etc.). If you've programmed it properly in the first place, the cost of maintaining and enhancing will be reduced.&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;I wouldn't consider 10 lines of code &lt;STRONG&gt;not &lt;/STRONG&gt;inside a method to necessarily be procedural. If the granularity is small enough, it really doesn't merit any kind of description beyond perhaps "script". I'd disagree that encapsulating the script within a method is less readable. If you're comfortable with OO, there's no difference in readability. And if you're not, then perhaps readability is (subjectively) 99.99% rather than 100%. &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;...bit of code...&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;compared with&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;CLASS thing DEFINITION.
  METHODS do_simple_stuff.
ENDCLASS.

CLASS thing IMPLEMENTATION.
  METHOD do_simple_stuff.
    ...bit of code...
  ENDMETHOD.
ENDCLASS.

new thing( )-&amp;gt;do_simple_stuff( ).&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;However, I'm intrigued by what you mean by 10 line interfacing two applications means. Can you give an example? &lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 12:37:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500419#M17279</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2017-11-24T12:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500420#M17280</link>
      <description>&lt;P&gt;Unfortunately, ABAP misses one thing, the "submitable class" &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 12:47:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500420#M17280</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2017-11-24T12:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500421#M17281</link>
      <description>&lt;P&gt;For instance, utility program for batch input session with SPA/GPA parameters not reset :&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;REPORT.
PARAMETERS p_tcode TYPE tcode OBLIGATORY.
TYPES spa_value TYPE c LENGTH 255.
DEFINE mac_set_parameter.
  PARAMETERS p_spa&amp;amp;1 TYPE tpara-paramid.
  PARAMETERS p_val&amp;amp;1 TYPE spa_value.
  IF p_spa&amp;amp;1 IS NOT INITIAL.
    SET PARAMETER ID p_spa&amp;amp;1 FIELD p_val&amp;amp;1.
  ENDIF.
END-OF-DEFINITION.
mac_set_parameter : 01, 02, 03, 04, 05, 06, 07, 08, 09, 10.
CALL TRANSACTION p_tcode WITH AUTHORITY-CHECK.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Or any utility program in fact.&lt;/P&gt;
  &lt;P&gt;EDIT: with authority-check added.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 17:13:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500421#M17281</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-11-24T17:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500422#M17282</link>
      <description>&lt;P&gt;So effectively a script,&lt;/P&gt;
  &lt;P&gt;Looks a little unsecured though. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 17:42:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500422#M17282</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2017-11-24T17:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500423#M17283</link>
      <description>&lt;P&gt;It was an example of course. If you call 10 lines of code a script then yes it is a script of course. Anyway, I really don't see why we should encapsulate it as ABAP Objects.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2017 09:21:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500423#M17283</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-11-25T09:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500424#M17284</link>
      <description>&lt;P&gt;and of course there are probably many other reasons for 10 lines of code. And not only in an executable program. In a RFC-enabled function module, you won't embed these lines in a local class.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2017 09:33:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500424#M17284</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-11-25T09:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500425#M17285</link>
      <description>&lt;P&gt;Inside classes there are stricter syntax rules which are valuable even for 10 lines of code.&lt;/P&gt;
  &lt;P&gt;It's not a big deal to prepare a small template and copy that even into smallest programs as I have done for all the executable examples of the ABAP docu.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2017 10:27:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500425#M17285</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2017-11-25T10:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500426#M17286</link>
      <description>&lt;P&gt;But for the clarity of the ABAP examples, the class encapsulations have been grayed out to focus on the procedural part, and that was a very good idea &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
  &lt;P&gt;But believe me or not, I always write my programs using OO. I'm simply acting as the "Devil's advocate". French proverb : there is always an exception to a rule.&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;U&gt;&lt;/U&gt;&lt;SUB&gt;&lt;/SUB&gt;&lt;SUP&gt;&lt;/SUP&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2017 14:05:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500426#M17286</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-11-25T14:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500427#M17287</link>
      <description>&lt;P&gt;My humble opinion is that it has little to do with length of code. Your example deals exclusively with classical ABAP elements, therefore that particular usage makes sense to use classic ABAP. &lt;/P&gt;
  &lt;P&gt;On a more general note to this thread, in Eclipse it's hardly an effort: lcl&amp;lt;ctrl-space&amp;gt;&amp;lt;enter&amp;gt; et voila: a ready-to-use class template. &lt;/P&gt;
  &lt;P&gt;Of course you can also roll your own templates, and personally I've automated a few things using TextExpander (mac) and TyperTask (win), because a) that way the templates work consistently across Eclipse and SAPGUI editors, and b) I find the &amp;lt;ctrl-enter&amp;gt; bit an unnecessary effort &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2017 14:46:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500427#M17287</guid>
      <dc:creator>pokrakam</dc:creator>
      <dc:date>2017-11-25T14:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500428#M17288</link>
      <description>&lt;P&gt;And I sometimes don't use classes ...&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2017 15:16:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500428#M17288</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2017-11-25T15:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500429#M17289</link>
      <description>&lt;P&gt;If it's a more lengthy code, it's often possible to split the code in 2 or more procedures for more readability (functional splitting of course). You're right, it's not a matter of time for writing the extra code. Not using OO for a "script" is just a matter of readability. Differently said, I prefer to see directly the effective code without the mess around.&lt;/P&gt;
  &lt;P&gt;But generally speaking, I agree with Matt's answer of course. I think the original question was not about 10 lines of code, and was about code with procedures, so use ABAP Objects for sure. Matt's answer "You should always use OO" is not "You must always use OO", I just wanted to add my 2 cents.&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;U&gt;&lt;/U&gt;&lt;SUB&gt;&lt;/SUB&gt;&lt;SUP&gt;&lt;/SUP&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2017 16:22:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500429#M17289</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-11-25T16:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500430#M17290</link>
      <description>&lt;P&gt;Why not do it?&lt;/P&gt;
  &lt;UL&gt;
   &lt;LI&gt;It's little effort to ecapsulate&lt;/LI&gt;
   &lt;LI&gt;You benefit from the stricter syntax checking rules, which mean you can't have those old ambiguous ABAP statements&lt;/LI&gt;
   &lt;LI&gt;You future proof if later there's a need to enhance.&lt;/LI&gt;
   &lt;LI&gt;You make re-use easier.&lt;/LI&gt;
  &lt;/UL&gt;</description>
      <pubDate>Mon, 27 Nov 2017 07:10:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500430#M17290</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2017-11-27T07:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500431#M17291</link>
      <description>&lt;P&gt;Well... if you work for me, you must use OO. But that's mainly to get folk who are reluctant to get into the habit. It also gets people away from what I think is a very bad habit of "well, it's only 10 lines of code/a utlitiy program/a one off kind of mentality, and apply rigour and best practice to all their work.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 07:13:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500431#M17291</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2017-11-27T07:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: OO programming or Procedural?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500432#M17292</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;this is maybe the better question to have a little fight between developers, and the famous INNER JOIN vs FOR ALL ENTRIES &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
  &lt;P&gt;As I understood the Oo has to be used when the logic is based on the data, and the Procedural when the logic is based on the process. &lt;/P&gt;
  &lt;P&gt;But I'm not sure it is a good idea to force people to code always in Oo, sometimes it's really difficult to debug Oo program. &lt;/P&gt;
  &lt;P&gt;And I am curious about the memory consumption and if Oo is really faster than simple procedural program??&lt;/P&gt;
  &lt;P&gt;Regards&lt;/P&gt;
  &lt;P&gt;Fred&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 07:48:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/oo-programming-or-procedural/m-p/500432#M17292</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2017-11-27T07:48:41Z</dc:date>
    </item>
  </channel>
</rss>

