作者 | segaa.bbs@segaa.com.tw (我很好) | 看板 | P_segaa |
標題 | [文件] abap substring | ||
時間 | 幸運草之戀 (2012/11/27 Tue 13:21:27) | ||
SPLIT 拆分子串
------------------------------------------------------
取前八位
data a type c(30).
a = '88888888abcdefg'.
a = a(6). "取前6位
a = a+6(1). "取第7位
a = a+6 . "取第六位后的所有字符
-------------------------------------------------------
拆分
split XXX at into table XXX
SPLIT dobj AT sep INTO
{ {result1 result2 ...} | {TABLE result_tab} }
[IN {BYTE|CHARACTER} MODE].
--------------------------------------------------------
拼接
DATA NAME (30).
NAME(10) = ' Dr.',
NAME+10(10) = 'Michael',
NAME+20(10) = 'Hofmann'.
CONDENSE NAME.
WRITE NAME.
-------------------------------------------------------
去空格
CONDENSE
|
DATA lv_str TYPE string .
lv_str = 'hello, how are you today' . write:/ lv_str+7 , / lv_str+7(3) , / lv_str(7) .
The output should be:
how are you today