- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Adding rows in an internal table with header line in SAP ABAP
Note that you shouldn’t use headers with internal tables. As you are using it, and header of in_table2 is empty. Use the loop to print it as below −
LOOP AT in_table2. "here in_table2 means table (an internal table) WRITE / in_table2. "here in_table2 means the header of the table (a structure) ENDLOOP.
When you have headers with internal tables, you shouldn’t use it in the same way. You should use field symbols for looping and append like this −
FIELD-SYMBOLS: <fs_for_loop> LIKE LINE OF in_table2. LOOP AT in_table2 ASSIGNING <fs_for_loop>. WRITE / <fs_for_loop>. ENDLOOP.
- Related Articles
- Inserting rows to an internal table through debug in SAP ABAP
- Checking number of rows in an internal table in SAP
- Sorting an already sorted internal table in ABAP
- Modification not working for both internal table and control table in SAP ABAP
- Difference between Work area, global structure and internal table in SAP ABAP
- Usage of subqueries in internal table as condition in SAP ABAP source code.
- Aggregating rows in SAP ABAP with the same name
- How to map output of a function to an internal table in SAP ABAP using Gateway service
- Using SAP ABAP, how can I read content of CSV files in a directory to an internal table?
- Finding a particular value in internal table itab in ABAP
- Is it possible to delete the actives while you are running a loop over an internal table in SAP ABAP?
- Difference between Internal tables, structures or work areas in SAP ABAP
- Inserting rows in an empty table to test output of ABAP code
- Using header rows during flat file upload in SAP HANA
- In SAP ABAP, mapping two database table fields