Effect If dtype is a tabular data type or # represents a type like this, further parentheses can be added at the top level in the parentheses after dtype. Each inner parenthesis inserts a row into the tabular return value. The same items can be specified in every inner parenthesis and the same rules apply as in the construction of table rows using the instance operator NEW. In particular, the short form for structured types described there can be used.
Note Internal table rows are constructed in accordance with the rules for the instance operator NEW, since new table rows are created here as well.
Example Constructs an internal table with an elementary row type and fills it with three rows. The first row inserted is initial. TYPES t_itab TYPE TABLE OF i WITH EMPTY KEY.
DATA itab TYPE t_itab.
itab = VALUE #( ( ) ( 1 ) ( 2 ) ).
Example Constructs an internal table with an elementary row type of type string and fills it with three rows. The result is a table that is given the previous day, current day, and next day formatted for the cur rent language environment. TYPES t_date_tab TYPE TABLE OF string WITH EMPTY KEY.
DATA date_tab TYPE t_date_tab.
date_tab = VALUE #( ( |{ CONV d( sy-datlo - 1 ) DATE = ENVIRONMENT }| ) ( |{ sy-datlo DATE = ENVIRONMENT }| ) ( |{ CONV d( sy-datlo + 1 ) DATE = ENVIRONMENT }| ) ).
Example Constructs an internal table with a structured row type and fills it with two rows. The structures are filled with values component by component. TYPES: BEGIN OF t_struct, col1 TYPE i, col2 TYPE i, END OF t_struct, t_itab TYPE TABLE OF t_struct WITH EMPTY KEY.
Example Constructs an internal table with a tabular row type and fills it with two rows. The first row is assigned a table that is already filled. The second row is constructed using VALUE. TYPES: t_itab1 TYPE TABLE OF i WITH EMPTY KEY, t_itab2 TYPE TABLE OF t_itab1 WITH EMPTY KEY.