‎2007 Jan 25 11:23 AM
how to create inernal table ? plz help. and send 1 syntax for internal table.
‎2007 Jan 25 11:26 AM
data : begin of itab occurs 0,
matnr like mara-matnr,
end of itab.Regards,
Santosh
‎2007 Jan 25 11:27 AM
hi,
You can also declare like this.
TYPES : BEGIN OF ty_charg,
charg TYPE charg,
END OF ty_charg.
*Table
DATA : it_charg TYPE STANDARD TABLE OF ty_charg.
*Structure
DATA : x_charg TYPE ty_charg.Regards,
Richa
‎2007 Jan 25 11:31 AM
‎2007 Jan 25 11:28 AM
types: begin of it,
f1 type i ,
f2 type i,
end of it.
itab-f1 = 20.
itab-f2 = 30.
append itab.
data: itab type standard table of it with header line.
loop at it.
write:/it-f1, it-f2.
endloop.
u can also create sorted or hashed table based on ur requirement.
‎2007 Jan 25 11:29 AM
Hi Rohan ,
There are two ways of creating an internal table
1. data : Begin of it_1 occurs 0 ,
matnr type matnr ,
werks type werks_d,
End of it_1.
2. This is the prefered way , first you define and type and then declare an internal table of that type
TYPES : Begin of ty_1 ,
matnr type matnr ,
werks type werks_d,
End of ty_1.
DATA : it_1 type table of ty_1.
there is also one more way to creat internal tables when the structure is already define in the data dictionary e.g. if we want to create a table having structure similar to table MARA
DATA : it_1 type table of mara.
Regards
Arun
Assign points if reply is helpful
‎2007 Jan 25 11:30 AM
Hi Rohan,
*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)
An internal table is a run time instance. It get created when program starts execution.
*It get destroyed when program terminates. it has two different parts. HeaderLine(optional) & Body(Compulsory).
*Any value that comes to or goes from interanal table , that travels through headerline.\
header line is obselete now so we do not use with header line.
‎2007 Jan 25 11:31 AM