<?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 declare table in a method using OOP abap in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-declare-table-in-a-method-using-oop-abap/m-p/10846214#M1885135</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Modify the below code and check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;&lt;SPAN class="L0S52"&gt;CALL &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;METHOD &lt;/SPAN&gt;acct1-&amp;gt;getdata&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;EXPORTING&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; otype&amp;nbsp; = wa-otype&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objid&amp;nbsp; = wa-objid&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date1&amp;nbsp; = date1&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;&amp;nbsp; &lt;STRONG&gt; &lt;SPAN class="L0S52"&gt;IMPORTING&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itab&amp;nbsp;&amp;nbsp; = itabfinal[ ] .&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;Because your ITABFINAL is of table with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;Thanks&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;KH&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Jan 2015 06:44:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2015-01-20T06:44:47Z</dc:date>
    <item>
      <title>How to declare table in a method using OOP abap</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-declare-table-in-a-method-using-oop-abap/m-p/10846213#M1885134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi every one i have a problem while exporting the the table from the method in a class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the the method GETDATA as below . Inside the method i am giving &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;import parameters are "OTYPE, OBJID, DATE1"&amp;nbsp; type Hrp1001&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Export type as&amp;nbsp; Itab type zhrp1001(table type like hrp1001, created in se11 ).&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the code inside the method GETDATA is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;STRONG&gt;method &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;GETDATA.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;select&amp;nbsp; &lt;/SPAN&gt;otype objid begda endda sclas sobid relat plvar &lt;SPAN class="L0S52"&gt;from &lt;/SPAN&gt;hrp1001 &lt;SPAN class="L0S52"&gt;into &lt;/SPAN&gt;corresponding &lt;SPAN class="L0S52"&gt;fields &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;of &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;table &lt;/SPAN&gt;itab &lt;SPAN class="L0S52"&gt;where &lt;/SPAN&gt;otype &lt;SPAN class="L0S52"&gt;eq &lt;/SPAN&gt;otype &lt;SPAN class="L0S52"&gt;and &lt;/SPAN&gt;objid &lt;SPAN class="L0S52"&gt;eq &lt;/SPAN&gt;objid &lt;SPAN class="L0S52"&gt;and &lt;/SPAN&gt;begda &amp;lt;= date1 &lt;SPAN class="L0S52"&gt;and &lt;/SPAN&gt;endda &amp;gt;= date1.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; endmethod.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aftre declaring the method now in se38 program i am calling the&amp;nbsp; method GETDATA as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;DATA &lt;/SPAN&gt;: acct1 &lt;SPAN class="L0S52"&gt;type &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;ref &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;to &lt;/SPAN&gt;ZHRP1001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DATA: itab &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;STANDARD &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TABLE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;OF &lt;/SPAN&gt;hrp1000,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wa &lt;SPAN class="L0S52"&gt;LIKE&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;LINE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;OF &lt;/SPAN&gt;itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Data: itabfinal &lt;SPAN class="L0S52"&gt;TYPE&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TABLE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;OF &lt;/SPAN&gt;hrp1001 &lt;SPAN class="L0S52"&gt;with &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;header &lt;/SPAN&gt;line.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;create &lt;/SPAN&gt;object acct1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;select &lt;/SPAN&gt;* &lt;SPAN class="L0S52"&gt;from &lt;/SPAN&gt;hrp1000 &lt;SPAN class="L0S52"&gt;into &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;table &lt;/SPAN&gt;itab &lt;SPAN class="L0S52"&gt;where &lt;/SPAN&gt;otype &lt;SPAN class="L0S52"&gt;in &lt;/SPAN&gt;otype &lt;SPAN class="L0S52"&gt;and &lt;/SPAN&gt;objid &lt;SPAN class="L0S52"&gt;in &lt;/SPAN&gt;objid &lt;SPAN class="L0S52"&gt;and &lt;/SPAN&gt;begda &amp;lt;= date1 &lt;SPAN class="L0S52"&gt;and &lt;/SPAN&gt;endda &amp;gt;= date1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;delete &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;adjacent &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;duplicates &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;from &lt;/SPAN&gt;itab.&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;clear &lt;/SPAN&gt;wa.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;loop &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;at &lt;/SPAN&gt;itab &lt;SPAN class="L0S52"&gt;into &lt;/SPAN&gt;wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.63636302948px;"&gt;&lt;SPAN class="L0S52"&gt;CALL &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;METHOD &lt;/SPAN&gt;acct1-&amp;gt;getdata&lt;/P&gt;&lt;P style="font-size: 13.63636302948px;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;EXPORTING&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.63636302948px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; otype&amp;nbsp; = wa-otype&lt;/P&gt;&lt;P style="font-size: 13.63636302948px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objid&amp;nbsp; = wa-objid&lt;/P&gt;&lt;P style="font-size: 13.63636302948px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date1&amp;nbsp; = date1&lt;/P&gt;&lt;P style="font-size: 13.63636302948px;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;IMPORTING&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.63636302948px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itab&amp;nbsp;&amp;nbsp; = itabfinal.&lt;/P&gt;&lt;P style="font-size: 13.63636302948px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.63636302948px;"&gt;endloop.&lt;/P&gt;&lt;P style="font-size: 13.63636302948px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.63636302948px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.63636302948px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.63636302948px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.63636302948px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.63636302948px;"&gt;But iam getting the error as "ITAB-Final is not&amp;nbsp; type-compatible with the formal parameter "ITAB".&lt;/P&gt;&lt;P style="font-size: 13.63636302948px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.63636302948px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.63636302948px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.63636302948px;"&gt;Please help me how to solve the above error and get output.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 06:38:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-declare-table-in-a-method-using-oop-abap/m-p/10846213#M1885134</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-01-20T06:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to declare table in a method using OOP abap</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-declare-table-in-a-method-using-oop-abap/m-p/10846214#M1885135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Modify the below code and check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;&lt;SPAN class="L0S52"&gt;CALL &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;METHOD &lt;/SPAN&gt;acct1-&amp;gt;getdata&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;EXPORTING&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; otype&amp;nbsp; = wa-otype&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objid&amp;nbsp; = wa-objid&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date1&amp;nbsp; = date1&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;&amp;nbsp; &lt;STRONG&gt; &lt;SPAN class="L0S52"&gt;IMPORTING&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itab&amp;nbsp;&amp;nbsp; = itabfinal[ ] .&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;Because your ITABFINAL is of table with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;Thanks&lt;/P&gt;&lt;P style="font-size: 13.63px;"&gt;KH&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 06:44:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-declare-table-in-a-method-using-oop-abap/m-p/10846214#M1885135</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-01-20T06:44:47Z</dc:date>
    </item>
  </channel>
</rss>

