Programming/ABAP
Internal Table 생성하기
_syd
2023. 8. 2. 22:45
1. TYPE 문
Types : begin of line,
column1 type I,
column2 type I,
end of line.
Data itab type line occurs 10.
TYPES 문을 사용해 정의한 대로 structure 를 생성한 후, Data 문으로 internal table 을 선언한다.
2. 기존 table 참조
기존 테이블을 참조하여 internal table을 생성할 수 있다.
기존 테이블은 standard SAP table, 사용자가 정의한 table 또는 다른 internal table 도 가능하다.
Syntax
Data <f> <type> [with header line].
Example
DATA gt_sflight TYPE SFLIGHT.
3. 기존 structure 참조
테이블과 마찬가지로 기존 structure 를 참조할 수 있다.
Syntax
Data <f> LIKE <struct> occurs n [with header line].
Example
DATA gt_sflight LIKE sflight.
sflight과 동일한 구조의 internal table 을 생성한다.
728x90