Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Abap code loop

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.


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.



Former Member

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question