<?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: Select - write - internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909769#M1482697</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Either&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT RECN INTO corresponding field of table t_SUB_HEADER....
loop at y_sub_header.
 WRITE:/ t_SUB_HEADER-RECORD_NO.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT RECN INTO (t_SUB_HEADER-RECORD_NO) "here you are addressing header of the table
FROM ESTRH
FOR ALL ENTRIES IN t_estmj
WHERE RECN = t_ESTMJ-RECNROOT.
WRITE:/ t_SUB_HEADER-RECORD_NO.
append t_sub_header. "here you are addressing table content
ENDSELECT.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 May 2010 07:57:56 GMT</pubDate>
    <dc:creator>MarcinPciak</dc:creator>
    <dc:date>2010-05-11T07:57:56Z</dc:date>
    <item>
      <title>Select - write - internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909767#M1482695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I dont know if I can use the forum for this ...&lt;/P&gt;&lt;P&gt;Can you help me with this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Data: t_SUB_HEADER type BAPI1077RH occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT RECN INTO (t_SUB_HEADER-RECORD_NO)&lt;/P&gt;&lt;P&gt;  FROM ESTRH&lt;/P&gt;&lt;P&gt;  FOR ALL ENTRIES IN t_estmj&lt;/P&gt;&lt;P&gt;  WHERE RECN = t_ESTMJ-RECNROOT.&lt;/P&gt;&lt;P&gt;    WRITE:/ t_SUB_HEADER-RECORD_NO.&lt;/P&gt;&lt;P&gt;  ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the t_SUB_HEADER to get fill but I cant get to insert the values into the table, I dont know if Im doing things right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 07:53:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909767#M1482695</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-11T07:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: Select - write - internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909768#M1482696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi jean&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You must append the structure in the select statemen, otherwise the record &lt;/P&gt;&lt;P&gt;is not insert in the tablem but only in the header line..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
append t_sub_header.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 07:57:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909768#M1482696</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-11T07:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Select - write - internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909769#M1482697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Either&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT RECN INTO corresponding field of table t_SUB_HEADER....
loop at y_sub_header.
 WRITE:/ t_SUB_HEADER-RECORD_NO.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT RECN INTO (t_SUB_HEADER-RECORD_NO) "here you are addressing header of the table
FROM ESTRH
FOR ALL ENTRIES IN t_estmj
WHERE RECN = t_ESTMJ-RECNROOT.
WRITE:/ t_SUB_HEADER-RECORD_NO.
append t_sub_header. "here you are addressing table content
ENDSELECT.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 07:57:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909769#M1482697</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-05-11T07:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Select - write - internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909770#M1482698</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;       If you want to fill the table .. write as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT RECN INTO table t_SUB_HEADER&lt;/P&gt;&lt;P&gt;FROM ESTRH&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN t_estmj&lt;/P&gt;&lt;P&gt;WHERE RECN = t_ESTMJ-RECNROOT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Srini.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 07:58:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909770#M1482698</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-11T07:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Select - write - internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909771#M1482699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: begin of it_SUB_HEADER occurs 0.
data : RECN like BAPI1077RH-RECORD_NO.
data : end of it_SUB_HEADER.

SELECT RECN INTO TABLE it_SUB_HEADER
FROM ESTRH
FOR ALL ENTRIES IN t_estmj
WHERE RECN = t_ESTMJ-RECNROOT.
ENDSELECT.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 08:00:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909771#M1482699</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2010-05-11T08:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Select - write - internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909772#M1482700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ithink that "corresponding field of table" doesnt apply because the column names are different, neither the select RECN into table.&lt;/P&gt;&lt;P&gt;Im I right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 08:03:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909772#M1482700</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-11T08:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Select - write - internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909773#M1482701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;yes you're right...&lt;/P&gt;&lt;P&gt;you must use append like my previous post...in the select..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 08:04:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909773#M1482701</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-11T08:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Select - write - internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909774#M1482702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the  "append t_sub_header." did it.&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 08:05:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909774#M1482702</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-11T08:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Select - write - internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909775#M1482703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure the internal table t_estmj is not initial before the select query? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Better to put the check when you use FOR ALL ENTRIES&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Data: t_SUB_HEADER type BAPI1077RH occurs 0 with header line.

IF NOT t_estmj[] is intial.

SELECT RECN INTO (t_SUB_HEADER-RECORD_NO)
FROM ESTRH
FOR ALL ENTRIES IN t_estmj
WHERE RECN = t_ESTMJ-RECNROOT.
WRITE:/ t_SUB_HEADER-RECORD_NO.
ENDSELECT.

ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 08:06:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909775#M1482703</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-11T08:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Select - write - internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909776#M1482704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jean Carlo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are saying that you Iwant the t_SUB_HEADER to get fill but you cant get to insert the values into the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here in this code your are not appending the table. see below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: t_SUB_HEADER type BAPI1077RH occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT RECN INTO (t_SUB_HEADER-RECORD_NO)&lt;/P&gt;&lt;P&gt;FROM ESTRH&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN t_estmj&lt;/P&gt;&lt;P&gt;WHERE RECN = t_ESTMJ-RECNROOT.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;APPEND t_SUB_HEADER.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;WRITE:/ t_SUB_HEADER-RECORD_NO.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Better if you write the code written below for good performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT RECN INTO TABLE t_SUB_HEADER&lt;/P&gt;&lt;P&gt;FROM ESTRH&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN t_estmj&lt;/P&gt;&lt;P&gt;WHERE RECN = t_ESTMJ-RECNROOT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC EQ 0.&lt;/P&gt;&lt;P&gt;LOOP AT t_SUB_HEADER.&lt;/P&gt;&lt;P&gt;WRITE:/ t_SUB_HEADER-RECORD_NO.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is the solution of your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Md Ziauddin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 08:06:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-write-internal-table/m-p/6909776#M1482704</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-11T08:06:49Z</dc:date>
    </item>
  </channel>
</rss>

