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.