Explain internal table with and without header. - Pavan

Internal tables are of two types
1. tables with header line
2. tables with out header line.

With header line.
Data can be directly go to header first and will be placed in body when we used APPEND statement. It can't be used for nesting of internal tables.

ex: data: itab like mara occurs 0 with header line.

or

itab like standard table of ekko with header line.

Then itab is a internal with header line so you can use itab directly.

ex:
select * from itab INTO TABLE itab where matnr in p_matnr.

loop at itab.
write:/10 itab-fld1.
,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,
endloop.

Tables without header line:

For these tables we need to create a explicit header [workarea] and doing anything for data should be through that explicit header only.

ex:
data: itab like mara,
wa like mara.
itab is a internal table without header line [only body] and wa is the explicit workarea. 
for this itab when you want to populate data you have to do like this.

select * from mara into wa where mantr in p_matnr.
append itab from wa.
endselect.

For accessing data of internal table

loop at itab into wa.
write:/10 wa-fld1,
................
............

endloop. 

 

 

 

Serkan AKKAVAK
Computer Engineer
SAP Department Deputy Manager
Contact : serkurumsal@yandex.com