internal table operation

1: the basic operation

*&---------------------------------------------------------------------*
*& Report ZHANSEN28
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ZHANSEN28.
DATA: BEGIN OF linv Occurs 0,  "define the internal table.
      Name(20) TYPE C,
      ID_Number TYPE I,
END OF linv.

DATA table1 LIKE TABLE OF linv.     "define a variable of linv.
linv-Name = 'Melissa'.
linv-ID_Number = 105467.
APPEND linv TO table1.              "append the data to table.

linv-Name = 'Melissb'.
linv-ID_Number = 105468.
APPEND linv TO table1.               "append again.

LOOP AT table1 INTO linv.             "loop print the data of table.
Write: / linv-name, linv-ID_Number.
ENDLOOP.

2:

猜你喜欢

转载自www.cnblogs.com/liyafei/p/10529596.html