REPORT YTEST.
DATA STR TYPE STRING VALUE 'Danial13288888888'.
DATA: LEN TYPE I,
P TYPE I,
L TYPE I.
DATA: CHAR TYPE STRING,
T TYPE C,
NAME(20) TYPE C,
TELNO(20) TYPE C.
DATA L_TYPE TYPE DD01V-DATATYPE.
LEN = STRLEN( STR ).
P = 0.
DO LEN TIMES.
CHAR = STR+P(1).
CALL FUNCTION 'NUMERIC_CHECK' "检查l_str是否为全数字组合
EXPORTING
STRING_IN = CHAR
IMPORTING
HTYPE = L_TYPE.
IF L_TYPE = 'NUMC'.
NAME = STR+0(P).
L = LEN - P.
TELNO = STR+P(L).
WRITE: NAME,TELNO.
EXIT.
ELSE.
P = P + 1.
CLEAR L_TYPE.
ENDIF.
ENDDO.
DATA STR TYPE STRING VALUE 'Danial13288888888'.
DATA: LEN TYPE I,
P TYPE I,
L TYPE I.
DATA: CHAR TYPE STRING,
T TYPE C,
NAME(20) TYPE C,
TELNO(20) TYPE C.
DATA L_TYPE TYPE DD01V-DATATYPE.
LEN = STRLEN( STR ).
P = 0.
DO LEN TIMES.
CHAR = STR+P(1).
CALL FUNCTION 'NUMERIC_CHECK' "检查l_str是否为全数字组合
EXPORTING
STRING_IN = CHAR
IMPORTING
HTYPE = L_TYPE.
IF L_TYPE = 'NUMC'.
NAME = STR+0(P).
L = LEN - P.
TELNO = STR+P(L).
WRITE: NAME,TELNO.
EXIT.
ELSE.
P = P + 1.
CLEAR L_TYPE.
ENDIF.
ENDDO.