‎2007 May 09 6:53 AM
Itab like ekko and itab like table of ekko ...
what is the diff between these two?
‎2007 May 09 6:56 AM
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
‎2007 May 09 6:55 AM
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.
‎2007 May 09 6:56 AM
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
‎2007 May 09 6:57 AM
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
‎2007 May 09 7:00 AM
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
‎2007 May 09 7:02 AM
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
‎2007 May 09 7:08 AM
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.
‎2007 May 09 7:16 AM
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.