<?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: Internal table declaration - work area and body in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-declaration-work-area-and-body/m-p/1497732#M230891</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may be able to do somethingn like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report  zrich_0003.

Type-pools: slis.

types: begin of ttab.
        include structure ZRESULT_LINE.
types: tcolor type slis_t_specialcol_alv.
types: end of ttab.

data: itab type table of ttab.
data: wa like line of itab.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Sep 2006 22:23:34 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-09-05T22:23:34Z</dc:date>
    <item>
      <title>Internal table declaration - work area and body</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-declaration-work-area-and-body/m-p/1497729#M230888</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 have declared my internal table in my program as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data : itab_wa type ZRESULT_LINE,
       itab    type ZRESULT_ROW.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where ZRESULT_LINE and ZRESULT_ROW are the structure and table types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to add&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: TCOLOR TYPE SLIS_T_SPECIALCOL_ALV.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in my internal table declaration. How can I do this. Please remember I need to have work area and body in my internal table as I have used work area and body in my code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Waiting..............&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Raju Boda&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2006 21:01:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-declaration-work-area-and-body/m-p/1497729#M230888</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-05T21:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table declaration - work area and body</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-declaration-work-area-and-body/m-p/1497730#M230889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the table type is SLIS_T_SPECIALCOL_ALV, then your work area would be SLIS_SPECIALCOL_ALV.  So your declaration will be like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : it_color type SLIS_T_SPECIALCOL_ALV,&lt;/P&gt;&lt;P&gt;       wa_color type SLIS_SPECIALCOL_ALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you need to include the following statement in the TOP include of your program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE-POOLS: SLIS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hith&lt;/P&gt;&lt;P&gt;Sunil Achyut&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Sunil Achyut&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2006 21:06:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-declaration-work-area-and-body/m-p/1497730#M230889</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-05T21:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table declaration - work area and body</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-declaration-work-area-and-body/m-p/1497731#M230890</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;See the Declarion types of workarea and Internal tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* Table declaration (old method)
DATA: BEGIN OF tab_ekpo OCCURS 0,             "itab with header line
  ebeln TYPE ekpo-ebeln,
  ebelp TYPE ekpo-ebelp,
 END OF tab_ekpo.

*Table declaration (new method)     "USE THIS WAY!!!
TYPES: BEGIN OF t_ekpo,
  ebeln TYPE ekpo-ebeln,
  ebelp TYPE ekpo-ebelp,
 END OF t_ekpo.
DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,      "itab
      wa_ekpo TYPE t_ekpo.                    "work area (header line)

* Build internal table and work area from existing internal table
DATA: it_datatab LIKE tab_ekpo OCCURS 0,      "old method
      wa_datatab LIKE LINE OF tab_ekpo.

* Build internal table and work area from existing internal table,
* adding additional fields
TYPES: BEGIN OF t_repdata.
        INCLUDE STRUCTURE tab_ekpo.  "could include EKKO table itself!!
TYPES: bukrs  TYPE ekpo-werks,
       bstyp  TYPE ekpo-bukrs.
TYPES: END OF t_repdata.
DATA: it_repdata TYPE STANDARD TABLE OF t_repdata INITIAL SIZE 0,   "itab
      wa_repdata TYPE t_repdata.                 "work area (header line&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you need to maintain same structure for both workarea as well Internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2006 21:08:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-declaration-work-area-and-body/m-p/1497731#M230890</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-05T21:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table declaration - work area and body</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-declaration-work-area-and-body/m-p/1497732#M230891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may be able to do somethingn like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report  zrich_0003.

Type-pools: slis.

types: begin of ttab.
        include structure ZRESULT_LINE.
types: tcolor type slis_t_specialcol_alv.
types: end of ttab.

data: itab type table of ttab.
data: wa like line of itab.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2006 22:23:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-declaration-work-area-and-body/m-p/1497732#M230891</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-09-05T22:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table declaration - work area and body</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-declaration-work-area-and-body/m-p/1497733#M230892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i think you are using nested table for coloring the cells&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use this way..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of i_struc,&lt;/P&gt;&lt;P&gt;         field1 type ....,&lt;/P&gt;&lt;P&gt;         field2 type ....,&lt;/P&gt;&lt;P&gt;         field3 type ....,&lt;/P&gt;&lt;P&gt;         field4 type ....,&lt;/P&gt;&lt;P&gt;        TCOLOR TYPE SLIS_T_SPECIALCOL_ALV,&lt;/P&gt;&lt;P&gt;      end of i_struc.&lt;/P&gt;&lt;P&gt;data: itab type standard table of i_struc,&lt;/P&gt;&lt;P&gt;      line type i_struc,&lt;/P&gt;&lt;P&gt;      col_line type slis_specialcol_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now while populating&lt;/P&gt;&lt;P&gt;col_line-fild = ''&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;line-tcol = col_line.&lt;/P&gt;&lt;P&gt;append line to itab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2006 22:32:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-declaration-work-area-and-body/m-p/1497733#M230892</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-05T22:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table declaration - work area and body</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-declaration-work-area-and-body/m-p/1497734#M230893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data : tcol type slis_t_specialcol_alv,&lt;/P&gt;&lt;P&gt;       scol type slis_specialcol_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;scol-filed1 = ''&lt;/P&gt;&lt;P&gt;scol-filed1 = ''&lt;/P&gt;&lt;P&gt;scol-filed1 = ''&lt;/P&gt;&lt;P&gt;append scol to tcol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move this tcol to your line.&lt;/P&gt;&lt;P&gt;then append this line to your internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;all the best&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2006 22:34:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-declaration-work-area-and-body/m-p/1497734#M230893</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-05T22:34:40Z</dc:date>
    </item>
  </channel>
</rss>

