小弟在网上也找了下,没有关于sy-tabix的更多说明,只是在loop......endloop中起作用,这个也看明白了,
但是下面的这段代码中的sy-tabix不知道怎么算出来的。
REPORT Z_TGMTEST_DOCU10.
DATA: frankfurt(4) TYPE x,
frisco(4) TYPE x,
intersect(4) TYPE x,
union(4) TYPE x,
bit TYPE i.
DATA: carrid TYPE spfli-carrid,
carrier LIKE SORTED TABLE OF carrid
WITH UNIQUE KEY table_line.
DATA wa TYPE spfli.
SELECT carrid FROM scarr INTO TABLE carrier.
SELECT carrid cityfrom FROM spfli
INTO CORRESPONDING FIELDS OF wa.
WRITE: / wa-carrid, wa-cityfrom.
READ TABLE carrier FROM wa-carrid into carrid.
write:/ 'carrid is:',carrid.
CASE wa-cityfrom.
WHEN 'FRANKFURT'.
SET BIT sy-tabix OF frankfurt.
WHEN 'SAN FRANCISCO'.
SET BIT sy-tabix OF frisco.
ENDCASE.
write:/ sy-tabix.
ENDSELECT.
intersect = frankfurt BIT-AND frisco.
union = frankfurt BIT-OR frisco.
SKIP.
WRITE 'Airlines flying from Frankfurt and San Francisco:'.
DO 32 TIMES.
GET BIT sy-index OF intersect INTO bit.
IF bit = 1.
READ TABLE carrier INDEX sy-index INTO carrid.
WRITE carrid.
ENDIF.
ENDDO.
SKIP.
WRITE 'Airlines flying from Frankfurt or San Francisco:'.
DO 32 TIMES.
GET BIT sy-index OF union INTO bit.
IF bit = 1.
READ TABLE carrier INDEX sy-index INTO carrid.
WRITE carrid.
ENDIF.
enddo.
------解决方案--------------------------------------------------------
怎么没人看呢,自己顶起来。