<?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 code header and items in internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-code-header-and-items-in-internal-table/m-p/5203510#M1203831</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tnx all&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Feb 2009 04:18:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-11T04:18:51Z</dc:date>
    <item>
      <title>How to code header and items in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-code-header-and-items-in-internal-table/m-p/5203504#M1203825</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;Iam new to abap.&lt;/P&gt;&lt;P&gt;I have to write a report in internal table , for 1 header item related child items must exist,suppose if header is org then the child like branches in diff cities must be printed under that org and other org ther related branches etc.&lt;/P&gt;&lt;P&gt;can u tell me how i have to approach this with code.&lt;/P&gt;&lt;P&gt;Thanx.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 03:54:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-code-header-and-items-in-internal-table/m-p/5203504#M1203825</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-11T03:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to code header and items in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-code-header-and-items-in-internal-table/m-p/5203505#M1203826</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;Try to use REUSE_ALV_HIERSEQ_LIST_DISPLAY function module which will display both header and items in hierarchical format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 03:59:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-code-header-and-items-in-internal-table/m-p/5203505#M1203826</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2009-02-11T03:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to code header and items in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-code-header-and-items-in-internal-table/m-p/5203506#M1203827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;check out this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;begin of fs_branch,&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;end of fs_branch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;t_branch like standard table of fs_branch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;begin of fs_org,&lt;/P&gt;&lt;P&gt;  ...&lt;/P&gt;&lt;P&gt; branch like t_branch,&lt;/P&gt;&lt;P&gt;end of fs_org.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;t_org like standard table of fs_org,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append the data in both org and branches.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while looping, &lt;/P&gt;&lt;P&gt;loop at t_org inot fs_org.&lt;/P&gt;&lt;P&gt;write: / fs_org.&lt;/P&gt;&lt;P&gt;loop at fs_org-branch to fs_branch.&lt;/P&gt;&lt;P&gt;write: / fs_branch.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;skip.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 04:02:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-code-header-and-items-in-internal-table/m-p/5203506#M1203827</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-11T04:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to code header and items in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-code-header-and-items-in-internal-table/m-p/5203507#M1203828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Use control events like AT NEW&lt;/P&gt;&lt;P&gt;First declare a structure,&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;sort itab by ORG.&lt;/P&gt;&lt;P&gt;Loop at itab into fs_tab.&lt;/P&gt;&lt;P&gt;AT NEW ORG.&lt;/P&gt;&lt;P&gt;  write:/ Organization field.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;write:/ BRANCH FIELD,&lt;/P&gt;&lt;P&gt;       /  CITY FIELD.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 04:02:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-code-header-and-items-in-internal-table/m-p/5203507#M1203828</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-11T04:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to code header and items in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-code-header-and-items-in-internal-table/m-p/5203508#M1203829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;You can comapare this with the contents of DB table SPFLI .In that for each Carrid ( suppose AA )  There may be one or more than Connid ( 0017  and 0064 ) .&lt;/P&gt;&lt;P&gt;So if you want take that carrid as Header and Connid as item ( for comparison ) , the code will be like this----&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : fs_spfli type spfli,
 t_spfli like table of fs_spfli.

select * from SPFLI into table t_spfli.

loop at t_spfli into fs_spfli.
AT NEW carrid.
write:/ fs_spfli-carrid.
ENDAT.

write:/ fs_spfli-connid

endlooop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 04:04:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-code-header-and-items-in-internal-table/m-p/5203508#M1203829</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-11T04:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to code header and items in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-code-header-and-items-in-internal-table/m-p/5203509#M1203830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi MJN,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can either declare one internal table to hold the header &amp;amp; item data or u can declare two separate interal tables for each one of it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose i take only one internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First declare a structure with all the relevant fields of the ORG &amp;amp; Branches then create an internal table for it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES:
    Begin of t_struct,
        org_field1       type &amp;lt;datatype&amp;gt; or &amp;lt;dataobj&amp;gt;,
        org_field2       type &amp;lt;datatype&amp;gt; or &amp;lt;dataobj&amp;gt;,
        branch_field1  type &amp;lt;datatype&amp;gt; or &amp;lt;dataobj&amp;gt;,
        branch_field2  type &amp;lt;datatype&amp;gt; or &amp;lt;dataobj&amp;gt;,
    END of t_struct.

Data:
   t_data like table of t_struct with header line.

select &amp;lt;fields declared in struct&amp;gt; from ORG Inner Join Branch ON &amp;lt;org_field&amp;gt; = &amp;lt;branch_field&amp;gt;
where &amp;lt;some condition&amp;gt; into table t_data.

if sy-subrc &amp;lt;&amp;gt; 0.
message 'No Records Found:" type 'E'.
endif.
endselect.

Loop at t_data into t_data.

at new &amp;lt;org_field1&amp;gt;
write: org_field.
endat.

write: branch_field1, branch_field2.

endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This shall solve the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 04:18:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-code-header-and-items-in-internal-table/m-p/5203509#M1203830</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-11T04:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to code header and items in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-code-header-and-items-in-internal-table/m-p/5203510#M1203831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tnx all&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2009 04:18:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-code-header-and-items-in-internal-table/m-p/5203510#M1203831</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-11T04:18:51Z</dc:date>
    </item>
  </channel>
</rss>

