<?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: READ VS Select in OOPS in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-vs-select-in-oops/m-p/6316842#M1393673</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sumana,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There seems to be a problem with the definition of your t_cgpl_project bcs read table is actually well recommended &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your  t_cgpl_project shud be an internal table to do the read statement and not a database table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Nov 2009 21:51:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-11-11T21:51:47Z</dc:date>
    <item>
      <title>READ VS Select in OOPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-vs-select-in-oops/m-p/6316840#M1393671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to use READ table instead of SELECT single in a class ZCL_IM_MRSS_EX_MESSAGES&lt;/P&gt;&lt;P&gt;Below is the select statement I am trying to format as READ TABLE&lt;/P&gt;&lt;P&gt;SELECT SINGLE external_id from cgpl_project into wa_zcp_int_fa-project_id where guid = ls_role_det-project_guid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My read statement is READ TABLE t_cgpl_project into wa_cgpl_project&lt;/P&gt;&lt;P&gt;with key guid = ls_role_det-project_guid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the above read statement I am getting below error -- &lt;/P&gt;&lt;P&gt;READ dbatb is not supported in the OO context. Use SELECT SINGLE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What does this error mean? Pls provide inputs ASAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;S.Sumana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2009 10:37:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-vs-select-in-oops/m-p/6316840#M1393671</guid>
      <dc:creator>SumanaSoori</dc:creator>
      <dc:date>2009-11-06T10:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: READ VS Select in OOPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-vs-select-in-oops/m-p/6316841#M1393672</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;But what's t_cgpl_project?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want compare READ TABLE statament with SELECT SINGLE, it means t_cgpl_project should be a dictionary table, if it's so READ TABLE DBTAB...is an obsolete statament not supported by OOA, so u have to use SELECT SINGLE...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway I can't see the table T_CGPL_PROJECT, but CGPL_PROJECT....so I suppose  T_CGPL_PROJECT is an internal table...if it's so something is wrong in your definition, because READ TABLE itab is allowed in OOA:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLASS LCL_MY_CLASS DEFINITION.
  PUBLIC SECTION.
    DATA: WA_CGPL_PROJECT TYPE CGPL_PROJECT.

    METHODS: SEL_DATA,
             READ_DATA
              EXPORTING GUID TYPE CGPL_PROJECT-GUID.
  PRIVATE SECTION.
    DATA: T_CGPL_PROJECT  TYPE TABLE OF CGPL_PROJECT.

ENDCLASS.                    "LCL_MY_CLASS DEFINITION

CLASS LCL_MY_CLASS IMPLEMENTATION.
  METHOD SEL_DATA.
    SELECT * FROM CGPL_PROJECT
      INTO TABLE T_CGPL_PROJECT.
  ENDMETHOD.                    "sel_data

  METHOD READ_DATA.
    READ TABLE T_CGPL_PROJECT INTO WA_CGPL_PROJECT
      WITH KEY GUID = GUID.
  ENDMETHOD.                    "read_data
ENDCLASS.                    "LCL_MY_CLASS IMPLEMENTATION&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2009 10:49:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-vs-select-in-oops/m-p/6316841#M1393672</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-06T10:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: READ VS Select in OOPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-vs-select-in-oops/m-p/6316842#M1393673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sumana,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There seems to be a problem with the definition of your t_cgpl_project bcs read table is actually well recommended &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your  t_cgpl_project shud be an internal table to do the read statement and not a database table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Nov 2009 21:51:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-vs-select-in-oops/m-p/6316842#M1393673</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-11T21:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: READ VS Select in OOPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-vs-select-in-oops/m-p/6316843#M1393674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sumana, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to fetch a single record from DB table, and that is enough in your entire report - then u should fetch it through select single only. &lt;/P&gt;&lt;P&gt;because read DBTable is obsolete. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At a particular instance you want a single record, and as in total report u need many records from that DB table, then first get all the records into an internal table. &lt;/P&gt;&lt;P&gt;Then wherever u need just use read table to that internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you. &lt;/P&gt;&lt;P&gt;Please revert back if u need any further info.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Nov 2009 06:14:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-vs-select-in-oops/m-p/6316843#M1393674</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-12T06:14:33Z</dc:date>
    </item>
  </channel>
</rss>

