Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Itab

Former Member
0 Likes
903

Itab like ekko and itab like table of ekko ...

what is the diff between these two?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
877

hi,

chk this.

REPORT  ZTYPES                                                  .

* 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)

Regards

Reshma

7 REPLIES 7
Read only

hymavathi_oruganti
Active Contributor
0 Likes
877

one will be work area and other will be table.

if we decalre

itab like line of ekko----


it will be work area

itab type table of ekko----


it will be table.

Read only

Former Member
0 Likes
878

hi,

chk this.

REPORT  ZTYPES                                                  .

* 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)

Regards

Reshma

Read only

Former Member
0 Likes
877

Hi Balu,

Itab like ekko creates a table having structure ekko.

whereas itab like line of ekko is having <b>line type</b> of that particular table.

Reward points if helpful.

Rewards,

Hemant

Read only

0 Likes
877

hi,

statement

itab like ekko

creates a work area of the type ekko

whereas, statement

itab like table of ekko

creates an internal table with the line type of table ekko.

Regards,

Navdeep

Read only

Former Member
0 Likes
877

Hi balu,

If you use

itab like ekko, then it will be a workarea.

itab like table of ekko, then it will be a table.

Reward useful answers.

Regards

Sayee

Read only

Former Member
0 Likes
877

itab like ekko ====== it will be work area which can be reused for any internal tables with out header line

itab type table of ekko ====== it will be table with headerline having same structure of ekko.it cant be used for storing records of other tables like ekpo,makt....

reward some points if useful.

Read only

Former Member
0 Likes
877

hi,

itab like ekko means .internal table is like workarea ekko.

itab like table ekko means.it is referring to internal table ekko.

reward with points if helpful.