Write a form WRITE_TABLE which accepts any internal table.
Write the contents of the internal table to the ABAP list, line by line and field by field.
Define and fill an internal table with a line type of your choice to test the form WRITE_TABLE.
REPORT zsolar.
DATA: BEGIN OF i_solar OCCURS 0,
aa TYPE string,
bb TYPE string,
END OF i_solar.
i_solar-aa = '111'.
i_solar-bb = '222'.
APPEND i_solar.
i_solar-aa = '333'.
i_solar-bb = '444'.
APPEND i_solar.
i_solar-aa = '555'.
i_solar-bb = '666'.
APPEND i_solar.
PERFORM frm_write_table USING i_solar[].
*&---------------------------------------------------------------------*
*& Form frm_write_table
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM frm_write_table USING itab TYPE ANY TABLE.
FIELD-SYMBOLS: <fs> TYPE ANY,
<foo> TYPE ANY.
LOOP AT itab ASSIGNING <fs>.
DO.
UNASSIGN <foo>.
ASSIGN COMPONENT sy-index OF STRUCTURE <fs> TO <foo>.
IF <foo> IS ASSIGNED.
WRITE: <foo>, '|'.
ELSE.
EXIT.
ENDIF.
ENDDO.
NEW-LINE.
ENDLOOP.
ENDFORM. "frm_write_table