<?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: ABAP select data  encapsulation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-select-data-encapsulation/m-p/12747018#M2021490</link>
    <description>&lt;P&gt;Looks a bit like coming from ChatGPT &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Anyway, I know all the advantages and disadvantages, since in the Non-ABAP world it's very common. &lt;/P&gt;&lt;P&gt;But then I see any ABAP code, even SAP standard, I cannot see patterns like that. So my question goes more in the direction of: &lt;/P&gt;&lt;P&gt;Is it also in SAP - ABAP common practice to encapsulate data access?&lt;/P&gt;&lt;P&gt;Is it common to write Unit Tests especially create mock objects?&lt;/P&gt;&lt;P&gt;Thanks a lot.  &lt;/P&gt;</description>
    <pubDate>Wed, 21 Jun 2023 20:39:48 GMT</pubDate>
    <dc:creator>former_member784189</dc:creator>
    <dc:date>2023-06-21T20:39:48Z</dc:date>
    <item>
      <title>ABAP select data  encapsulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-select-data-encapsulation/m-p/12747016#M2021488</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;
  &lt;P&gt;I'm quite new in ABAP and see a lot of ABAP methods or FMs with ABAP select statements reading data from the tables. &lt;/P&gt;
  &lt;P&gt;When it comes to testing and especially unit tests, it's almost impossible to write such a unit test, since the data coming from the tables is volatile and will change.&lt;/P&gt;
  &lt;P&gt;Somehow it can be achieved with test double framework. But database mocks are not possible, since we are still on &lt;/P&gt;
  &lt;P&gt;on ECC 7.5 and osql test double framework does not exist. &lt;/P&gt;
  &lt;P&gt;Question: &lt;/P&gt;
  &lt;P&gt;Is it still a good practice to have all these select statements directly in the methods or FMs, or would it be recommended to create something like a repository class with an interface to encapsulate the data access logic. &lt;/P&gt;
  &lt;P&gt;The idea then is to use the normal test double framework and create a mock object of the repository object for the unit tests.&lt;/P&gt;
  &lt;P&gt;Thank your very much for the ideas, answers and maybe experiences. &lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 21:15:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-select-data-encapsulation/m-p/12747016#M2021488</guid>
      <dc:creator>former_member784189</dc:creator>
      <dc:date>2023-06-20T21:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP select data  encapsulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-select-data-encapsulation/m-p/12747017#M2021489</link>
      <description>&lt;P&gt;And a dedicated class for data will help you to create a mock and test class using this data class&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 05:04:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-select-data-encapsulation/m-p/12747017#M2021489</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2023-06-21T05:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP select data  encapsulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-select-data-encapsulation/m-p/12747018#M2021490</link>
      <description>&lt;P&gt;Looks a bit like coming from ChatGPT &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Anyway, I know all the advantages and disadvantages, since in the Non-ABAP world it's very common. &lt;/P&gt;&lt;P&gt;But then I see any ABAP code, even SAP standard, I cannot see patterns like that. So my question goes more in the direction of: &lt;/P&gt;&lt;P&gt;Is it also in SAP - ABAP common practice to encapsulate data access?&lt;/P&gt;&lt;P&gt;Is it common to write Unit Tests especially create mock objects?&lt;/P&gt;&lt;P&gt;Thanks a lot.  &lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 20:39:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-select-data-encapsulation/m-p/12747018#M2021490</guid>
      <dc:creator>former_member784189</dc:creator>
      <dc:date>2023-06-21T20:39:48Z</dc:date>
    </item>
  </channel>
</rss>

