Code: Alles auswählen.
DATA gt_vbak TYPE STANDARD TABLE OF vbak.
START-OF-SELECTION.
SELECT * FROM vbak INTO TABLE gt_vbak.
LOOP AT gt_vbak REFERENCE INTO DATA(lr_vbak).
PERFORM write_line CHANGING lr_vbak.
ENDLOOP.
*&---------------------------------------------------------------------*
*& Form WRITE_LINE
*---------------------------------------------------*
* text
*----------------------------------------------------------------------*
* <--P_LR_VBAK text
*----------------------------------------------------------------------*
FORM write_line CHANGING pr_vbak TYPE data.
FIELD-SYMBOLS <line> TYPE any.
FIELD-SYMBOLS <field> TYPE any.
ASSIGN pr_vbak->* TO <line>.
WRITE: /.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE <line> TO <field>.
WRITE: <field>.
IF sy-index > 4.
EXIT.
ENDIF.
ENDDO. .
ENDFORM.