SAP FROM TO

Get Example source ABAP code based on a different SAP table
  


ABAP Code Snippet

What does it do? If you use these additions, only the table rows from row number idx1, or up to row number idx2, are taken into account in the table index used. If only FROM is specified, all rows of the table from row number idx1 up to and including the last row are taken into account. If only TO is specified, all rows in the table from the first row up to row number idx2 are taken into account.

If the addition USING KEY is not used, or the primary table key is specified in keyname, the additions FROM and TO can only be used for index tables. In this case, they refer to the row numbers of the primary table index.

If a sorted secondary key is specified in keyname after USING KEY, the additions FROM and TO can be used for all table types and refer to the row numbers of the secondary table index.

idx1 and idx2 are numerical expression positions of operand type i. The following restrictions apply: If the value of idx1 is less than or equal to 0, it is set to 1 in the LOOP statement and causes a runtime error in every other statement. If the value of idx1 is greater than the total number of table rows, no processing takes place.
If the value of idx2 is less than or equal to 0, the LOOP statement is not carried out and in every other statement it leads to a runtime error. If the value of idx2 is greater than the number of table rows, it is set to the number of table rows.
If the value of idx2 is less than the value of idx1, no processing takes place.