某種業務情境下,將一個工作區的多個欄位整理到一個內表中

來源:互聯網
上載者:User

標籤:style   blog   http   color   strong   資料   ar   2014   

 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 ***  將一個工作區的資料整理到一個內表中21 ASSIGN lh_t334t TO <t334t>.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 it_lgty.28 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.

工作區中的資料:

整理後,內表中的資料:

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.