In a business scenario, you can organize multiple fields in a workspace into an internal table.

Source: Internet
Author: User
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:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.