问题:截取字符串“SNTY2TI 071082241AF”中07108,常规字符串截取方法。
这里直接上代码:
REPORT zsy_zm_test19.
DATA:lv_datum TYPE sy-datum VALUE '20230428',
lv_datum2 TYPE sy-datum VALUE '20220522'.
DATA:lv_num TYPE i.
DATA:lv_string TYPE string VALUE 'SNTY2TI 071082241AF'.
DATA: t1 TYPE i,
t2 TYPE i.
GET RUN TIME FIELD t1.
lv_num = strlen( lv_string ) - 6.
lv_string = lv_string+0(lv_num).
lv_num = strlen( lv_string ) - 5.
lv_string = lv_string+lv_num(5).
GET RUN TIME FIELD t2.
t1 = t2 - t1.
WRITE:lv_string,t1.