SAP TABLE CMPRHNSNS STEP ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_ITAB - Table Comprehensions, Use of Step Size
This example demonstrates how the step size and the processing order are used in table comprehensions.

ABAP_SOURCE_CODE
DEMO CL_DEMO_TABLE_COMPRH_STEP

ABAP_DESCRIPTION
The content of an internal table itab is defined by using the additions STEP and USING KEY. Every second table line is read in descending order based on the STEP statement, starting at the fourth table line from last because of the FROM addition. Every second table line is read in ascending order based on the USING KEY and STEP statement, starting at the fourth first table line because of the FROM addition. Every second table line is read in descending order based on the USING KEY and STEP statement, starting at the fifth table line from last because of the FROM addition. Every second table line is read in ascending order based on the STEP statement, starting at the fifth first table line because of the FROM addition.
See also the executable example for the LOOP statement using the addition STEP.