Thursday, December 28, 2017

Rewriting DEMO_LOOP_AT_GROUP_SYNTAX For Practice

I memorized the demo program, and tried write everything from scratch. Custom code is saved as ZDEMO_LOOP_AT_GROUP_SYNTAX on my local computer.

Idea was to:
  1. Define an itab of different structure, content and see how behavior changes when itab rows sort order is changed and when grouping is done with/without ASCENDING.
  2. Learn instantiation, sections and method chaining of class cl_demo_output
  3. Get familiar with the syntax variations.
  4. Truly understand the difference between representative binding and group key binding of group loop with member loop. I could see that group key had different runtime structure than itab row.

NOTE: The group loop output was one of these: ls, <ls>, ls->*. Respective name used in member LOOP AT GROUP was: ls, <ls>, ls. This is not what I expected when INTO REFERENCE was used. I first wrote LOOP AT GROUP ls->* and this gave syntax error.



Virus-free. www.avast.com

No comments: