<?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: How to write an adjustable ABAP program? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-an-adjustable-abap-program/m-p/718393#M33397</link>
    <description>&lt;P&gt;Using design patterns would improve the flexibility of your programs dramatically. In case you need a book on the subject, check: &lt;A href="https://www.amazon.com/ABAP-Design-Patterns-Objects-PRESS/dp/1493214640"&gt;https://www.amazon.com/ABAP-Design-Patterns-Objects-PRESS/dp/1493214640&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Nov 2018 05:36:16 GMT</pubDate>
    <dc:creator>keremkoseoglu</dc:creator>
    <dc:date>2018-11-15T05:36:16Z</dc:date>
    <item>
      <title>How to write an adjustable ABAP program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-an-adjustable-abap-program/m-p/718389#M33393</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I have experience in developing programs in ABAP and through it would like to know how can I code keeping future changes in mind.&lt;/P&gt;
  &lt;P&gt;For example recently I developed a program for a customized process on client side and initially requirements were simple and program was done.&lt;/P&gt;
  &lt;P&gt;But few weeks later came changes that were critical and although I accommodated them it came at expense of code readability and performance.&lt;/P&gt;
  &lt;P&gt;Few more months later came few changes ,and at this moment I was thoroughly confused as to what I had done in there making myself confused by my own programming.&lt;/P&gt;
  &lt;P&gt;So I would really like to know as to what methodology you gurus adopt for these kind of scenarios assuming changes to be inevitable .&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 16:33:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-an-adjustable-abap-program/m-p/718389#M33393</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-11-14T16:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to write an adjustable ABAP program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-an-adjustable-abap-program/m-p/718390#M33394</link>
      <description>&lt;P&gt;Hi NIDA,&lt;/P&gt;&lt;P&gt;As per me, I usually write the code which is reusable and modular to the peaks &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; I create as many methods as possible  to make my code more modular..&lt;/P&gt;&lt;P&gt;I code everything in global classes and methods, if possible in some cases I use inheritance concepts.. &lt;/P&gt;&lt;P&gt;So for any kind of applications be it abap webdynpro odata UI5 or others if we make sure our code is very modular then it will be easy to accomodate any new changes and overall impact will be less.. atleast for me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If we try to use object oriented concepts as much as possible, the code will be a lot better. Documentation will als0 help a lot when we go back to change something. I try to put a lot of comments in my code if that involves some logic..&lt;/P&gt;&lt;P&gt;And remember if the issue is with the customer requirements, even writing the best code will also not help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Adding more below:&lt;/P&gt;&lt;P&gt;Try not to hard code and Try to use custom configuration tables as much as possible so we can write the code in such a way that changes in future can be avoided by just maintaining the entries in that configuration table.. &lt;/P&gt;&lt;P&gt;this I try to use a lot in my code and it will always help in avoiding more changes in future. &lt;/P&gt;&lt;P&gt;Also, while writing code we need to get more than enough information from the customer so that we can write the code thinking future changes in mind and this where configuration tables will give you more benefits..&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 17:12:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-an-adjustable-abap-program/m-p/718390#M33394</guid>
      <dc:creator>maheshpalavalli</dc:creator>
      <dc:date>2018-11-14T17:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to write an adjustable ABAP program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-an-adjustable-abap-program/m-p/718391#M33395</link>
      <description>&lt;P&gt;Mahesh is absolutely correct that custom configuration tables and lookup tables are a life-saver when having to add new functionality to an existing program.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;"Also, while writing code we need to get more than enough information from the customer so that we can write the    code thinking future changes in mind ..."&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;A very important point!&lt;/P&gt;&lt;P&gt;One method I have found useful over the years is to get invited to some of the functional design meetings.  One can get a real feeling for what the user community wants to see in the future, where they are headed or what it is they "really" are passionate about.  We can also get a feeling for what leadership is pointing towards and what are their longer-term goals from these discussions. &lt;/P&gt;&lt;P&gt;Even the discussion points that were ultimately not approved for the current development cycle may well contain elements that can be considered when designing the code to accomplish the current tasking; often with few (or even no) additional resources.  That type of detail usually gets lost in the translation from conference room table discussion among the user community to the final technical specification we developers work from.   And that detail can make all the difference in writing flexible, robust programs.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 19:27:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-an-adjustable-abap-program/m-p/718391#M33395</guid>
      <dc:creator>loyd_enochs3</dc:creator>
      <dc:date>2018-11-14T19:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to write an adjustable ABAP program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-an-adjustable-abap-program/m-p/718392#M33396</link>
      <description>&lt;P&gt;Hi Mahesh,&lt;/P&gt;&lt;P&gt;Thanks for your useful reply..&lt;/P&gt;&lt;P&gt;Also apart from configuration table for hardcode values how do I plan ahead  considering that these changes come as they are observed by customers in production and not in advance. &lt;/P&gt;&lt;P&gt;Let me say it like this&lt;/P&gt;&lt;P&gt;if varable1 &amp;gt;= variable2.&lt;/P&gt;&lt;P&gt;//my processing here&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;Now in future if more conditions or checks come for these two variables and apart from adding more if's, how to proceed, cause currently all I do is revamp it with more if statements. Now certain scenarios contain more variables and conditions to compare,&lt;/P&gt;&lt;P&gt;So what could be a suitable alternative to if or case statements. &lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Nida Khan&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 05:26:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-an-adjustable-abap-program/m-p/718392#M33396</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-11-15T05:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to write an adjustable ABAP program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-an-adjustable-abap-program/m-p/718393#M33397</link>
      <description>&lt;P&gt;Using design patterns would improve the flexibility of your programs dramatically. In case you need a book on the subject, check: &lt;A href="https://www.amazon.com/ABAP-Design-Patterns-Objects-PRESS/dp/1493214640"&gt;https://www.amazon.com/ABAP-Design-Patterns-Objects-PRESS/dp/1493214640&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 05:36:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-an-adjustable-abap-program/m-p/718393#M33397</guid>
      <dc:creator>keremkoseoglu</dc:creator>
      <dc:date>2018-11-15T05:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to write an adjustable ABAP program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-an-adjustable-abap-program/m-p/718394#M33398</link>
      <description>&lt;P&gt;Precisely in these kind of scenario's we use customizing tables.. I didn't mean them only for the hardcoded values.. &lt;/P&gt;&lt;P&gt;Lets take a very simple example:&lt;/P&gt;&lt;P&gt;Customer says i want the upload to work only for PDF documents.&lt;/P&gt;&lt;P&gt;So instead of writing an if condition for only 'PDF' document, create a customizing table for 'Allowed Doc Types Upload', here you can maintain a list of document types that are allowed to be uploaded. &lt;/P&gt;&lt;P&gt;Now in your code you can write a select query and check if that particular Document type is maintained or not, If it is maintained, then go a head and upload the document.&lt;/P&gt;&lt;P&gt;But if the business logic itself is entirely changed in the if condition, then obviously we have to accommodate the program with new code changes.&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 05:54:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-an-adjustable-abap-program/m-p/718394#M33398</guid>
      <dc:creator>maheshpalavalli</dc:creator>
      <dc:date>2018-11-15T05:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to write an adjustable ABAP program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-an-adjustable-abap-program/m-p/718395#M33399</link>
      <description>&lt;P&gt;Hi Mahesh,&lt;/P&gt;&lt;P&gt;Got your point.&lt;/P&gt;&lt;P&gt;One more thing , how do I design my program flow (normally I program in core ABAP and not OOABAP), so as to leave "Window" for changes.&lt;BR /&gt;Is there a standard pattern in ABAP that i could follow where I could just add my functionality like in a BADI but for modification purpose and not enhancement.&lt;/P&gt;&lt;P&gt;In short any prerequisite designing required in abap for optimal programming and readability.&lt;/P&gt;&lt;P&gt;One more thing as added by &lt;A href="https://answers.sap.com/users/125004/keremkoseoglu.html"&gt;Kerem Koseoglu&lt;/A&gt; . Design patterns for OOABAP seemed right approach but for CORE ABAP is there any alternative?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nida Khan&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>Fri, 16 Nov 2018 06:40:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-an-adjustable-abap-program/m-p/718395#M33399</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-11-16T06:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to write an adjustable ABAP program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-an-adjustable-abap-program/m-p/718396#M33400</link>
      <description>&lt;P&gt;Hi Nida,&lt;/P&gt;&lt;P&gt;Yes, actually speaking you can create your own BADIs and use them for extension as well. I've worked in couple of projects where we used them like that especially the Filter BADIs.&lt;/P&gt;&lt;P&gt;I would say that from now onwards, strictly change your coding style to OOABAP and start using classes instead of includes and push all the business logic, UI logic &amp;amp; DB logic to classes(Multiple class for UI, BL &amp;amp; DB if possible), use the report/module pool programs only for the screen designing and displaying. This has its advantage, as you can use the same classes for your future ODATA &amp;amp; BOPF with minimal code changes which you cannot do with the normal core ABAP style programming.&lt;/P&gt;&lt;P&gt;You can also see standard modules like REFX, BP, CRM, C4C etc., completely uses OOABAP concepts to run the applications and they use different design patterns in all of those modules but most common design pattern you will find is Singleton &amp;amp; Factory design pattern. So may be you can check those patterns in different blogs available in SCN.&lt;/P&gt;&lt;P&gt;In parallel, as per the suggestion of &lt;A href="https://answers.sap.com/users/125004/keremkoseoglu.html"&gt;Kerem Koseoglu&lt;/A&gt;, you can check those patterns and understand them and try to implement the same in ABAP. But i would suggest you to get good knowledge and understand of OOABAP in order to move forward with the patterns.&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 08:56:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-an-adjustable-abap-program/m-p/718396#M33400</guid>
      <dc:creator>maheshpalavalli</dc:creator>
      <dc:date>2018-11-16T08:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to write an adjustable ABAP program?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-an-adjustable-abap-program/m-p/718397#M33401</link>
      <description>&lt;P&gt;Hi Nida,&lt;/P&gt;&lt;P&gt;there is no golden rule. You cannot predict the changes of the future. If you try, the changes will turn out to be totally different to your prediction... &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The tip of   &lt;SPAN class="mention-scrubbed"&gt;maheshkumar.palavalli&lt;/SPAN&gt; is good: try to modulize. &lt;/P&gt;&lt;P&gt;Practice Clean code.&lt;/P&gt;&lt;P&gt;Strictly use constants for hard coded values.&lt;/P&gt;&lt;P&gt;In my opinion the only way is to steadily learn and develop your skills. After having finished a program try to get some colleagues to discuss some issues. Sit back and ask yourself: If I were a user, what functionality would I like to have additionally in this programm? Then try to implement it.&lt;/P&gt;&lt;P&gt;And: There is a difference between "being unable to extend a functionality" and "not understanding the former coded program"! If your are confused about what the hell you coded two months before then try to figure out why you are confused? What is not clear? Lack of documentation? Unprecise naming? &lt;/P&gt;&lt;P&gt;Cheers &lt;BR /&gt;~ Enno&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 15:08:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-an-adjustable-abap-program/m-p/718397#M33401</guid>
      <dc:creator>EnnoWulff</dc:creator>
      <dc:date>2018-11-16T15:08:05Z</dc:date>
    </item>
  </channel>
</rss>

