1 Data: num type I. 2 constants: Times type I value 29. 3 Data: Begin of ih_lgty, 4 lgty type lgtyp, 5 end of ih_lgty, 6 it_lgty like table of ih_lgty. 7 Field-Symbols: <lgty> type any, 8 <t334t> like t334t. 9 10 Data: lh_t334t like t334t, 11 lt_t334t like table of t334t. 12 13 select single14 * 15 into lh_t334t16 from t334t17 where lgnum = 'nj1' 18 and kzear = 'A' 19 and lgtkz = 'bc1 '. 20 *** sort the data in a workspace to 21 assign lh_t334t to <t334t> in an internal table. 22 do times times.23 num = 10 + sy-index.24 unassign <lgty>. 25 assign component num of structure <t334t> to <lgty>. 26 ih_lgty-lgty = <lgty>. 27 append ih_lgty to your enddo.29 Delete it_lgty where lgty is initial.30 *** 31 sort it_lgty.32 Delete adjacent duplicates from it_lgty comparing all fields.33 num = lines (it_lgty ). 34 write: num.
Data in the Workspace:
After sorting, the data in the internal table is: