***如果某行首为':61:',其下面一行起始字符不为':86:',则改为最大长度为4
REPORT z_barry_test .
DATA: itab TYPE STANDARD TABLE OF raw_data WITH HEADER LINE,
re_tab TYPE match_result_tab WITH HEADER LINE,
index TYPE i.
START-OF-SELECTION.
APPEND ':61:ADSDFF' TO itab.
APPEND 'skdjfsd' TO itab.
APPEND ':61:jkjkj' TO itab.
APPEND ':86:skdfjskdjf' TO itab.
APPEND ':61:jkjkj' TO itab.
APPEND ':86:skdfjskdjf' TO itab.
APPEND ':86:s:61:skdjf' TO itab.
APPEND 'skdfjskdjf' TO itab.
APPEND ':86:skdfjskdjf' TO itab.
APPEND ':61:jkjkj' TO itab.
APPEND ':86:skdfjskdjf' TO itab.
APPEND ':61:jkjkj' TO itab.
APPEND 'skdfjskdjf' TO itab.
FIND ALL OCCURRENCES OF ':61:' IN TABLE itab RESULTS re_tab[].
LOOP AT re_tab.
CHECK re_tab-offset = 0 .
index = re_tab-line + 1 .
READ TABLE itab INDEX index.
IF sy-subrc = 0 .
CHECK itab(4) <> ':86:'.
itab = itab(4).
MODIFY itab INDEX index.
ENDIF.
ENDLOOP.
LOOP AT itab.
WRITE / itab.
ENDLOOP.
阅读(2934) | 评论(0) | 转发(0) |