Lecture 11

New_Collect

TYPES : BEGIN OF TY_MAkt, matnr type matnr, spras type spras, maktx type maktx, qty TYPE i, amt TYPE i, END OF ty_makt. data : it_makt TYPE STANDARD TABLE OF ty_makt, wa_makt TYPE ty_makt.

wa_makt-matnr = '100'. wa_makt-spras = 'e'. wa_makt-maktx = 'soap'. wa_makt-qty = 1. wa_makt-amt = 10. *append wa_makt to it_makt. COLLECT wa_makt into it_makt. wa_makt-matnr = '200'. wa_makt-spras = 'e'. wa_makt-maktx = 'paste'. wa_makt-qty = 1. wa_makt-amt = 20. *append wa_makt to it_makt. COLLECT wa_makt into it_makt. wa_makt-matnr = '300'. wa_makt-spras = 'e'. wa_makt-maktx = 'brush'. wa_makt-qty = 1. wa_makt-amt = 15. *append wa_makt to it_makt. COLLECT wa_makt into it_makt. wa_makt-matnr = '100'. wa_makt-spras = 'e'. wa_makt-maktx = 'soap'. wa_makt-qty = 1. wa_makt-amt = 10. *append wa_makt to it_makt. COLLECT wa_makt into it_makt. wa_makt-matnr = '200'. wa_makt-spras = 'e'. wa_makt-maktx = 'paste'. wa_makt-qty = 1. wa_makt-amt = 20. *append wa_makt to it_makt. COLLECT wa_makt into it_makt. LOOP at it_makt INTO wa_makt. at FIRST . write : / ' At first triggered ',sy-tabix. ENDAT. at LAST. write : / ' At first triggered ',sy-tabix. ENDAT.

.Endloop.

Sign up to vote on this title
UsefulNot useful