![]() ![]() This is possible since the row type of base2 can be converted into this row type Sorted tables are constructed, which means that the rows in the results are also sorted. The type itab2 is specified explicitly for tab3. This is not possible in the construction of tab3 since the row type of base2 is not structured and suitable for specifying individual components in the following parentheses. The table type of base1 or base2 is applied in the construction of tab1 and tab2. In the above example, The tables tab1, tab2, tab3 are filled differently using different base tables. Itab2 TYPE SORTED TABLE OF struct WITH UNIQUE KEY col1 col2 col3. Itab1 TYPE SORTED TABLE OF string WITH UNIQUE KEY table_line, The second row is constructed using VALUE. The first row is assigned a table that is already filled. ( VALUE t_itab1( ( 4 ) ( 5 ) ( 6 ) ) ) ).,Ĭonstructs an internal table with a tabular row type and fills it with two rows. T_itab2 TYPE TABLE OF t_itab1 WITH EMPTY KEY. TYPES: t_itab1 TYPE TABLE OF i WITH EMPTY KEY The first row inserted in itab is initial and the last three rows are taken from the table jtab filled previously. jtab is filled with three rows and itab with six rows. TYPES t_itab TYPE TABLE OF i WITH EMPTY KEYĭATA(jtab) = VALUE t_itab( ( 10 ) ( 20 ) ( 30 ) ).ĭATA(itab) = VALUE t_itab( ( ) ( 1 ) ( 2 ) ( LINES OF jtab ) ).Ĭonstructs an internal table with an elementary row type. let, the addition of BASE keyword along with the target variable is specified.įew other examples are as follows. LHS: It contains the target internal table into which the data needs to be appended.In continuation of the example1, the above code snippet helps to append data into existing internal table ITAB_INDEX3. Itab_index3 = VALUE #( BASE itab_index3 FOR IN itab_for The existing data will not be overwritten. However if there is a need to add data to an existing variable, the keyword ' BASE' is used. The For.Let expression is used to populate the data into a newly created variable or overwrite the data completely with the new data. Base Statement ( Add data to existing table ) The For.Let expression which is a Loop statement will be executed for each row of the source table. In this example, the first column value is transferred with no change while the second column value is transferred with a change. RHS ( part 3 ) : The rest of the columns which does not utilize the constant 'X' are mentioned inside the parenthesis.In this example, the constant 'X' is used for calculation of Field3 column. RHS ( part 2 ) : The constant 'X' is defined using the keyword 'Let' which is then followed by the keyword 'IN' which indicates on the usage of this constant for the particular column.For loop starts with the keyword FOR which is followed by a field symbol defined on the fly ( ) and the source internal table name. ![]() This is followed by the target data type as defined in the program.
0 Comments
Leave a Reply. |