Skip to Content
0
Former Member
Sep 14, 2011 at 01:40 PM

Symplify a calendar loop code

24 Views

Hi experts,

Could anyone help me to symplify this following code ?

LOOP AT itab.
    IF itab-daytype01 EQ 1.
      itab-daytext01 = 'holi'.
      MODIFY itab.
    ENDIF.
    IF itab-daytype02 EQ 1.
      itab-daytext02 = 'holi'.
      MODIFY itab.      
    ENDIF.
    IF itab-daytype03 EQ 1.
      itab-daytext03 = 'holi'.
      MODIFY itab.      
    ENDIF.
    .
    .
    .
    IF itab-daytype31 EQ 1.
      itab-daytext31 = 'holi'.
      MODIFY itab.
    ENDIF.           
  ENDLOOP.

A calendar loops 12 times for 12 months and in each loop there are 31 days. For each day I need to change the daytext value due to the daytype value...

Thanks a lot,

Nata