Output2 = VALUE #( BASE output2 ( number2 ) ). LOOP AT itab INTO DATA(number2) USING KEY key. Output1 = VALUE #( BASE output1 ( number1 ) ).ĭATA output2 TYPE TABLE OF i WITH EMPTY KEY. Itab = VALUE #( FOR i = 1 UNTIL i > 10 ( rnd->get_next( ) ) ).ĭATA output1 TYPE TABLE OF i WITH EMPTY KEY. WITH NON-UNIQUE SORTED KEY key COMPONENTS table_line. The second loop returns the rows sorted in ascending order.ĭATA(rnd) = cl_abap_random_int=>create( seed = + sy-uzeitĭATA itab TYPE STANDARD TABLE OF i WITH EMPTY KEY The first loop returns the rows in the order they were appended. The example demonstrates the difference between loops across a standard table of random numbers whereĪ sorted secondary table key is specified and those where it is not. Otherwise a syntax error occurs or an exception is raised. If a secondary table key is specified, any WHERE condition also specified must be Unlike the processing of a hashed table when a primary key is used, a preceding sort using the statement SORT has no influence on the processing order when a secondary hash key is specified. In each loop pass, the system field sy-tabix contains the value 0. The rows are processed in the order in which they were inserted into the table. In each loop pass, the system field sy-tabix contains the row number of the current row in the associated secondary table index. The rows are processed by ascending row number in the Secondary table key is specified, the order in which the rows are accessed is as follows: Key is specified using the name primary_key, the processing behaves in the same way as when no key is explicitly specified. The specified table key influences the order in which the table rows are accessed, and the evaluation of the remaining conditions. The addition USING KEY can be used to specify a table key keyname with which the processing is carried out. Including the statement in a procedure that is called in the loop is not sufficient. This type of statement must thenīe executed in the loop itself. Keyname is used and where it can be declared explicitly. This is possible in all statements where the table key Within the loop, the key being used can be addressed using the predefined loop_key. If no conditions are declared, all table rows are read. The table rows to be read in a LOOP loop can also be limited using optional conditions. The table key with which the loop is executed. Processing Statements for Internal Tables → SAP NetWeaver AS ABAP Release 751, ©Copyright 2017 SAP AG.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |