Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Abap code loop

Former Member
0 Likes
475

Hi Gurus,

I have code shown below that return the first line at the end of the loop, thus when the data is displayed the last line is repeated like the first line. Any idea to solve it? Thank you.

LOOP AT t_zsd INTO wa_zsd.

w_index = w_index + 1.

IF sy-subrc EQ 0.

READ TABLE t_mseg INTO wa_mseg WITH KEY mblnr = wa_zsd-delnum.

APPEND wa_mseg to t_mseg.

ENDIF.

IF sy-subrc EQ 0.

wa_mseg-serial_num = wa_zsd-serial_num.

MODIFY t_mseg FROM wa_mseg INDEX w_index TRANSPORTING serial_num.

ENDIF.

ENDLOOP.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
414

.

.

.

clear : t_zsd

clear : wa_zsd

endloop.

This shall work.

If that works then reward point expected.

2 REPLIES 2
Read only

Former Member
0 Likes
414

Hi Chin,

I think you should post your question in ABAP development forums.

Regards,

Nicolas

Read only

Former Member
0 Likes
415

.

.

.

clear : t_zsd

clear : wa_zsd

endloop.

This shall work.

If that works then reward point expected.