With Header & Without Header Internal Table

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.

More Abapers Questions:

ABAP Books List
ABAP/4 Certification, Programming and Object Oriented Programming Books

Smart Forms
SAP Smartforms

ABAP Menu:
ABAP Example Hints and Tips

Return to Index:-
SAP ABAP/4 Programming, Basis Administration, Configuration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.  The site www.gotothings.com is in no way affiliated with SAP AG.
Any unauthorised copying or mirroring is prohibited.