美文网首页
SY-FDPOS用法

SY-FDPOS用法

作者: SmalltalkVoice | 来源:发表于2016-08-12 08:24 被阅读213次

SY-FDPOS用于显示查找字符串在母字符串中的位置

DATA STRING(30) VALUE 'This is a little sentence.'.
WRITE: / 'Searched', 'SY-SUBRC', 'SY-FDPOS'.ULINE /1(26).
SEARCH STRING FOR 'X'.
WRITE: / 'X', SY-SUBRC UNDER 'SY-SUBRC',  SY-FDPOS UNDER 'SY-FDPOS'
SEARCH STRING FOR 'itt '.
WRITE: / 'itt   ', SY-SUBRC UNDER 'SY-SUBRC', SY-FDPOS UNDER 'SY-FDPOS'
SEARCH STRING FOR '.e .'.
WRITE: / '.e .', SY-SUBRC UNDER 'SY-SUBRC',SY-FDPOS UNDER 'SY-FDPOS'.
SEARCH STRING FOR '*e'.
WRITE: / '*e ', SY-SUBRC UNDER 'SY-SUBRC',SY-FDPOS UNDER 'SY-FDPOS'.
SEARCH STRING FOR 's*'.
WRITE: / 's* ', SY-SUBRC UNDER 'SY-SUBRC',SY-FDPOS UNDER 'SY-FDPOS'.
Output:
**SEARCHED SY-SUBRC SY-FDPOS
X            4        0
itt          0       11
.e .         0       15
*e           0       10
s*           0       17
**

相关文章

网友评论

      本文标题:SY-FDPOS用法

      本文链接:https://www.haomeiwen.com/subject/okwssttx.html