cancel
Showing results for 
Search instead for 
Did you mean: 

how to increase number in looping?

former_member635273
Participant
0 Kudos
932

i have tried looping number. and every looping i add 1 to variable. but, the output still 1.

LOOP AT it_res.
      MOVE-CORRESPONDING it_res TO wa_item.
         wa_item-id = wa_item-id + 1.
      APPEND wa_item TO it_item.
ENDLOOP.

i've tried "add 1 to wa_item-id " but it's same.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

MathieuL
Discoverer

When using LOOP AT, SY-TABIX contains the row number of the current row in the table.

Your problem is when you do the move-corresponding, WA_ITEM-ID is cleared because not part of the IT_RES structure.

WA_ITEM-ID = WA-ITEM-ID + 1

gives always 1

former_member635273
Participant
0 Kudos

thnks sir. it's done.

Answers (0)