Thursday, December 28, 2017

Table Comprehension Example

Below snippet is populating itab lt2 whose every line is related to that of itab lt.

DATA lt TYPE TABLE OF i.
DO 10 TIMES.
APPEND sy-index TO lt.
ENDDO.
"loop at itab into wa. fill wa2 using wa and append lt2, all this using table expression
DATA lt2 TYPE TABLE OF i.
lt2 = VALUE #( FOR lv IN lt ( lv * lv ) ).
cl_demo_output=>display( lt2 ).


Virus-free. www.avast.com

No comments: