Learn. Share. Contribute.

Thursday, December 28, 2017

Touching Feet - Update

It has been a few days since my first sincere attempt at touching feet.
After practice of about 4 days (5-10mins per day), I am now able to touch and grab all toe fingers using hands. It was made possible by tips from internet and from my sister who is a yoga athlete. As it turns out, inhale and exhale play a significant role in inching forward.

Virus-free. www.avast.com

Table Comprehension Example Like Nested Loop

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
DATA lt2 TYPE TABLE OF i.
lt2 = VALUE #( FOR lv IN lt ( lv * lv ) ).
"nested loop of lt and lt2 to create lines of lt3
DATA lt3 TYPE TABLE OF i.
lt3 = VALUE #( FOR lv IN lt FOR lv2 IN lt2 ( lv + lv2 ) ).
cl_demo_output=>display( lt3 ).


Virus-free. www.avast.com

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

Explore More Loop Group

I skimmed through below blogs and it is now clear that my previous posts on loop groups are just scratching the surface.

https://blogs.sap.com/2016/06/23/group-by-for-internal-tables-step-by-stepc/

https://blogs.sap.com/2014/10/02/abap-news-for-740-sp08-grouping-internal-tables/


Virus-free. www.avast.com

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

Friday, December 22, 2017

Touching Feet

Today I made a sincere effort to touch my own feet (yogasana) and failed. An article on internet was discussing the benefits of being flexible. It may reduce the impact of fall or injury because the muscles would need to bend/stretch more before tearing. The strategy of touching feet is to actually try touching it regularly and also some other exercises that focus of parts of it. All in all, it involves calf, hamstring, lower back etc. I hope that blogging about this would help not forget the goal.

This is one small fitness step just like numerous other failed attempts before. In case things get rolling, I would move on to other asanas.

For every such move, I would first be able to do it for fraction of second, then comes reps and last comes holds.

Grouping Internal Tables Rows In Loop

Demo program DEMO_LOOP_AT_GROUP_SYNTAX and respective documentation show 6 syntaxes in which grouping is done.

https://help.sap.com/doc/abapdocu_740_index_htm/7.40/en-US/abenloop_at_group_abexa.htm

First three group loops have representative binding and next three group loops have group key binding which is more explicit in nature.

While looping, result can be put into data, field-symbol or data reference. All are covered in example.