Chinaunix首页 | 论坛 | 博客
  • 博客访问: 174649
  • 博文数量: 22
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 345
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-08 11:07
文章分类

全部博文(22)

文章存档

2011年(1)

2009年(2)

2008年(19)

我的朋友

分类:

2008-04-12 08:42:05

REPORT  ZTEST_parell_mothod                              .
DATA: BEGIN OF LINE1,
        COL1 TYPE I,
      END OF LINE1.
DATA ITAB1 LIKE LINE1 OCCURS 10.

DATA: BEGIN OF LINE2,
        COL1 TYPE I,
        COL2 TYPE C,
      END OF LINE2.
DATA ITAB2 LIKE LINE2 OCCURS 10.

DATA ITAB3 LIKE LINE2 OCCURS 10.

LINE1-COL1 = 1.  APPEND LINE1 TO ITAB1.
LINE1-COL1 = 4.  APPEND LINE1 TO ITAB1.
LINE1-COL1 = 5.  APPEND LINE1 TO ITAB1.

LINE2-COL1 = 9. LINE2-COL2 = 'A'. APPEND LINE2 TO ITAB2.
LINE2-COL1 = 1. LINE2-COL2 = 'A'. APPEND LINE2 TO ITAB2.
LINE2-COL1 = 2. LINE2-COL2 = 'B'. APPEND LINE2 TO ITAB2.
LINE2-COL1 = 3. LINE2-COL2 = 'B'. APPEND LINE2 TO ITAB2.
LINE2-COL1 = 4. LINE2-COL2 = 'B'. APPEND LINE2 TO ITAB2.
LINE2-COL1 = 5. LINE2-COL2 = 'A'. APPEND LINE2 TO ITAB2.

DATA V_I TYPE I.
V_I = 1.
loop at ITAB1 into LINE1 .
  loop at ITAB2 into line2 from v_i where COL1 =  LINE1-col1.
    if LINE1-col1 = LINE2-col1 .
    APPEND  line2  TO ITAB3.
    V_I = V_I + 1 .
    else.
    exit.
    endif.
  endloop.
endloop.

loop at ITAB3 into line2 .
write : / line2-col1.
endloop.

阅读(938) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~