ABAP HANA 7.51: FOR Operator
FOR Operator works for iteration operation with a combination of REDUCE, NEW and VALUE operators. FOR is a versatile operator and offers an effective alternative to LOOP operator with better performance. Using FOR is good programming practice in new ABAP syntax and should be part of every ABAP coding convention
Sample Source Code applicable for all Variants below… used for test data creation
Sample Source Code: Variant 1
Output: Variant 1
Sample Source Code: Variant 2
Output: Variant 2
Sample Source Code: Variant 3
Output: Variant 3
Sample Source Code: Variant 4
Output: Variant 4
Sample Source Code: Variant 5
Output: Variant 5
Sample Source Code: Variant 6
This is provided just for illustration purpose. The output is an object here(lt_value_new) and not an Internal table!
lt_value_new will get following information:
Check the video for Illustration and Example:
Find the code on GitHub: